<div dir="ltr">I tested this on actual system and it is working fine.</div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jun 13, 2017 at 1:03 PM, Dhinakaran Pandiyan <span dir="ltr"><<a href="mailto:dhinakaran.pandiyan@intel.com" target="_blank">dhinakaran.pandiyan@intel.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">Maarten and Ville noticed that we are enabling backlight via DP aux very<br>
early in the modeset_init path via the intel_dp_aux_setup_backlight()<br>
</span>function, since commit e7156c833903 ("drm/i915: Add Backlight Control using<br>
DPCD for eDP connectors (v9)"). Looks like all we need to do during<br>
<span class="">_setup_backlight() is read the current brightness state instead of<br>
</span>modifying it.<br>
<br>
v2: Rewrote commit message.<br>
<span class=""><br>
Cc: Ville Syrjala <<a href="mailto:ville.syrjala@linux.intel.com">ville.syrjala@linux.intel.com</a><wbr>><br>
Cc: Maarten Lankhorst <<a href="mailto:maarten.lankhorst@linux.intel.com">maarten.lankhorst@linux.<wbr>intel.com</a>><br>
Cc: Jani Nikula <<a href="mailto:jani.nikula@intel.com">jani.nikula@intel.com</a>><br>
</span>Cc: Yetunde Adebisi <<a href="mailto:yetundex.adebisi@intel.com">yetundex.adebisi@intel.com</a>><br>
Signed-off-by: Dhinakaran Pandiyan <<a href="mailto:dhinakaran.pandiyan@intel.com">dhinakaran.pandiyan@intel.com</a><wbr>><br>
Reviewed-by: Maarten Lankhorst <<a href="mailto:maarten.lankhorst@linux.intel.com">maarten.lankhorst@linux.<wbr>intel.com</a>><br>
Acked-by: Jani Nikula <<a href="mailto:jani.nikula@intel.com">jani.nikula@intel.com</a>><br>
<div class="HOEnZb"><div class="h5">---<br>
drivers/gpu/drm/i915/intel_dp_<wbr>aux_backlight.c | 10 ----------<br>
1 file changed, 10 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/i915/intel_<wbr>dp_aux_backlight.c b/drivers/gpu/drm/i915/intel_<wbr>dp_aux_backlight.c<br>
index 6cc6298..228ca06 100644<br>
--- a/drivers/gpu/drm/i915/intel_<wbr>dp_aux_backlight.c<br>
+++ b/drivers/gpu/drm/i915/intel_<wbr>dp_aux_backlight.c<br>
@@ -80,10 +80,6 @@ static uint32_t intel_dp_aux_get_backlight(<wbr>struct intel_connector *connector)<br>
static void<br>
intel_dp_aux_set_backlight(<wbr>const struct drm_connector_state *conn_state, u32 level)<br>
{<br>
- /*<br>
- * conn_state->best_encoder is likely NULL when called from<br>
- * intel_dp_aux_setup_backlight()<br>
- */<br>
struct intel_connector *connector = to_intel_connector(conn_state-<wbr>>connector);<br>
struct intel_dp *intel_dp = enc_to_intel_dp(&connector-><wbr>encoder->base);<br>
uint8_t vals[2] = { 0x0 };<br>
@@ -106,10 +102,6 @@ static void intel_dp_aux_enable_backlight(<wbr>const struct intel_crtc_state *crtc_st<br>
const struct drm_connector_state *conn_state)<br>
{<br>
struct intel_connector *connector = to_intel_connector(conn_state-<wbr>>connector);<br>
- /*<br>
- * conn_state->best_encoder (and crtc_state) are NULL when called from<br>
- * intel_dp_aux_setup_backlight()<br>
- */<br>
struct intel_dp *intel_dp = enc_to_intel_dp(&connector-><wbr>encoder->base);<br>
uint8_t dpcd_buf = 0;<br>
uint8_t edp_backlight_mode = 0;<br>
@@ -156,8 +148,6 @@ static int intel_dp_aux_setup_backlight(<wbr>struct intel_connector *connector,<br>
struct intel_dp *intel_dp = enc_to_intel_dp(&connector-><wbr>encoder->base);<br>
struct intel_panel *panel = &connector->panel;<br>
<br>
- intel_dp_aux_enable_backlight(<wbr>NULL, connector->base.state);<br>
-<br>
if (intel_dp->edp_dpcd[2] & DP_EDP_BACKLIGHT_BRIGHTNESS_<wbr>BYTE_COUNT)<br>
panel->backlight.max = 0xFFFF;<br>
else<br>
</div></div><span class="HOEnZb"><font color="#888888">--<br>
2.7.4<br>
<br>
</font></span></blockquote></div><br></div>