Skip to contentSkip to conversation

suspicious conditions in amd display driver

PATCH Denis Efremov 1 participant 1 message Sep 2, 2020

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

Hi,

I've found suspicious code patterns in amd display driver.
For me they looks like redundant comparisons, but maybe it's logic bugs and dm_444_16, dm_whole_buffer_for_single_stream_interleave should be changed to other variables in second disjuncts.

Here are they:

tmp/nothing/drivers/gpu/drm/amd/display/dc/dml/dcn30/display_mode_vba_30.c renamed from drivers/gpu/drm/amd/display/dc/dml/dcn30/display_mode_vba_30.c +0 -0
diff -u -p ./drivers/gpu/drm/amd/display/dc/dml/dcn30/display_mode_vba_30.c /tmp/nothing/drivers/gpu/drm/amd/display/dc/dml/dcn30/display_mode_vba_30.c
@@ -3235,7 +3235,6 @@ static bool CalculateBytePerPixelAnd256B
		*BytePerPixelDETC = 0;
		*BytePerPixelY = 4;
		*BytePerPixelC = 0;
-       } else if (SourcePixelFormat == dm_444_16 || SourcePixelFormat == dm_444_16) { // <== same comparison with dm_444_16
		*BytePerPixelDETY = 2;
		*BytePerPixelDETC = 0;
	*BytePerPixelY = 2;

@@ -5515,7 +5514,6 @@ static void CalculateWatermarksAndDRAMSp

	if (WritebackPixelFormat[k] == dm_444_64) {
		WritebackDRAMClockChangeLatencyHiding = WritebackDRAMClockChangeLatencyHiding / 2;
	}

- if (mode_lib->vba.WritebackConfiguration == dm_whole_buffer_for_single_stream_interleave || mode_lib->vba.WritebackConfiguration == dm_whole_buffer_for_single_stream_interleave) { // <== same comparison with dm_whole_buffer_for_single_stream_interleave

tmp/nothing/drivers/gpu/drm/amd/display/dc/dml/dcn30/display_rq_dlg_calc_30.c renamed from drivers/gpu/drm/amd/display/dc/dml/dcn30/display_rq_dlg_calc_30.c +0 -0
diff -u -p ./drivers/gpu/drm/amd/display/dc/dml/dcn30/display_rq_dlg_calc_30.c /tmp/nothing/drivers/gpu/drm/amd/display/dc/dml/dcn30/display_rq_dlg_calc_30.c
@@ -279,7 +279,6 @@ static bool CalculateBytePerPixelAnd256B
		*BytePerPixelDETC = 0;
		*BytePerPixelY = 4;
		*BytePerPixelC = 0;
-       } else if (SourcePixelFormat == dm_444_16 || SourcePixelFormat == dm_444_16) { // <== same comparison with dm_444_16
		*BytePerPixelDETY = 2;
		*BytePerPixelDETC = 0;
		*BytePerPixelY = 2;

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