drm/i915: Move panel's backlight setup next to panel init
authorChris Wilson <chris@chris-wilson.co.uk>
Fri, 24 Jun 2016 13:00:13 +0000 (14:00 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Fri, 24 Jun 2016 13:42:09 +0000 (14:42 +0100)
Currently setting up the backlight for a panel is sometimes done
together with initialising the panel, and sometimes after the connector
is registered. The backlight setup does not depend upon connector
registration (i.e. access to sysfs/debugfs and the kobject hierachy) so
perform it consistently just after panel initialisation.

Note the discrepancy here as destroying the panel is done during
connector unregistration...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1466773227-7994-1-git-send-email-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/intel_drv.h
drivers/gpu/drm/i915/intel_dsi.c
drivers/gpu/drm/i915/intel_lvds.c

index 1f82dccfcd58c17b6aaddb295c5890ef247c059d..ca2de043b9ced2668a944ed4e9129ab008c80a81 100644 (file)
@@ -1496,7 +1496,8 @@ void intel_gmch_panel_fitting(struct intel_crtc *crtc,
                              int fitting_mode);
 void intel_panel_set_backlight_acpi(struct intel_connector *connector,
                                    u32 level, u32 max);
-int intel_panel_setup_backlight(struct drm_connector *connector, enum pipe pipe);
+int intel_panel_setup_backlight(struct drm_connector *connector,
+                               enum pipe pipe);
 void intel_panel_enable_backlight(struct intel_connector *connector);
 void intel_panel_disable_backlight(struct intel_connector *connector);
 void intel_panel_destroy_backlight(struct drm_connector *connector);
index b444d0e35a986496fc586b33659ca034c61b03f7..ae2dcaf1b52e8dd1edc1def38ab3daefb5451788 100644 (file)
@@ -1587,13 +1587,12 @@ void intel_dsi_init(struct drm_device *dev)
        connector->display_info.height_mm = fixed_mode->height_mm;
 
        intel_panel_init(&intel_connector->panel, fixed_mode, NULL);
+       intel_panel_setup_backlight(connector, INVALID_PIPE);
 
        intel_dsi_add_properties(intel_connector);
 
        drm_connector_register(connector);
 
-       intel_panel_setup_backlight(connector, INVALID_PIPE);
-
        return;
 
 err:
index 935b53642948421de4900427001a7c0a542318e2..6306c5499587812c08a318b5b8396ab2efad88cb 100644 (file)
@@ -1120,6 +1120,7 @@ out:
        mutex_unlock(&dev->mode_config.mutex);
 
        intel_panel_init(&intel_connector->panel, fixed_mode, downclock_mode);
+       intel_panel_setup_backlight(connector, INVALID_PIPE);
 
        lvds_encoder->is_dual_link = compute_is_dual_link_lvds(lvds_encoder);
        DRM_DEBUG_KMS("detected %s-link lvds configuration\n",
@@ -1134,8 +1135,6 @@ out:
        }
        drm_connector_register(connector);
 
-       intel_panel_setup_backlight(connector, INVALID_PIPE);
-
        return;
 
 failed: