linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] gpu: drm: amd: display: dc: dcn20: Remove redudant condition
@ 2019-08-05 17:32 Hariprasad Kelam
  2019-08-06 14:04 ` Alex Deucher
  0 siblings, 1 reply; 4+ messages in thread
From: Hariprasad Kelam @ 2019-08-05 17:32 UTC (permalink / raw)
  To: Harry Wentland, Leo Li, Alex Deucher, Christian König,
	David (ChunMing) Zhou, David Airlie, Daniel Vetter,
	Nikola Cornij, Dmytro Laktyushkin, Colin Ian King,
	Hariprasad Kelam, amd-gfx, dri-devel, linux-kernel

Remove redudant codition "dsc_cfg->dc_dsc_cfg.num_slices_v".

fixes coverity defect 1451853

Signed-off-by: Hariprasad Kelam <hariprasad.kelam@gmail.com>
---
 drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dsc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dsc.c b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dsc.c
index e870caa..42133bd 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dsc.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dsc.c
@@ -302,7 +302,7 @@ static bool dsc_prepare_config(struct display_stream_compressor *dsc, const stru
 		    dsc_cfg->dc_dsc_cfg.linebuf_depth == 0)));
 	ASSERT(96 <= dsc_cfg->dc_dsc_cfg.bits_per_pixel && dsc_cfg->dc_dsc_cfg.bits_per_pixel <= 0x3ff); // 6.0 <= bits_per_pixel <= 63.9375
 
-	if (!dsc_cfg->dc_dsc_cfg.num_slices_v || !dsc_cfg->dc_dsc_cfg.num_slices_v ||
+	if (!dsc_cfg->dc_dsc_cfg.num_slices_v ||
 		!(dsc_cfg->dc_dsc_cfg.version_minor == 1 || dsc_cfg->dc_dsc_cfg.version_minor == 2) ||
 		!dsc_cfg->pic_width || !dsc_cfg->pic_height ||
 		!((dsc_cfg->dc_dsc_cfg.version_minor == 1 && // v1.1 line buffer depth range:
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] gpu: drm: amd: display: dc: dcn20: Remove redudant condition
  2019-08-05 17:32 [PATCH] gpu: drm: amd: display: dc: dcn20: Remove redudant condition Hariprasad Kelam
@ 2019-08-06 14:04 ` Alex Deucher
  2019-08-06 17:45   ` [PATCH] drm/amd/display: Add number of slices per line to DSC parameter validation Harry Wentland
  0 siblings, 1 reply; 4+ messages in thread
From: Alex Deucher @ 2019-08-06 14:04 UTC (permalink / raw)
  To: Hariprasad Kelam
  Cc: Harry Wentland, Leo Li, Alex Deucher, Christian König,
	David (ChunMing) Zhou, David Airlie, Daniel Vetter,
	Nikola Cornij, Dmytro Laktyushkin, Colin Ian King, amd-gfx list,
	Maling list - DRI developers, LKML

On Mon, Aug 5, 2019 at 3:01 PM Hariprasad Kelam
<hariprasad.kelam@gmail.com> wrote:
>
> Remove redudant codition "dsc_cfg->dc_dsc_cfg.num_slices_v".
>
> fixes coverity defect 1451853
>
> Signed-off-by: Hariprasad Kelam <hariprasad.kelam@gmail.com>
> ---
>  drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dsc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dsc.c b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dsc.c
> index e870caa..42133bd 100644
> --- a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dsc.c
> +++ b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dsc.c
> @@ -302,7 +302,7 @@ static bool dsc_prepare_config(struct display_stream_compressor *dsc, const stru
>                     dsc_cfg->dc_dsc_cfg.linebuf_depth == 0)));
>         ASSERT(96 <= dsc_cfg->dc_dsc_cfg.bits_per_pixel && dsc_cfg->dc_dsc_cfg.bits_per_pixel <= 0x3ff); // 6.0 <= bits_per_pixel <= 63.9375
>
> -       if (!dsc_cfg->dc_dsc_cfg.num_slices_v || !dsc_cfg->dc_dsc_cfg.num_slices_v ||
> +       if (!dsc_cfg->dc_dsc_cfg.num_slices_v ||

Harry, can you or Nick check if this should be something else?  maybe
a copy paste typo.

Alex

>                 !(dsc_cfg->dc_dsc_cfg.version_minor == 1 || dsc_cfg->dc_dsc_cfg.version_minor == 2) ||
>                 !dsc_cfg->pic_width || !dsc_cfg->pic_height ||
>                 !((dsc_cfg->dc_dsc_cfg.version_minor == 1 && // v1.1 line buffer depth range:
> --
> 2.7.4
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] drm/amd/display: Add number of slices per line to DSC parameter validation
  2019-08-06 14:04 ` Alex Deucher
@ 2019-08-06 17:45   ` Harry Wentland
  2019-08-06 19:04     ` Alex Deucher
  0 siblings, 1 reply; 4+ messages in thread
