Commit 7e40f648 authored by Mario Limonciello's avatar Mario Limonciello Committed by Alex Deucher
Browse files

drm/amd/display: Avoid divide by zero by initializing dummy pitch to 1



[Why]
If the dummy values in `populate_dummy_dml_surface_cfg()` aren't updated
then they can lead to a divide by zero in downstream callers like
CalculateVMAndRowBytes()

[How]
Initialize dummy value to a value to avoid divide by zero.

Reviewed-by: default avatarAlex Hung <alex.hung@amd.com>
Signed-off-by: default avatarMario Limonciello <mario.limonciello@amd.com>
Signed-off-by: default avatarZaeem Mohamed <zaeem.mohamed@amd.com>
Tested-by: default avatarMark Broadworth <mark.broadworth@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 724a4b40
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -896,7 +896,7 @@ static void populate_dummy_dml_surface_cfg(struct dml_surface_cfg_st *out, unsig
	out->SurfaceWidthC[location] = in->timing.h_addressable;
	out->SurfaceHeightC[location] = in->timing.v_addressable;
	out->PitchY[location] = ((out->SurfaceWidthY[location] + 127) / 128) * 128;
	out->PitchC[location] = 0;
	out->PitchC[location] = 1;
	out->DCCEnable[location] = false;
	out->DCCMetaPitchY[location] = 0;
	out->DCCMetaPitchC[location] = 0;