Skip to contentSkip to conversation

drm/amd/display: Fix unintialized max_bpc state values

PATCH New Alex Deucher 1 participant 1 message Jan 3, 2019

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amd/display: Fix unintialized max_bpc state values

From: Nicholas Kazlauskas <[email protected]>

[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")

Backport of commit 49f1c44b581b08e3289127ffe58bd208c3166701 upstream.

Fixes regression caused by the automatic patch select of these two patches:
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/drivers/gpu/drm/amd?h=linux-4.19.y&id=a0c25b4098b8de23f34f81860ddc3cbaaa159189
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/drivers/gpu/drm/amd?h=linux-4.19.y&id=3374518d4d1ae021dc60885f4ea8dca0a3ca290f

Cc Sasha Levin <[email protected]>
(cherry picked from commit 49f1c44b581b08e3289127ffe58bd208c3166701)
Cc <[email protected]> # 4.19.x
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2 -0
index 299def84e69c..d792735f1365 100644
@@ -2894,6 +2894,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);
 	}
@@ -2911,6 +2912,7 @@ amdgpu_dm_connector_atomic_duplicate_state(struct drm_connector *connector)
 	if (new_state) {
 		__drm_atomic_helper_connector_duplicate_state(connector,
 							      &new_state->base);
+		new_state->max_bpc = state->max_bpc;
 		return &new_state->base;
 	}
 
Signature · 1 line
2.20.1