@@ -201,6 +201,7 @@ struct intel_panel {
struct drm_display_mode *fixed_mode;
struct drm_display_mode *downclock_mode;
int fitting_mode;
+ bool is_panel;
/* backlight */
struct {
@@ -1664,6 +1664,9 @@ int intel_panel_setup_backlight(struct drm_connector *connector, enum pipe pipe)
struct intel_panel *panel = &intel_connector->panel;
int ret;
+ if (!panel->is_panel)
+ return 0;
+
if (!dev_priv->vbt.backlight.present) {
if (dev_priv->quirks & QUIRK_BACKLIGHT_PRESENT) {
DRM_DEBUG_KMS("no backlight present per VBT, but present per quirk\n");
@@ -1703,6 +1706,9 @@ void intel_panel_destroy_backlight(struct drm_connector *connector)
struct intel_connector *intel_connector = to_intel_connector(connector);
struct intel_panel *panel = &intel_connector->panel;
+ if (!panel->backlight.present)
+ return;
+
/* dispose of the pwm */
if (panel->backlight.pwm)
pwm_put(panel->backlight.pwm);
@@ -1790,6 +1796,7 @@ int intel_panel_init(struct intel_panel *panel,
panel->fixed_mode = fixed_mode;
panel->downclock_mode = downclock_mode;
+ panel->is_panel = true;
return 0;
}
Allow everyone to call intel_panel_setup_backlight() (i.e. only take effect if we have previously been initialised for use as a panel) and, for paranoia, allow intel_panel_cleanup_backlight() to be called multiple times. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> --- drivers/gpu/drm/i915/intel_drv.h | 1 + drivers/gpu/drm/i915/intel_panel.c | 7 +++++++ 2 files changed, 8 insertions(+)