diff options
author | Shirish S <shirish.s@amd.com> | 2018-02-16 01:14:22 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2018-03-05 15:36:10 -0500 |
commit | c21b68c5ebd9b0267d59c7a899ee4c6a7e0668fc (patch) | |
tree | 52cc0343afab7a0c5eb23b3435002bb5e7e8baf6 | |
parent | 33f2d94ecd0ebb9c9c651691b4535332aac40edf (diff) |
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 <shirish.s@amd.com>
Reviewed-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r-- | drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index 9a1e82305b07..2c5ef6619b17 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | |||
@@ -4687,8 +4687,6 @@ static int dm_update_planes_state(struct dc *dc, | |||
4687 | bool pflip_needed = !state->allow_modeset; | 4687 | bool pflip_needed = !state->allow_modeset; |
4688 | int ret = 0; | 4688 | int ret = 0; |
4689 | 4689 | ||
4690 | if (pflip_needed) | ||
4691 | return ret; | ||
4692 | 4690 | ||
4693 | /* Add new planes */ | 4691 | /* Add new planes */ |
4694 | for_each_oldnew_plane_in_state(state, plane, old_plane_state, new_plane_state, i) { | 4692 | 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, | |||
4703 | 4701 | ||
4704 | /* Remove any changed/removed planes */ | 4702 | /* Remove any changed/removed planes */ |
4705 | if (!enable) { | 4703 | if (!enable) { |
4704 | if (pflip_needed) | ||
4705 | continue; | ||
4706 | 4706 | ||
4707 | if (!old_plane_crtc) | 4707 | if (!old_plane_crtc) |
4708 | continue; | 4708 | continue; |
@@ -4747,6 +4747,8 @@ static int dm_update_planes_state(struct dc *dc, | |||
4747 | if (!dm_new_crtc_state->stream) | 4747 | if (!dm_new_crtc_state->stream) |
4748 | continue; | 4748 | continue; |
4749 | 4749 | ||
4750 | if (pflip_needed) | ||
4751 | continue; | ||
4750 | 4752 | ||
4751 | WARN_ON(dm_new_plane_state->dc_state); | 4753 | WARN_ON(dm_new_plane_state->dc_state); |
4752 | 4754 | ||