drm/amd/display: Verify Gamma & Degamma LUT sizes in amdgpu_dm_atomic_check

For each CRTC state, check the size of Gamma and Degamma LUTs  so
unexpected and larger sizes wouldn't slip through.

TEST: IGT:kms_color::pipe-invalid-gamma-lut-sizes

v2: fix assignments in if clauses, Mark's email.

Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Mark Yacoub <markyacoub@chromium.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
Mark Yacoub
2021-06-04 13:01:07 -04:00
committed by Alex Deucher
parent 3a07101b04
commit 03fc4cf45d
3 changed files with 40 additions and 6 deletions

View File

@@ -10245,6 +10245,10 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev,
dm_old_crtc_state->dsc_force_changed == false)
continue;
ret = amdgpu_dm_verify_lut_sizes(new_crtc_state);
if (ret)
goto fail;
if (!new_crtc_state->enable)
continue;