From: Harry Wentland @ 2019-08-06 17:45 UTC (permalink / raw)
  To: hariprasad.kelam
  Cc: sunpeng.li, alexander.deucher, christian.koenig, David1.Zhou,
	airlied, daniel, nikola.cornij, Dmytro.Laktyushkin, colin.king,
	amd-gfx, dri-devel, linux-kernel, Harry Wentland

From: Nikola Cornij <nikola.cornij@amd.com>

[why]
Number of slices per line was mistakenly left out

Cc: Hariprasad Kelam <hariprasad.kelam@gmail.com>
Signed-off-by: Nikola Cornij <nikola.cornij@amd.com>
Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
---

Thanks, Hariprasad, for your patch. The second condition should actually check
for num_slices_h.

Harry

 drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dsc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dsc.c b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dsc.c
index e870caa8d4fa..adb69c038efb 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dsc.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dsc.c
@@ -302,7 +302,7 @@ static bool dsc_prepare_config(struct display_stream_compressor *dsc, const stru
 		    dsc_cfg->dc_dsc_cfg.linebuf_depth == 0)));
 	ASSERT(96 <= dsc_cfg->dc_dsc_cfg.bits_per_pixel && dsc_cfg->dc_dsc_cfg.bits_per_pixel <= 0x3ff); // 6.0 <= bits_per_pixel <= 63.9375
 
-	if (!dsc_cfg->dc_dsc_cfg.num_slices_v || !dsc_cfg->dc_dsc_cfg.num_slices_v ||
+	if (!dsc_cfg->dc_dsc_cfg.num_slices_v || !dsc_cfg->dc_dsc_cfg.num_slices_h ||
 		!(dsc_cfg->dc_dsc_cfg.version_minor == 1 || dsc_cfg->dc_dsc_cfg.version_minor == 2) ||
 		!dsc_cfg->pic_width || !dsc_cfg->pic_height ||
 		!((dsc_cfg->dc_dsc_cfg.version_minor == 1 && // v1.1 line buffer depth range:
-- 
2.22.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/amd/display: Add number of slices per line to DSC parameter validation
  2019-08-06 17:45   ` [PATCH] drm/amd/display: Add number of slices per line to DSC parameter validation Harry Wentland
@ 2019-08-06 19:04     ` Alex Deucher
  0 siblings, 0 replies; 4+ messages in thread
From: Alex Deucher @ 2019-08-06 19:04 UTC (permalink / raw)
  To: Harry Wentland
  Cc: Hariprasad Kelam, Chunming Zhou, Leo (Sunpeng) Li, LKML,
	amd-gfx list, Nikola Cornij, Dave Airlie, Dmytro Laktyushkin,
	Maling list - DRI developers, Daniel Vetter, Deucher, Alexander,
	Colin Ian King, Christian Koenig

On Tue, Aug 6, 2019 at 1:45 PM Harry Wentland <harry.wentland@amd.com> wrote:
>
> From: Nikola Cornij <nikola.cornij@amd.com>
>
> [why]
> Number of slices per line was mistakenly left out
>
> Cc: Hariprasad Kelam <hariprasad.kelam@gmail.com>
> Signed-off-by: Nikola Cornij <nikola.cornij@amd.com>
> Signed-off-by: Harry Wentland <harry.wentland@amd.com>
> Reviewed-by: Harry Wentland <harry.wentland@amd.com>

Acked-by: Alex Deucher <alexander.deucher@amd.com>

> ---
>
> Thanks, Hariprasad, for your patch. The second condition should actually check
> for num_slices_h.
>
> Harry
>
>  drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dsc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dsc.c b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dsc.c
> index e870caa8d4fa..adb69c038efb 100644
> --- a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dsc.c
> +++ b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dsc.c
> @@ -302,7 +302,7 @@ static bool dsc_prepare_config(struct display_stream_compressor *dsc, const stru
>                     dsc_cfg->dc_dsc_cfg.linebuf_depth == 0)));
>         ASSERT(96 <= dsc_cfg->dc_dsc_cfg.bits_per_pixel && dsc_cfg->dc_dsc_cfg.bits_per_pixel <= 0x3ff); // 6.0 <= bits_per_pixel <= 63.9375
>
> -       if (!dsc_cfg->dc_dsc_cfg.num_slices_v || !dsc_cfg->dc_dsc_cfg.num_slices_v ||
> +       if (!dsc_cfg->dc_dsc_cfg.num_slices_v || !dsc_cfg->dc_dsc_cfg.num_slices_h ||
>                 !(dsc_cfg->dc_dsc_cfg.version_minor == 1 || dsc_cfg->dc_dsc_cfg.version_minor == 2) ||
>                 !dsc_cfg->pic_width || !dsc_cfg->pic_height ||
>                 !((dsc_cfg->dc_dsc_cfg.version_minor == 1 && // v1.1 line buffer depth range:
> --
> 2.22.0
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-08-06 19:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-05 17:32 [PATCH] gpu: drm: amd: display: dc: dcn20: Remove redudant condition Hariprasad Kelam
2019-08-06 14:04 ` Alex Deucher
2019-08-06 17:45   ` [PATCH] drm/amd/display: Add number of slices per line to DSC parameter validation Harry Wentland
2019-08-06 19:04     ` Alex Deucher

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).