]> git.baikalelectronics.ru Git - kernel.git/commit
drm/amd/display: Calculate bpc based on max_requested_bpc
authorNicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Wed, 21 Aug 2019 15:27:13 +0000 (11:27 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 22 Aug 2019 03:15:13 +0000 (22:15 -0500)
commitcf22ca9b6262a191dca296cfbb415e3a57fc4d64
treee5fdeaa9c020d3ba346c2638c95c856a8d9b72c3
parenta2219c2eb6dc18f5322dbd3716c062ecc22720c4
drm/amd/display: Calculate bpc based on max_requested_bpc

[Why]
The only place where state->max_bpc is updated on the connector is
at the start of atomic check during drm_atomic_connector_check. It
isn't updated when adding the connectors to the atomic state after
the fact. It also doesn't necessarily reflect the right value when
called in amdgpu during mode validation outside of atomic check.

This can cause the wrong bpc to be used even if the max_requested_bpc
is the correct value.

[How]
Don't rely on state->max_bpc reflecting the real bpc value and just
do the min(...) based on display info bpc and max_requested_bpc.

Fixes: 7f5513782bcb ("drm/amd/display: Use current connector state if NULL when checking bpc")
Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Reviewed-by: Leo Li <sunpeng.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c