diff mbox

[v5,5/9] drm/i915: Set backlight mode before enable backlight

Message ID 20170504002836.120988-6-puthik@chromium.org (mailing list archive)
State New, archived
Headers show

Commit Message

Puthikorn Voravootivat May 4, 2017, 12:28 a.m. UTC
We should set backlight mode register before set register to
enable the backlight.

Signed-off-by: Puthikorn Voravootivat <puthik@chromium.org>
---
 drivers/gpu/drm/i915/intel_dp_aux_backlight.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Dhinakaran Pandiyan May 8, 2017, 6:21 p.m. UTC | #1
On Wed, 2017-05-03 at 17:28 -0700, Puthikorn Voravootivat wrote:
> We should set backlight mode register before set register to

> enable the backlight.

> 


Sounds reasonable, although I did not find anything in the spec. that
says we should do this. If you've tested and it works, 
Reviewed-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>





> Signed-off-by: Puthikorn Voravootivat <puthik@chromium.org>

> ---

>  drivers/gpu/drm/i915/intel_dp_aux_backlight.c | 4 ++--

>  1 file changed, 2 insertions(+), 2 deletions(-)

> 

> diff --git a/drivers/gpu/drm/i915/intel_dp_aux_backlight.c b/drivers/gpu/drm/i915/intel_dp_aux_backlight.c

> index e82f7cb9a7af..5ef3ade7c40e 100644

> --- a/drivers/gpu/drm/i915/intel_dp_aux_backlight.c

> +++ b/drivers/gpu/drm/i915/intel_dp_aux_backlight.c

> @@ -103,8 +103,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",

> @@ -131,6 +129,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)
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_dp_aux_backlight.c b/drivers/gpu/drm/i915/intel_dp_aux_backlight.c
index e82f7cb9a7af..5ef3ade7c40e 100644
--- a/drivers/gpu/drm/i915/intel_dp_aux_backlight.c
+++ b/drivers/gpu/drm/i915/intel_dp_aux_backlight.c
@@ -103,8 +103,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",
@@ -131,6 +129,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)