[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <578485e4-8983-412a-a214-921c450a225a@amd.com>
Date: Wed, 13 Nov 2024 09:58:46 -0700
From: Alex Hung <alex.hung@....com>
To: Bhavin Sharma <bhavin.sharma@...iconsignals.io>, alexander.deucher@....com
Cc: tarang.raval@...iconsignals.io, Chaitanya Dhere
<chaitanya.dhere@....com>, Jun Lei <jun.lei@....com>,
Harry Wentland <harry.wentland@....com>, Leo Li <sunpeng.li@....com>,
Rodrigo Siqueira <Rodrigo.Siqueira@....com>,
Christian König <christian.koenig@....com>,
Xinhui Pan <Xinhui.Pan@....com>, David Airlie <airlied@...il.com>,
Simona Vetter <simona@...ll.ch>, Kenneth Feng <kenneth.feng@....com>,
Wenjing Liu <wenjing.liu@....com>, Roman Li <roman.li@....com>,
Leo Ma <hanghong.ma@....com>, Jose Fernandez <josef@...flix.com>,
Aurabindo Pillai <aurabindo.pillai@....com>,
Ilya Bakoulin <ilya.bakoulin@....com>, amd-gfx@...ts.freedesktop.org,
dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] drm/amd/display: Remove redundant check
On 11/11/24 05:08, Bhavin Sharma wrote:
> The mode_422 variable is initialized to zero, making mode_422 ? 2 : 1
> always false.
>
> Since is_dsc_possible is already checked just above, there's no need to
> check it again before filling out the DSC settings.
>
> Removing this redundant check simplifies the code without affecting
> functionality.
>
> Signed-off-by: Bhavin Sharma <bhavin.sharma@...iconsignals.io>
> ---
> .../amd/display/dc/dml/dml1_display_rq_dlg_calc.c | 2 +-
> drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c | 13 +++++--------
> 2 files changed, 6 insertions(+), 9 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 d8bfc85e5dcd..705ddabb5024 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
> @@ -564,7 +564,7 @@ static void get_surf_rq_param(
> unsigned int vp_height = 0;
> unsigned int data_pitch = 0;
> unsigned int meta_pitch = 0;
> - unsigned int ppe = mode_422 ? 2 : 1;
> + unsigned int ppe = 1;
> bool surf_linear;
> bool surf_vert;
> unsigned int bytes_per_element;
This is fixed in amd-staging-drm-next by the following commit and it's
no longer needed.
ec680fdbb29a drm/amd/display: Remove always-false branches
> diff --git a/drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c b/drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c
> index ebd5df1a36e8..85f6f8e43947 100644
> --- a/drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c
> +++ b/drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c
> @@ -1093,14 +1093,11 @@ static bool setup_dsc_config(
> if (!is_dsc_possible)
> goto done;
>
> - // Final decission: can we do DSC or not?
> - if (is_dsc_possible) {
> - // Fill out the rest of DSC settings
> - dsc_cfg->block_pred_enable = dsc_common_caps.is_block_pred_supported;
> - dsc_cfg->linebuf_depth = dsc_common_caps.lb_bit_depth;
> - dsc_cfg->version_minor = (dsc_common_caps.dsc_version & 0xf0) >> 4;
> - dsc_cfg->is_dp = dsc_sink_caps->is_dp;
> - }
> + // Fill out the rest of DSC settings
> + dsc_cfg->block_pred_enable = dsc_common_caps.is_block_pred_supported;
> + dsc_cfg->linebuf_depth = dsc_common_caps.lb_bit_depth;
> + dsc_cfg->version_minor = (dsc_common_caps.dsc_version & 0xf0) >> 4;
> + dsc_cfg->is_dp = dsc_sink_caps->is_dp;
>
> done:
> if (!is_dsc_possible)
This looks to me. Please revise and include this part in V2. Thanks.
Powered by blists - more mailing lists