Skip to content

Commit 28d2a14

Browse files
Alex Hungalexdeucher
authored andcommitted
drm/amd/display: Remove always-false branches
[WHAT & HOW] MacroTileSizeBytes is set to either 256 or 65535 and it is never 4096. Its branch is not taken, and should be removed. Similarly, mode_422 is always 0 and thus ppe will always be 1. The ternary operator should be removed. This fixes 2 DEADCODE issues reported by Coverity. Reviewed-by: Rodrigo Siqueira <rodrigo.siqueira@amd.com> Signed-off-by: Alex Hung <alex.hung@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>
1 parent 70d98a2 commit 28d2a14

File tree

2 files changed

+1
-11
lines changed

2 files changed

+1
-11
lines changed

drivers/gpu/drm/amd/display/dc/dml/dcn30/display_mode_vba_30.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1775,15 +1775,6 @@ static unsigned int CalculateVMAndRowBytes(
17751775
*PixelPTEReqWidth = 32768.0 / BytePerPixel;
17761776
*PTERequestSize = 64;
17771777
FractionOfPTEReturnDrop = 0;
1778-
} else if (MacroTileSizeBytes == 4096) {
1779-
PixelPTEReqHeightPTEs = 1;
1780-
*PixelPTEReqHeight = MacroTileHeight;
1781-
*PixelPTEReqWidth = 8 * *MacroTileWidth;
1782-
*PTERequestSize = 64;
1783-
if (ScanDirection != dm_vert)
1784-
FractionOfPTEReturnDrop = 0;
1785-
else
1786-
FractionOfPTEReturnDrop = 7.0 / 8;
17871778
} else if (GPUVMMinPageSize == 4 && MacroTileSizeBytes > 4096) {
17881779
PixelPTEReqHeightPTEs = 16;
17891780
*PixelPTEReqHeight = 16 * BlockHeight256Bytes;

drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -559,12 +559,11 @@ static void get_surf_rq_param(
559559
const struct _vcs_dpi_display_pipe_source_params_st *pipe_src_param,
560560
bool is_chroma)
561561
{
562-
bool mode_422 = 0;
563562
unsigned int vp_width = 0;
564563
unsigned int vp_height = 0;
565564
unsigned int data_pitch = 0;
566565
unsigned int meta_pitch = 0;
567-
unsigned int ppe = mode_422 ? 2 : 1;
566+
unsigned int ppe = 1;
568567
bool surf_linear;
569568
bool surf_vert;
570569
unsigned int bytes_per_element;

0 commit comments

Comments
 (0)