[PATCH] drm/amd/display: Fix unintialized max_bpc state values

Deucher, Alexander Alexander.Deucher at amd.com
Thu Nov 29 15:50:03 UTC 2018


Reviewed-by: Alex Deucher <alexander.deucher at amd.com>

________________________________
From: amd-gfx <amd-gfx-bounces at lists.freedesktop.org> on behalf of Nicholas Kazlauskas <nicholas.kazlauskas at amd.com>
Sent: Thursday, November 29, 2018 10:44:46 AM
To: amd-gfx at lists.freedesktop.org
Cc: Kazlauskas, Nicholas
Subject: [PATCH] drm/amd/display: Fix unintialized max_bpc state values

[Why]
If the "max bpc" isn't explicitly set in the atomic state then it
have a value of 0. This has the correct behavior of limiting a panel
to 8bpc in the case where the panel supports 8bpc. In the case of eDP
panels this isn't a true assumption - there are panels that can only
do 6bpc.

Banding occurs for these displays.

[How]
Initialize the max_bpc when the connector resets to 8bpc. Also carry
over the value when the state is duplicated.

Bugzilla: https://bugs.freedesktop.org/108825
Fixes: 307638884f72 ("drm/amd/display: Support amdgpu "max bpc" connector property")

Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas at amd.com>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index ce00e56814ed..ede93d53e209 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -3215,6 +3215,7 @@ void amdgpu_dm_connector_funcs_reset(struct drm_connector *connector)
                 state->underscan_enable = false;
                 state->underscan_hborder = 0;
                 state->underscan_vborder = 0;
+               state->max_bpc = 8;

                 __drm_atomic_helper_connector_reset(connector, &state->base);
         }
@@ -3236,6 +3237,7 @@ amdgpu_dm_connector_atomic_duplicate_state(struct drm_connector *connector)

         new_state->freesync_capable = state->freesync_capable;
         new_state->abm_level = state->abm_level;
+       new_state->max_bpc = state->max_bpc;

         return &new_state->base;
 }
--
2.17.1

_______________________________________________
amd-gfx mailing list
amd-gfx at lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/amd-gfx/attachments/20181129/df4b5d8c/attachment.html>


More information about the amd-gfx mailing list