drm/amdgpu: fix enum odm_combine_mode mismatch
authorArnd Bergmann <arnd@arndb.de>
Mon, 6 Feb 2023 19:36:02 +0000 (20:36 +0100)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 8 Feb 2023 22:35:55 +0000 (17:35 -0500)
A conversion from 'bool' to 'enum odm_combine_mode' was incomplete,
and gcc warns about this with many instances of

display/dc/dml/dcn20/display_mode_vba_20.c:3899:44: warning: implicit conversion from 'enum <anonymous>' to 'enum
odm_combine_mode' [-Wenum-conversion]
 3899 |     locals->ODMCombineEnablePerState[i][k] = false;

Change the ones that we get a warning for, using the same numerical
values to leave the behavior unchanged.

Fixes: 5fc11598166d ("drm/amd/display: expand dml structs")
Link: https://lore.kernel.org/all/20201026210039.3884312-3-arnd@kernel.org/
Link: https://lore.kernel.org/all/20210927100659.1431744-1-arnd@kernel.org/
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/dml/dcn20/display_mode_vba_20.c
drivers/gpu/drm/amd/display/dc/dml/dcn20/display_mode_vba_20v2.c
drivers/gpu/drm/amd/display/dc/dml/dcn21/display_mode_vba_21.c

index d3b5b6fedf042f21fa404396cf64a3a306e2a26f..6266b0788387ec981d04cbc6e461a2d40407a445 100644 (file)
@@ -3897,14 +3897,14 @@ void dml20_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l
                                        mode_lib->vba.PlaneRequiredDISPCLKWithODMCombine = mode_lib->vba.PixelClock[k] / 2
                                                        * (1 + mode_lib->vba.DISPCLKDPPCLKDSCCLKDownSpreading / 100.0);
 
-                               locals->ODMCombineEnablePerState[i][k] = false;
+                               locals->ODMCombineEnablePerState[i][k] = dm_odm_combine_mode_disabled;
                                mode_lib->vba.PlaneRequiredDISPCLK = mode_lib->vba.PlaneRequiredDISPCLKWithoutODMCombine;
                                if (mode_lib->vba.ODMCapability) {
                                        if (locals->PlaneRequiredDISPCLKWithoutODMCombine > mode_lib->vba.MaxDispclkRoundedDownToDFSGranularity) {
-                                               locals->ODMCombineEnablePerState[i][k] = true;
+                                               locals->ODMCombineEnablePerState[i][k] = dm_odm_combine_mode_2to1;
                                                mode_lib->vba.PlaneRequiredDISPCLK = mode_lib->vba.PlaneRequiredDISPCLKWithODMCombine;
                                        } else if (locals->HActive[k] > DCN20_MAX_420_IMAGE_WIDTH && locals->OutputFormat[k] == dm_420) {
-                                               locals->ODMCombineEnablePerState[i][k] = true;
+                                               locals->ODMCombineEnablePerState[i][k] = dm_odm_combine_mode_2to1;
                                                mode_lib->vba.PlaneRequiredDISPCLK = mode_lib->vba.PlaneRequiredDISPCLKWithODMCombine;
                                        }
                                }
