[PATCH] drm/amd/display: simplify FreeSync MCCS capability check

Avi Radinsky posted 1 patch 1 month, 2 weeks ago
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] drm/amd/display: simplify FreeSync MCCS capability check
Posted by Avi Radinsky 1 month, 2 weeks ago
Simplify the FreeSync MCCS capability check by removing a redundant
freesync_vcp_code test. The expression matches Coccinelle's
!A || (A && B) to !A || B simplification without changing behavior.

Fixes: 6f71d5dd3206 ("drm/amd/display: Read sink freesync support via mccs")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202604270741.pABgRDTb-lkp@intel.com/
Signed-off-by: Avi Radinsky <avi.radinsky@tennr.com>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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 e96a12ff2d31..b7fa74a87c1f 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -13436,7 +13436,7 @@ void amdgpu_dm_update_freesync_caps(struct drm_connector *connector,
 	if ((sink->sink_signal == SIGNAL_TYPE_HDMI_TYPE_A ||
 		as_type == FREESYNC_TYPE_PCON_IN_WHITELIST) &&
 		(!sink->edid_caps.freesync_vcp_code ||
-		(sink->edid_caps.freesync_vcp_code && !sink->mccs_caps.freesync_supported)))
+		!sink->mccs_caps.freesync_supported))
 		freesync_capable = false;
 
 	if (do_mccs && sink->mccs_caps.freesync_supported && freesync_capable)