diff mbox series

[v2,1/2] drm/amd/display: remove redundant is_dsc_possible check

Message ID 20241114151150.19576-2-bhavin.sharma@siliconsignals.io (mailing list archive)
State New
Headers show
Series Remove redundant check | expand

Commit Message

Bhavin Sharma Nov. 14, 2024, 3:11 p.m. UTC
Since is_dsc_possible is already checked just above, there's no need to
check it again before filling out the DSC settings.

Signed-off-by: Bhavin Sharma <bhavin.sharma@siliconsignals.io>
---
 drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

Comments

Christian König Nov. 14, 2024, 3:21 p.m. UTC | #1
Am 14.11.24 um 16:11 schrieb Bhavin Sharma:
> Since is_dsc_possible is already checked just above, there's no need to
> check it again before filling out the DSC settings.
>
> Signed-off-by: Bhavin Sharma <bhavin.sharma@siliconsignals.io>
> ---
>   drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c | 13 +++++--------
>   1 file changed, 5 insertions(+), 8 deletions(-)
>
> 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

While at it you should probably replace the // style comment with /* */.

Apart from that looks good to me.

Christian.

> +	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)
Alex Deucher Nov. 14, 2024, 9:20 p.m. UTC | #2
On Thu, Nov 14, 2024 at 10:21 AM Christian König
<christian.koenig@amd.com> wrote:
>
> Am 14.11.24 um 16:11 schrieb Bhavin Sharma:
> > Since is_dsc_possible is already checked just above, there's no need to
> > check it again before filling out the DSC settings.
> >
> > Signed-off-by: Bhavin Sharma <bhavin.sharma@siliconsignals.io>
> > ---
> >   drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c | 13 +++++--------
> >   1 file changed, 5 insertions(+), 8 deletions(-)
> >
> > 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
>
> While at it you should probably replace the // style comment with /* */.
>
> Apart from that looks good to me.

Fixed up locally and applied.

Thanks,

Alex

>
> Christian.
>
> > +     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)
>
diff mbox series

Patch

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)