Skip to content

Commit 004b393

Browse files
Nicholas Kazlauskasalexdeucher
Nicholas Kazlauskas
authored andcommitted
drm/amd/display: Check scaling info when determing update type
[Why] Surface scaling info updates can affect bandwidth and blocks. We need to be checking these with global validation to avoid underflow or corruption. [How] Drop the state->allow_modeset early exit in dm_determine_update_type_for_commit. Most of those should be considered fast now anyway. Fill in scaling info and it to the surface update in atomic check. Signed-off-by: Nicholas Kazlauskas <[email protected]> Reviewed-by: David Francis <[email protected]> Acked-by: Bhawanpreet Lakha <Bhawanpreet [email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 6e8dc7b commit 004b393

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6312,6 +6312,7 @@ dm_determine_update_type_for_commit(struct amdgpu_display_manager *dm,
63126312
}
63136313

63146314
for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) {
6315+
struct dc_scaling_info scaling_info;
63156316
struct dc_stream_update stream_update;
63166317

63176318
memset(&stream_update, 0, sizeof(stream_update));
@@ -6342,9 +6343,6 @@ dm_determine_update_type_for_commit(struct amdgpu_display_manager *dm,
63426343
goto cleanup;
63436344
}
63446345

6345-
if (!state->allow_modeset)
6346-
continue;
6347-
63486346
if (crtc != new_plane_crtc)
63496347
continue;
63506348

@@ -6366,6 +6364,13 @@ dm_determine_update_type_for_commit(struct amdgpu_display_manager *dm,
63666364
new_dm_crtc_state->stream->out_transfer_func;
63676365
}
63686366

6367+
ret = fill_dc_scaling_info(new_plane_state,
6368+
&scaling_info);
6369+
if (ret)
6370+
goto cleanup;
6371+
6372+
updates[num_plane].scaling_info = &scaling_info;
6373+
63696374
num_plane++;
63706375
}
63716376

0 commit comments

Comments
 (0)