From: Austin Zheng Date: Wed, 10 Jul 2024 18:15:57 +0000 (-0400) Subject: drm/amd/display: Check if Mode is Supported Before Returning Result X-Git-Tag: v6.12-rc1~126^2~17^2~356 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=aaa21e6a33bae017fc190bd75f76baa29d259346;p=thirdparty%2Fkernel%2Flinux.git drm/amd/display: Check if Mode is Supported Before Returning Result [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 Signed-off-by: Austin Zheng Signed-off-by: Aurabindo Pillai Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_top/dml_top.c b/drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_top/dml_top.c index 30d07cd1065f9..e9b40a45ffddd 100644 --- a/drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_top/dml_top.c +++ b/drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_top/dml_top.c @@ -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)