Skip to contentSkip to conversation

gpu: drm: amd: display: dc: dcn20: Remove redudant condition

PATCH In review Hariprasad Kelam 3 participants 4 messages Aug 5, 2019 – Aug 6, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gpu: drm: amd: display: dc: dcn20: Remove redudant condition

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

fixes coverity defect 1451853

---
 drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dsc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dsc.c +1 -1
index e870caa..42133bd 100644
@@ -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:
Signature · 1 line
2.7.4
#1 lore raw
Quoted 15 lines · Hariprasad Kelam

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

fixes coverity defect 1451853

---
 drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dsc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dsc.c +0 -0
index e870caa..42133bd 100644

drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dsc.c static bool dsc_prepare_config(struct display_stream_compressor *dsc, const stru · line 305

Quoted 5 lines
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dsc.c +1 -1
@@ -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

Quoted 10 lines
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dsc.c +0 -1
                !(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
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

maintainer
#2 lore raw

PATCH 1/1 drm/amd/display: Add number of slices per line to DSC parameter validation

From: Nikola Cornij <[email protected]>

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

---

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(-)
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dsc.c +1 -1
index e870caa8d4fa..adb69c038efb 100644
@@ -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:
Signature · 6 lines
2.22.0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Acked-by on v1 1/1
#3 lore raw

Re: [PATCH] drm/amd/display: Add number of slices per line to DSC parameter validation

Quoted 10 lines · Harry Wentland

From: Nikola Cornij <[email protected]>

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

Quoted 26 lines

---

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(-)
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dsc.c +1 -2
index e870caa8d4fa..adb69c038efb 100644
@@ -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

Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx