lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20250410025615.466691-1-ssp.nesin@crpt.ru>
Date: Thu, 10 Apr 2025 09:56:15 +0700
From: Rostislav Nesin <ssp.nesin@...t.ru>
To: Austin Zheng <austin.zheng@....com>
Cc: Rostislav Nesin <ssp.nesin@...t.ru>,
	Jun Lei <jun.lei@....com>,
	Harry Wentland <harry.wentland@....com>,
	Leo Li <sunpeng.li@....com>,
	Rodrigo Siqueira <siqueira@...lia.com>,
	Alex Deucher <alexander.deucher@....com>,
	Christian König <christian.koenig@....com>,
	David Airlie <airlied@...il.com>,
	Simona Vetter <simona@...ll.ch>,
	amd-gfx@...ts.freedesktop.org,
	dri-devel@...ts.freedesktop.org,
	linux-kernel@...r.kernel.org,
	lvc-project@...uxtesting.org
Subject: [PATCH] drm/amd/display: drop unimplemented mode_422 code

The variable mode_422 is initialized to zero, making if (mode_422)
always false.

Removing this unimplemented code and the redundant check simplifies
the code without affecting functionality.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Signed-off-by: Rostislav Nesin <ssp.nesin@...t.ru>
---
 .../amd/display/dc/dml/dml1_display_rq_dlg_calc.c  | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.c b/drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.c
index 88dc2b97e7bf..0cfd931a3e6f 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.c
+++ b/drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.c
@@ -1027,7 +1027,6 @@ void dml1_rq_dlg_get_dlg_params(
 	unsigned int dlg_vblank_start;
 	bool dcc_en;
 	bool dual_plane;
-	bool mode_422;
 	unsigned int access_dir;
 	unsigned int bytes_per_element_l;
 	unsigned int bytes_per_element_c;
@@ -1199,7 +1198,6 @@ void dml1_rq_dlg_get_dlg_params(
 	dcc_en = e2e_pipe_param->pipe.src.dcc;
 	dual_plane = is_dual_plane(
 			(enum source_format_class) e2e_pipe_param->pipe.src.source_format);
-	mode_422 = 0; /* TODO */
 	access_dir = (e2e_pipe_param->pipe.src.source_scan == dm_vert); /* vp access direction: horizontal or vertical accessed */
 	bytes_per_element_l = get_bytes_per_element(
 			(enum source_format_class) e2e_pipe_param->pipe.src.source_format,
@@ -1548,8 +1546,8 @@ void dml1_rq_dlg_get_dlg_params(
 	req_per_swath_ub_l = rq_dlg_param->rq_l.req_per_swath_ub;
 	req_per_swath_ub_c = rq_dlg_param->rq_c.req_per_swath_ub;
 	meta_row_height_l = rq_dlg_param->rq_l.meta_row_height;
-	swath_width_pixels_ub_l = 0;
-	swath_width_pixels_ub_c = 0;
+	swath_width_pixels_ub_l = swath_width_ub_l;
+	swath_width_pixels_ub_c = swath_width_ub_c;
 	scaler_rec_in_width_l = 0;
 	scaler_rec_in_width_c = 0;
 	dpte_row_height_l = rq_dlg_param->rq_l.dpte_row_height;
@@ -1587,14 +1585,6 @@ void dml1_rq_dlg_get_dlg_params(
 	if (disp_dlg_regs->refcyc_per_meta_chunk_nom_l >= (unsigned int) dml_pow(2, 23))
 		disp_dlg_regs->refcyc_per_meta_chunk_nom_l = dml_pow(2, 23) - 1;
 
-	if (mode_422) {
-		swath_width_pixels_ub_l = swath_width_ub_l * 2; /* *2 for 2 pixel per element */
-		swath_width_pixels_ub_c = swath_width_ub_c * 2;
-	} else {
-		swath_width_pixels_ub_l = swath_width_ub_l * 1;
-		swath_width_pixels_ub_c = swath_width_ub_c * 1;
-	}
-
 	if (htaps_l <= 1)
 		min_hratio_fact_l = 2.0;
 	else if (htaps_l <= 6) {
-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