Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Alex Hung and committed by
Alex Deucher
28d2a14a 70d98a20

+1 -11
-9
drivers/gpu/drm/amd/display/dc/dml/dcn30/display_mode_vba_30.c
··· 1775 1775 *PixelPTEReqWidth = 32768.0 / BytePerPixel; 1776 1776 *PTERequestSize = 64; 1777 1777 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; 1787 1778 } else if (GPUVMMinPageSize == 4 && MacroTileSizeBytes > 4096) { 1788 1779 PixelPTEReqHeightPTEs = 16; 1789 1780 *PixelPTEReqHeight = 16 * BlockHeight256Bytes;
+1 -2
drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.c
··· 559 559 const struct _vcs_dpi_display_pipe_source_params_st *pipe_src_param, 560 560 bool is_chroma) 561 561 { 562 - bool mode_422 = 0; 563 562 unsigned int vp_width = 0; 564 563 unsigned int vp_height = 0; 565 564 unsigned int data_pitch = 0; 566 565 unsigned int meta_pitch = 0; 567 - unsigned int ppe = mode_422 ? 2 : 1; 566 + unsigned int ppe = 1; 568 567 bool surf_linear; 569 568 bool surf_vert; 570 569 unsigned int bytes_per_element;