]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/amd/display: Set ODM Factor Based On DML Architecture
authorAustin Zheng <Austin.Zheng@amd.com>
Mon, 17 Mar 2025 17:29:47 +0000 (13:29 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 7 Apr 2025 19:18:36 +0000 (15:18 -0400)
[Why]
Mapping of ODM enum is different for DML2.0 vs DML2.1.
Configs using DML2.1 will incorrectly trigger an assert meant for DML2.0.

[How]
Use if/else to seperate logic between DML2.0 and DML2.1.

Reviewed-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: Austin Zheng <Austin.Zheng@amd.com>
Signed-off-by: Fangzhi Zuo <jerry.zuo@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/dml2/dml2_dc_resource_mgmt.c

index a966abd4078810a3d1f64d461dc6f5873907b703..5f1b49a500495b0e87212d0d02676b61de86b62d 100644 (file)
@@ -1082,22 +1082,22 @@ bool dml2_map_dc_pipes(struct dml2_context *ctx, struct dc_state *state, const s
                if (stream_disp_cfg_index >= disp_cfg_index_max)
                        continue;
 
-               if (ODMMode[stream_disp_cfg_index] == dml_odm_mode_bypass) {
-                       scratch.odm_info.odm_factor = 1;
-               } else if (ODMMode[stream_disp_cfg_index] == dml_odm_mode_combine_2to1) {
-                       scratch.odm_info.odm_factor = 2;
-               } else if (ODMMode[stream_disp_cfg_index] == dml_odm_mode_combine_4to1) {
-                       scratch.odm_info.odm_factor = 4;
-               } else {
-                       ASSERT(false);
-                       scratch.odm_info.odm_factor = 1;
-               }
-
+               if (ctx->architecture == dml2_architecture_20) {
+                       if (ODMMode[stream_disp_cfg_index] == dml_odm_mode_bypass) {
+                               scratch.odm_info.odm_factor = 1;
+                       } else if (ODMMode[stream_disp_cfg_index] == dml_odm_mode_combine_2to1) {
+                               scratch.odm_info.odm_factor = 2;
+                       } else if (ODMMode[stream_disp_cfg_index] == dml_odm_mode_combine_4to1) {
+                               scratch.odm_info.odm_factor = 4;
+                       } else {
+                               ASSERT(false);
+                               scratch.odm_info.odm_factor = 1;
+                       }
+               } else if (ctx->architecture == dml2_architecture_21) {
                /* After DML2.1 update, ODM interpretation needs to change and is no longer same as for DML2.0.
                 * This is not an issue with new resource management logic. This block ensure backcompat
                 * with legacy pipe management with updated DML.
                 * */
-               if (ctx->architecture == dml2_architecture_21) {
                        if (ODMMode[stream_disp_cfg_index] == 1) {
                                scratch.odm_info.odm_factor = 1;
                        } else if (ODMMode[stream_disp_cfg_index] == 2) {