<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p style="margin-top:0;margin-bottom:0">Reviewed-by: Alex Deucher <alexander.deucher@amd.com><br>
</p>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Nicholas Kazlauskas <nicholas.kazlauskas@amd.com><br>
<b>Sent:</b> Thursday, November 29, 2018 10:44:46 AM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org<br>
<b>Cc:</b> Kazlauskas, Nicholas<br>
<b>Subject:</b> [PATCH] drm/amd/display: Fix unintialized max_bpc state values</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">[Why]<br>
If the "max bpc" isn't explicitly set in the atomic state then it<br>
have a value of 0. This has the correct behavior of limiting a panel<br>
to 8bpc in the case where the panel supports 8bpc. In the case of eDP<br>
panels this isn't a true assumption - there are panels that can only<br>
do 6bpc.<br>
<br>
Banding occurs for these displays.<br>
<br>
[How]<br>
Initialize the max_bpc when the connector resets to 8bpc. Also carry<br>
over the value when the state is duplicated.<br>
<br>
Bugzilla: <a href="https://bugs.freedesktop.org/108825">https://bugs.freedesktop.org/108825</a><br>
Fixes: 307638884f72 ("drm/amd/display: Support amdgpu "max bpc" connector property")<br>
<br>
Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com><br>
---<br>
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 ++<br>
 1 file changed, 2 insertions(+)<br>
<br>
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c<br>
index ce00e56814ed..ede93d53e209 100644<br>
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c<br>
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c<br>
@@ -3215,6 +3215,7 @@ void amdgpu_dm_connector_funcs_reset(struct drm_connector *connector)<br>
                 state->underscan_enable = false;<br>
                 state->underscan_hborder = 0;<br>
                 state->underscan_vborder = 0;<br>
+               state->max_bpc = 8;<br>
 <br>
                 __drm_atomic_helper_connector_reset(connector, &state->base);<br>
         }<br>
@@ -3236,6 +3237,7 @@ amdgpu_dm_connector_atomic_duplicate_state(struct drm_connector *connector)<br>
 <br>
         new_state->freesync_capable = state->freesync_capable;<br>
         new_state->abm_level = state->abm_level;<br>
+       new_state->max_bpc = state->max_bpc;<br>
 <br>
         return &new_state->base;<br>
 }<br>
-- <br>
2.17.1<br>
<br>
_______________________________________________<br>
amd-gfx mailing list<br>
amd-gfx@lists.freedesktop.org<br>
<a href="https://lists.freedesktop.org/mailman/listinfo/amd-gfx">https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a><br>
</div>
</span></font></div>
</body>
</html>