summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaarten Lankhorst <maarten.lankhorst@linux.intel.com>2017-07-11 16:33:14 +0200
committerDaniel Vetter <daniel.vetter@ffwll.ch>2017-07-26 13:22:43 +0200
commitc4bbb7358425b3a1c93f4d8c12a8fe46438ca73b (patch)
tree27a7d307e6593427d30ca596708a6bd594703d18
parent8a39374ef8b849dfd18e7d8dd52ef8ffee0f1042 (diff)
downloadlinux-c4bbb7358425b3a1c93f4d8c12a8fe46438ca73b.tar.gz
linux-c4bbb7358425b3a1c93f4d8c12a8fe46438ca73b.tar.bz2
linux-c4bbb7358425b3a1c93f4d8c12a8fe46438ca73b.zip
drm/atomic: Allow drm_atomic_helper_swap_state to fail
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/20170711143314.2148-13-maarten.lankhorst@linux.intel.com Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Reviewed-by: Sean Paul <seanpaul@chromium.org> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r--drivers/gpu/drm/drm_atomic_helper.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
index 8d8221a128d0..70146f809db5 100644
--- a/drivers/gpu/drm/drm_atomic_helper.c
+++ b/drivers/gpu/drm/drm_atomic_helper.c
@@ -2261,13 +2261,13 @@ EXPORT_SYMBOL(drm_atomic_helper_cleanup_planes);
*
* Returns:
*
- * Always returns 0, cannot fail yet.
+ * Returns 0 on success. Can return -ERESTARTSYS when @stall is true and the
+ * waiting for the previous commits has been interrupted.
*/
int drm_atomic_helper_swap_state(struct drm_atomic_state *state,
bool stall)
{
- int i;
- long ret;
+ int i, ret;
struct drm_connector *connector;
struct drm_connector_state *old_conn_state, *new_conn_state;
struct drm_crtc *crtc;
@@ -2290,12 +2290,11 @@ int drm_atomic_helper_swap_state(struct drm_atomic_state *state,
if (!commit)
continue;
- ret = wait_for_completion_timeout(&commit->hw_done,
- 10*HZ);
- if (ret == 0)
- DRM_ERROR("[CRTC:%d:%s] hw_done timed out\n",
- crtc->base.id, crtc->name);
+ ret = wait_for_completion_interruptible(&commit->hw_done);
drm_crtc_commit_put(commit);
+
+ if (ret)
+ return ret;
}
}