<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 style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Maybe add a reference to the bug report?</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Acked-by: Alex Deucher <alexander.deucher@amd.com><br>
</div>
<div id="appendonsend"></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> Wednesday, June 5, 2019 12:33 PM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org<br>
<b>Cc:</b> Li, Sun peng (Leo); Wentland, Harry; Kazlauskas, Nicholas<br>
<b>Subject:</b> [PATCH] drm/amd/display: Use current connector state if NULL when checking bpc</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">[Why]<br>
The old logic for checking which output depth to use relied on using<br>
the current connector state rather than the new proposed state. This<br>
was a problem when performing atomic commits since we weren't verifying<br>
it against the incoming max_requested_bpc.<br>
<br>
But switching this to only use the new state and not the current state<br>
breaks filtering modes - it'll always assume that the maximum bpc<br>
supported by the display is in use, which will cause certain modes<br>
like 1440p@144Hz to be filtered even when using 8bpc.<br>
<br>
[How]<br>
Still use the connector->state if we aren't passed an explicit state.<br>
This will respect the max_bpc the user currently has when filtering<br>
modes.<br>
<br>
Also remember to reset the default max_requested_bpc to 8 whenever<br>
connector reset is called to retain old behavior when using the new<br>
property.<br>
<br>
Cc: Harry Wentland <harry.wentland@amd.com><br>
Cc: Leo Li <sunpeng.li@amd.com><br>
Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com><br>
---<br>
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 4 ++++<br>
 1 file changed, 4 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 a698c8f272ed..f627c17a1039 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>
@@ -3046,6 +3046,9 @@ convert_color_depth_from_display_info(const struct drm_connector *connector,<br>
 {<br>
         uint32_t bpc = connector->display_info.bpc;<br>
 <br>
+       if (!state)<br>
+               state = connector->state;<br>
+<br>
         if (state) {<br>
                 bpc = state->max_bpc;<br>
                 /* Round down to the nearest even number. */<br>
@@ -3820,6 +3823,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->base.max_requested_bpc = 8;<br>
 <br>
                 __drm_atomic_helper_connector_reset(connector, &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></div>
</span></font></div>
</body>
</html>