Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c21b68c5 authored by Shirish S's avatar Shirish S Committed by Alex Deucher
Browse files

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: default avatarShirish S <shirish.s@amd.com>
Reviewed-by: default avatarHarry Wentland <Harry.Wentland@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 33f2d94e
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -4687,8 +4687,6 @@ static int dm_update_planes_state(struct dc *dc,
	bool pflip_needed  = !state->allow_modeset;
	int ret = 0;

	if (pflip_needed)
		return ret;

	/* Add new planes */
	for_each_oldnew_plane_in_state(state, plane, old_plane_state, new_plane_state, i) {
@@ -4703,6 +4701,8 @@ static int dm_update_planes_state(struct dc *dc,

		/* Remove any changed/removed planes */
		if (!enable) {
			if (pflip_needed)
				continue;

			if (!old_plane_crtc)
				continue;
@@ -4747,6 +4747,8 @@ static int dm_update_planes_state(struct dc *dc,
			if (!dm_new_crtc_state->stream)
				continue;

			if (pflip_needed)
				continue;

			WARN_ON(dm_new_plane_state->dc_state);