Commit 19dfe572 authored by Ville Syrjälä's avatar Ville Syrjälä

drm/i915: Do intel_panel_destroy_backlight() later

Currently we destroy the backlight during connector unregistration.
That means the final modeset performed by drm_atomic_helper_shutdown()
will leave the backlight on. We don't want that so let's just move
intel_panel_destroy_backlight() into intel_panel_fini() which gets
called during connector destuction.

We still unregister the user visible backlight device during connector
unregistration.

Cc: Jani Nikula <jani.nikula@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20181008134641.24868-1-ville.syrjala@linux.intel.comReviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106386
parent 71ffd49c
...@@ -15860,7 +15860,6 @@ void intel_connector_unregister(struct drm_connector *connector) ...@@ -15860,7 +15860,6 @@ void intel_connector_unregister(struct drm_connector *connector)
struct intel_connector *intel_connector = to_intel_connector(connector); struct intel_connector *intel_connector = to_intel_connector(connector);
intel_backlight_device_unregister(intel_connector); intel_backlight_device_unregister(intel_connector);
intel_panel_destroy_backlight(connector);
} }
static void intel_hpd_poll_fini(struct drm_device *dev) static void intel_hpd_poll_fini(struct drm_device *dev)
......
...@@ -1904,7 +1904,6 @@ int intel_panel_setup_backlight(struct drm_connector *connector, ...@@ -1904,7 +1904,6 @@ int intel_panel_setup_backlight(struct drm_connector *connector,
void intel_panel_enable_backlight(const struct intel_crtc_state *crtc_state, void intel_panel_enable_backlight(const struct intel_crtc_state *crtc_state,
const struct drm_connector_state *conn_state); const struct drm_connector_state *conn_state);
void intel_panel_disable_backlight(const struct drm_connector_state *old_conn_state); void intel_panel_disable_backlight(const struct drm_connector_state *old_conn_state);
void intel_panel_destroy_backlight(struct drm_connector *connector);
extern struct drm_display_mode *intel_find_panel_downclock( extern struct drm_display_mode *intel_find_panel_downclock(
struct drm_i915_private *dev_priv, struct drm_i915_private *dev_priv,
struct drm_display_mode *fixed_mode, struct drm_display_mode *fixed_mode,
......
...@@ -1814,11 +1814,8 @@ int intel_panel_setup_backlight(struct drm_connector *connector, enum pipe pipe) ...@@ -1814,11 +1814,8 @@ int intel_panel_setup_backlight(struct drm_connector *connector, enum pipe pipe)
return 0; return 0;
} }
void intel_panel_destroy_backlight(struct drm_connector *connector) static void intel_panel_destroy_backlight(struct intel_panel *panel)
{ {
struct intel_connector *intel_connector = to_intel_connector(connector);
struct intel_panel *panel = &intel_connector->panel;
/* dispose of the pwm */ /* dispose of the pwm */
if (panel->backlight.pwm) if (panel->backlight.pwm)
pwm_put(panel->backlight.pwm); pwm_put(panel->backlight.pwm);
...@@ -1923,6 +1920,8 @@ void intel_panel_fini(struct intel_panel *panel) ...@@ -1923,6 +1920,8 @@ void intel_panel_fini(struct intel_panel *panel)
struct intel_connector *intel_connector = struct intel_connector *intel_connector =
container_of(panel, struct intel_connector, panel); container_of(panel, struct intel_connector, panel);
intel_panel_destroy_backlight(panel);
if (panel->fixed_mode) if (panel->fixed_mode)
drm_mode_destroy(intel_connector->base.dev, panel->fixed_mode); drm_mode_destroy(intel_connector->base.dev, panel->fixed_mode);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment