]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
drm/amd/display: Check if Mode is Supported Before Returning Result
authorAustin Zheng <austin.zheng@amd.com>
Wed, 10 Jul 2024 18:15:57 +0000 (14:15 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 23 Jul 2024 21:36:15 +0000 (17:36 -0400)
[Why]
Even if the mode is not supported dml2_check_mode_supported() would still return true.
This causes an unsupported mode to be programmed.

[How]
Check if the mode is supported or not and return the proper result.

Reviewed-by: Chaitanya Dhere <chaitanya.dhere@amd.com>
Signed-off-by: Austin Zheng <austin.zheng@amd.com>
Signed-off-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_top/dml_top.c

index 30d07cd1065f91801046ebb14f53b6c88c9869c3..e9b40a45ffddd7cfa51b22436ce2564ef5772a4f 100644 (file)
@@ -138,8 +138,9 @@ bool dml2_check_mode_supported(struct dml2_check_mode_supported_in_out *in_out)
        }
 
        in_out->is_supported = mcache_success;
+       result = result && in_out->is_supported;
 
-       return true;
+       return result;
 }
 
 bool dml2_build_mode_programming(struct dml2_build_mode_programming_in_out *in_out)