From 6e02d6ce89cdf62f20e71cc769b34687b722fc62 Mon Sep 17 00:00:00 2001 From: Arindam Nath Date: Thu, 18 Aug 2016 11:59:45 +0530 Subject: [PATCH 01/12] drm/amd/dal: return page flip status to userspace We need to return the status of page flip operation back to userspace. This enables userspace to take corrective action when say, a pflip operation returns -EBUSY. This resolves the issue when mpv randomly hangs during playback at the very beginning itself. Reviewed-by: Alex Deucher Reviewed-by: Harry Wentland Signed-off-by: Arindam Nath Signed-off-by: Alex Deucher Signed-off-by: Kalyan Alle --- drivers/gpu/drm/amd/dal/amdgpu_dm/amdgpu_dm_types.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/amd/dal/amdgpu_dm/amdgpu_dm_types.c b/drivers/gpu/drm/amd/dal/amdgpu_dm/amdgpu_dm_types.c index 390c9b0..ab8bc4c 100644 --- a/drivers/gpu/drm/amd/dal/amdgpu_dm/amdgpu_dm_types.c +++ b/drivers/gpu/drm/amd/dal/amdgpu_dm/amdgpu_dm_types.c @@ -2020,7 +2020,7 @@ int amdgpu_dm_atomic_commit( struct drm_plane *plane; struct drm_plane_state *old_plane_state; uint32_t i; - int32_t ret; + int32_t ret = 0; uint32_t commit_targets_count = 0; uint32_t new_crtcs_count = 0; struct drm_crtc *crtc; @@ -2260,12 +2260,16 @@ int amdgpu_dm_atomic_commit( !crtc->state->active) continue; - if (page_flip_needed(plane_state, old_plane_state)) - amdgpu_crtc_page_flip( - crtc, - fb, - crtc->state->event, - 0); + if (page_flip_needed(plane_state, old_plane_state)) { + ret = amdgpu_crtc_page_flip( + crtc, + fb, + crtc->state->event, + 0); + if (ret) + return ret; + } + } /* In this state all old framebuffers would be unpinned */ @@ -2276,7 +2280,7 @@ int amdgpu_dm_atomic_commit( drm_atomic_state_free(state); - return 0; + return ret; } /* * This functions handle all cases when set mode does not come upon hotplug. -- 2.7.4