Skip to content

Commit 843e3c7

Browse files
Shirish Salexdeucher
authored andcommitted
drm/amd/display: defer modeset check in dm_update_planes_state
amdgpu_dm_atomic_check() is used to validate the entire configuration of planes and crtc's that the user space wants to commit. However amdgpu_dm_atomic_check() depends upon DRM_MODE_ATOMIC_ALLOW_MODESET flag else its mostly dummy. Its not mandatory for the user space to set DRM_MODE_ATOMIC_ALLOW_MODESET, and in general its not set either along with DRM_MODE_ATOMIC_TEST_ONLY. Considering its importantance, this patch defers the allow_modeset check in dm_update_planes_state(), so that there shall be scope to validate the configuration sent from user space, without impacting the population of dc/dm related data structures. Signed-off-by: Shirish S <[email protected]> Reviewed-by: Harry Wentland <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 3573d59 commit 843e3c7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4636,8 +4636,6 @@ static int dm_update_planes_state(struct dc *dc,
46364636
bool pflip_needed = !state->allow_modeset;
46374637
int ret = 0;
46384638

4639-
if (pflip_needed)
4640-
return ret;
46414639

46424640
/* Add new planes */
46434641
for_each_oldnew_plane_in_state(state, plane, old_plane_state, new_plane_state, i) {
@@ -4652,6 +4650,8 @@ static int dm_update_planes_state(struct dc *dc,
46524650

46534651
/* Remove any changed/removed planes */
46544652
if (!enable) {
4653+
if (pflip_needed)
4654+
continue;
46554655

46564656
if (!old_plane_crtc)
46574657
continue;
@@ -4696,6 +4696,8 @@ static int dm_update_planes_state(struct dc *dc,
46964696
if (!dm_new_crtc_state->stream)
46974697
continue;
46984698

4699+
if (pflip_needed)
4700+
continue;
46994701

47004702
WARN_ON(dm_new_plane_state->dc_state);
47014703

0 commit comments

Comments
 (0)