drm/i915: Set backlight mode before enable backlight
authorPuthikorn Voravootivat <puthik@chromium.org>
Thu, 11 May 2017 23:02:21 +0000 (16:02 -0700)
committerJani Nikula <jani.nikula@intel.com>
Fri, 12 May 2017 12:50:35 +0000 (15:50 +0300)
We should set backlight mode register before set register to
enable the backlight.

Signed-off-by: Puthikorn Voravootivat <puthik@chromium.org>
Reviewed-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170511230225.142870-6-puthik@chromium.org
drivers/gpu/drm/i915/intel_dp_aux_backlight.c

index 870c03fc0f3aa23f0165955060d4d309f9d64e1c..5f945e05efe265739327331af8daf9087f200479 100644 (file)
@@ -99,8 +99,6 @@ static void intel_dp_aux_enable_backlight(struct intel_connector *connector)
        uint8_t dpcd_buf = 0;
        uint8_t edp_backlight_mode = 0;
 
-       set_aux_backlight_enable(intel_dp, true);
-
        if (drm_dp_dpcd_readb(&intel_dp->aux,
                        DP_EDP_BACKLIGHT_MODE_SET_REGISTER, &dpcd_buf) != 1) {
                DRM_DEBUG_KMS("Failed to read DPCD register 0x%x\n",
@@ -127,6 +125,8 @@ static void intel_dp_aux_enable_backlight(struct intel_connector *connector)
        default:
                break;
        }
+
+       set_aux_backlight_enable(intel_dp, true);
 }
 
 static void intel_dp_aux_disable_backlight(struct intel_connector *connector)