@@ -3957,7 +3957,7 @@ void dml20_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l
                                locals->RequiredDISPCLK[i][j] = 0.0;
                                locals->DISPCLK_DPPCLK_Support[i][j] = true;
                                for (k = 0; k <= mode_lib->vba.NumberOfActivePlanes - 1; k++) {
-                                       locals->ODMCombineEnablePerState[i][k] = false;
+                                       locals->ODMCombineEnablePerState[i][k] = dm_odm_combine_mode_disabled;
                                        if (locals->SwathWidthYSingleDPP[k] <= locals->MaximumSwathWidth[k]) {
                                                locals->NoOfDPP[i][j][k] = 1;
                                                locals->RequiredDPPCLK[i][j][k] = locals->MinDPPCLKUsingSingleDPP[k]
index edd098c7eb927c953077232cbddffd844c89a094..989d83ee38421de7ecdda0b5757a5f5a8cae1b52 100644 (file)
@@ -4008,17 +4008,17 @@ void dml20v2_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode
                                        mode_lib->vba.PlaneRequiredDISPCLKWithODMCombine = mode_lib->vba.PixelClock[k] / 2
                                                        * (1 + mode_lib->vba.DISPCLKDPPCLKDSCCLKDownSpreading / 100.0);
 
-                               locals->ODMCombineEnablePerState[i][k] = false;
+                               locals->ODMCombineEnablePerState[i][k] = dm_odm_combine_mode_disabled;
                                mode_lib->vba.PlaneRequiredDISPCLK = mode_lib->vba.PlaneRequiredDISPCLKWithoutODMCombine;
                                if (mode_lib->vba.ODMCapability) {
                                        if (locals->PlaneRequiredDISPCLKWithoutODMCombine > MaxMaxDispclkRoundedDown) {
-                                               locals->ODMCombineEnablePerState[i][k] = true;
+                                               locals->ODMCombineEnablePerState[i][k] = dm_odm_combine_mode_2to1;
                                                mode_lib->vba.PlaneRequiredDISPCLK = mode_lib->vba.PlaneRequiredDISPCLKWithODMCombine;
                                        } else if (locals->DSCEnabled[k] && (locals->HActive[k] > DCN20_MAX_DSC_IMAGE_WIDTH)) {
-                                               locals->ODMCombineEnablePerState[i][k] = true;
+                                               locals->ODMCombineEnablePerState[i][k] = dm_odm_combine_mode_2to1;
                                                mode_lib->vba.PlaneRequiredDISPCLK = mode_lib->vba.PlaneRequiredDISPCLKWithODMCombine;
                                        } else if (locals->HActive[k] > DCN20_MAX_420_IMAGE_WIDTH && locals->OutputFormat[k] == dm_420) {
-                                               locals->ODMCombineEnablePerState[i][k] = true;
+                                               locals->ODMCombineEnablePerState[i][k] = dm_odm_combine_mode_2to1;
                                                mode_lib->vba.PlaneRequiredDISPCLK = mode_lib->vba.PlaneRequiredDISPCLKWithODMCombine;
                                        }
                                }
@@ -4071,7 +4071,7 @@ void dml20v2_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode
                                locals->RequiredDISPCLK[i][j] = 0.0;
                                locals->DISPCLK_DPPCLK_Support[i][j] = true;
                                for (k = 0; k <= mode_lib->vba.NumberOfActivePlanes - 1; k++) {
-                                       locals->ODMCombineEnablePerState[i][k] = false;
+                                       locals->ODMCombineEnablePerState[i][k] = dm_odm_combine_mode_disabled;
                                        if (locals->SwathWidthYSingleDPP[k] <= locals->MaximumSwathWidth[k]) {
                                                locals->NoOfDPP[i][j][k] = 1;
                                                locals->RequiredDPPCLK[i][j][k] = locals->MinDPPCLKUsingSingleDPP[k]
index 1d84ae50311d9b265da9d5460ee0b03ae8d56d37..b7c2844d0cbee29dfc4e7a4230008723fd48ba43 100644 (file)
@@ -4102,17 +4102,17 @@ void dml21_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l
                                        mode_lib->vba.PlaneRequiredDISPCLKWithODMCombine = mode_lib->vba.PixelClock[k] / 2
                                                        * (1 + mode_lib->vba.DISPCLKDPPCLKDSCCLKDownSpreading / 100.0);
 
-                               locals->ODMCombineEnablePerState[i][k] = false;
+                               locals->ODMCombineEnablePerState[i][k] = dm_odm_combine_mode_disabled;
                                mode_lib->vba.PlaneRequiredDISPCLK = mode_lib->vba.PlaneRequiredDISPCLKWithoutODMCombine;
                                if (mode_lib->vba.ODMCapability) {
                                        if (locals->PlaneRequiredDISPCLKWithoutODMCombine > MaxMaxDispclkRoundedDown) {
-                                               locals->ODMCombineEnablePerState[i][k] = true;
+                                               locals->ODMCombineEnablePerState[i][k] = dm_odm_combine_mode_2to1;
                                                mode_lib->vba.PlaneRequiredDISPCLK = mode_lib->vba.PlaneRequiredDISPCLKWithODMCombine;
                                        } else if (locals->DSCEnabled[k] && (locals->HActive[k] > DCN21_MAX_DSC_IMAGE_WIDTH)) {
-                                               locals->ODMCombineEnablePerState[i][k] = true;
+                                               locals->ODMCombineEnablePerState[i][k] = dm_odm_combine_mode_2to1;
                                                mode_lib->vba.PlaneRequiredDISPCLK = mode_lib->vba.PlaneRequiredDISPCLKWithODMCombine;
                                        } else if (locals->HActive[k] > DCN21_MAX_420_IMAGE_WIDTH && locals->OutputFormat[k] == dm_420) {
-                                               locals->ODMCombineEnablePerState[i][k] = true;
+                                               locals->ODMCombineEnablePerState[i][k] = dm_odm_combine_mode_2to1;
                                                mode_lib->vba.PlaneRequiredDISPCLK = mode_lib->vba.PlaneRequiredDISPCLKWithODMCombine;
                                        }
                                }
@@ -4165,7 +4165,7 @@ void dml21_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l
                                locals->RequiredDISPCLK[i][j] = 0.0;
                                locals->DISPCLK_DPPCLK_Support[i][j] = true;
                                for (k = 0; k <= mode_lib->vba.NumberOfActivePlanes - 1; k++) {
-                                       locals->ODMCombineEnablePerState[i][k] = false;
+                                       locals->ODMCombineEnablePerState[i][k] = dm_odm_combine_mode_disabled;
                                        if (locals->SwathWidthYSingleDPP[k] <= locals->MaximumSwathWidth[k]) {
                                                locals->NoOfDPP[i][j][k] = 1;
                                                locals->RequiredDPPCLK[i][j][k] = locals->MinDPPCLKUsingSingleDPP[k]
@@ -5230,7 +5230,7 @@ void dml21_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l
                        mode_lib->vba.ODMCombineEnabled[k] =
                                        locals->ODMCombineEnablePerState[mode_lib->vba.VoltageLevel][k];
                } else {
-                       mode_lib->vba.ODMCombineEnabled[k] = false;
+                       mode_lib->vba.ODMCombineEnabled[k] = dm_odm_combine_mode_disabled;
                }
                mode_lib->vba.DSCEnabled[k] =
                                locals->RequiresDSC[mode_lib->vba.VoltageLevel][k];