Skip to content

Commit f9c1820

Browse files
AMD-aricalexdeucher
authored andcommitted
drm/amd/display: Fix divide by zero in DML
[why] Incorrectly using MicroTileWidth instead of MacroTileWidth for calculations. [how] Remove all unused references to MicroTile and change them to MacroTile. Tested-by: Daniel Wheeler <[email protected]> Reviewed-by: Alvin Lee <[email protected]> Reviewed-by: Jun Lei <[email protected]> Acked-by: Pavle Kotarac <[email protected]> Signed-off-by: Aric Cyr <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 269aad0 commit f9c1820

File tree

2 files changed

+16
-18
lines changed

2 files changed

+16
-18
lines changed

drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_32.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1806,10 +1806,10 @@ void dml32_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l
18061806
&mode_lib->vba.Read256BlockHeightC[k],
18071807
&mode_lib->vba.Read256BlockWidthY[k],
18081808
&mode_lib->vba.Read256BlockWidthC[k],
1809-
&mode_lib->vba.MicroTileHeightY[k],
1810-
&mode_lib->vba.MicroTileHeightC[k],
1811-
&mode_lib->vba.MicroTileWidthY[k],
1812-
&mode_lib->vba.MicroTileWidthC[k]);
1809+
&mode_lib->vba.MacroTileHeightY[k],
1810+
&mode_lib->vba.MacroTileHeightC[k],
1811+
&mode_lib->vba.MacroTileWidthY[k],
1812+
&mode_lib->vba.MacroTileWidthC[k]);
18131813
}
18141814

18151815
/*Bandwidth Support Check*/
@@ -2659,10 +2659,10 @@ void dml32_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l
26592659
mode_lib->vba.Read256BlockWidthC,
26602660
mode_lib->vba.Read256BlockHeightY,
26612661
mode_lib->vba.Read256BlockHeightC,
2662-
mode_lib->vba.MicroTileWidthY,
2663-
mode_lib->vba.MicroTileWidthC,
2664-
mode_lib->vba.MicroTileHeightY,
2665-
mode_lib->vba.MicroTileHeightC,
2662+
mode_lib->vba.MacroTileWidthY,
2663+
mode_lib->vba.MacroTileWidthC,
2664+
mode_lib->vba.MacroTileHeightY,
2665+
mode_lib->vba.MacroTileHeightC,
26662666

26672667
/* Output */
26682668
mode_lib->vba.SurfaceSizeInMALL,
@@ -2709,10 +2709,10 @@ void dml32_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l
27092709
v->dummy_vars.dml32_ModeSupportAndSystemConfigurationFull.SurfParameters[k].BlockHeight256BytesY = mode_lib->vba.Read256BlockHeightY[k];
27102710
v->dummy_vars.dml32_ModeSupportAndSystemConfigurationFull.SurfParameters[k].BlockWidth256BytesC = mode_lib->vba.Read256BlockWidthC[k];
27112711
v->dummy_vars.dml32_ModeSupportAndSystemConfigurationFull.SurfParameters[k].BlockHeight256BytesC = mode_lib->vba.Read256BlockHeightC[k];
2712-
v->dummy_vars.dml32_ModeSupportAndSystemConfigurationFull.SurfParameters[k].BlockWidthY = mode_lib->vba.MicroTileWidthY[k];
2713-
v->dummy_vars.dml32_ModeSupportAndSystemConfigurationFull.SurfParameters[k].BlockHeightY = mode_lib->vba.MicroTileHeightY[k];
2714-
v->dummy_vars.dml32_ModeSupportAndSystemConfigurationFull.SurfParameters[k].BlockWidthC = mode_lib->vba.MicroTileWidthC[k];
2715-
v->dummy_vars.dml32_ModeSupportAndSystemConfigurationFull.SurfParameters[k].BlockHeightC = mode_lib->vba.MicroTileHeightC[k];
2712+
v->dummy_vars.dml32_ModeSupportAndSystemConfigurationFull.SurfParameters[k].BlockWidthY = mode_lib->vba.MacroTileWidthY[k];
2713+
v->dummy_vars.dml32_ModeSupportAndSystemConfigurationFull.SurfParameters[k].BlockHeightY = mode_lib->vba.MacroTileHeightY[k];
2714+
v->dummy_vars.dml32_ModeSupportAndSystemConfigurationFull.SurfParameters[k].BlockWidthC = mode_lib->vba.MacroTileWidthC[k];
2715+
v->dummy_vars.dml32_ModeSupportAndSystemConfigurationFull.SurfParameters[k].BlockHeightC = mode_lib->vba.MacroTileHeightC[k];
27162716
v->dummy_vars.dml32_ModeSupportAndSystemConfigurationFull.SurfParameters[k].InterlaceEnable = mode_lib->vba.Interlace[k];
27172717
v->dummy_vars.dml32_ModeSupportAndSystemConfigurationFull.SurfParameters[k].HTotal = mode_lib->vba.HTotal[k];
27182718
v->dummy_vars.dml32_ModeSupportAndSystemConfigurationFull.SurfParameters[k].DCCEnable = mode_lib->vba.DCCEnable[k];

drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.h

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -651,10 +651,10 @@ struct vba_vars_st {
651651

652652
unsigned int OutputTypeAndRatePerState[DC__VOLTAGE_STATES][DC__NUM_DPP__MAX];
653653
double RequiredDISPCLKPerSurface[DC__VOLTAGE_STATES][2][DC__NUM_DPP__MAX];
654-
unsigned int MicroTileHeightY[DC__NUM_DPP__MAX];
655-
unsigned int MicroTileHeightC[DC__NUM_DPP__MAX];
656-
unsigned int MicroTileWidthY[DC__NUM_DPP__MAX];
657-
unsigned int MicroTileWidthC[DC__NUM_DPP__MAX];
654+
unsigned int MacroTileHeightY[DC__NUM_DPP__MAX];
655+
unsigned int MacroTileHeightC[DC__NUM_DPP__MAX];
656+
unsigned int MacroTileWidthY[DC__NUM_DPP__MAX];
657+
unsigned int MacroTileWidthC[DC__NUM_DPP__MAX];
658658
bool ImmediateFlipRequiredFinal;
659659
bool DCCProgrammingAssumesScanDirectionUnknownFinal;
660660
bool EnoughWritebackUnits;
@@ -800,8 +800,6 @@ struct vba_vars_st {
800800
double PSCL_FACTOR[DC__NUM_DPP__MAX];
801801
double PSCL_FACTOR_CHROMA[DC__NUM_DPP__MAX];
802802
double MaximumVStartup[DC__VOLTAGE_STATES][2][DC__NUM_DPP__MAX];
803-
unsigned int MacroTileWidthY[DC__NUM_DPP__MAX];
804-
unsigned int MacroTileWidthC[DC__NUM_DPP__MAX];
805803
double AlignedDCCMetaPitch[DC__NUM_DPP__MAX];
806804
double AlignedYPitch[DC__NUM_DPP__MAX];
807805
double AlignedCPitch[DC__NUM_DPP__MAX];

0 commit comments

Comments
 (0)