mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alex Hung <alex.hung@amd.com>
To: Bhavin Sharma <bhavin.sharma@siliconsignals.io>,
	alexander.deucher@amd.com
Cc: tarang.raval@siliconsignals.io,
	"Chaitanya Dhere" <chaitanya.dhere@amd.com>,
	"Jun Lei" <jun.lei@amd.com>,
	"Harry Wentland" <harry.wentland@amd.com>,
	"Leo Li" <sunpeng.li@amd.com>,
	"Rodrigo Siqueira" <Rodrigo.Siqueira@amd.com>,
	"Christian König" <christian.koenig@amd.com>,
	"Xinhui Pan" <Xinhui.Pan@amd.com>,
	"David Airlie" <airlied@gmail.com>,
	"Simona Vetter" <simona@ffwll.ch>,
	"Kenneth Feng" <kenneth.feng@amd.com>,
	"Wenjing Liu" <wenjing.liu@amd.com>,
	"Roman Li" <roman.li@amd.com>, "Leo Ma" <hanghong.ma@amd.com>,
	"Jose Fernandez" <josef@netflix.com>,
	"Aurabindo Pillai" <aurabindo.pillai@amd.com>,
	"Ilya Bakoulin" <ilya.bakoulin@amd.com>,
	amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] drm/amd/display: Remove redundant check
Date: Wed, 13 Nov 2024 09:58:46 -0700	[thread overview]
Message-ID: <578485e4-8983-412a-a214-921c450a225a@amd.com> (raw)
In-Reply-To: <20241111120900.63869-2-bhavin.sharma@siliconsignals.io>



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@siliconsignals.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.

  reply	other threads:[~2024-11-13 16:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-11 12:08 [PATCH 0/2] Remove redundant condition check Bhavin Sharma
2024-11-11 12:08 ` [PATCH 1/2] drm/amd/display: Remove redundant check Bhavin Sharma
2024-11-13 16:58   ` Alex Hung [this message]
2024-11-11 12:08 ` [PATCH 2/2] drm/amd/pm: " Bhavin Sharma

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=578485e4-8983-412a-a214-921c450a225a@amd.com \
    --to=alex.hung@amd.com \
    --cc=Rodrigo.Siqueira@amd.com \
    --cc=Xinhui.Pan@amd.com \
    --cc=airlied@gmail.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=aurabindo.pillai@amd.com \
    --cc=bhavin.sharma@siliconsignals.io \
    --cc=chaitanya.dhere@amd.com \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hanghong.ma@amd.com \
    --cc=harry.wentland@amd.com \
    --cc=ilya.bakoulin@amd.com \
    --cc=josef@netflix.com \
    --cc=jun.lei@amd.com \
    --cc=kenneth.feng@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=roman.li@amd.com \
    --cc=simona@ffwll.ch \
    --cc=sunpeng.li@amd.com \
    --cc=tarang.raval@siliconsignals.io \
    --cc=wenjing.liu@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®