[PATCH] drm/atomic: Reject async flips on a disabled pipe

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Two reasons for that:
- This changes aligns atomic with the legacy page flip semantics as
  established by the i915 driver.

- Asking for an async flip on a disabled pipe generally indicates a
  userspace bug. Worst case userspace will busy-loop rendering (since
  flips complete immediately). So better to catch this fast.

Note that we can't do the same for synchronous commits since the
legacy hooks allowed that. And there's probably piles of userspace
code out there which relies on this.

Cc: Daniel Stone <daniels@xxxxxxxxxxxxx>
Signed-off-by: Daniel Vetter <daniel.vetter@xxxxxxxx>
---
 drivers/gpu/drm/drm_atomic.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
index 791876e4657c..3c171e9e1cf5 100644
--- a/drivers/gpu/drm/drm_atomic.c
+++ b/drivers/gpu/drm/drm_atomic.c
@@ -1334,12 +1334,25 @@ EXPORT_SYMBOL(drm_atomic_commit);
 int drm_atomic_async_commit(struct drm_atomic_state *state)
 {
 	struct drm_mode_config *config = &state->dev->mode_config;
-	int ret;
+	struct drm_crtc *crtc;
+	struct drm_crtc_state *crtc_state;
+	int i, ret;
 
 	ret = drm_atomic_check_only(state);
 	if (ret)
 		return ret;
 
+	if (!state->allow_modeset) {
+		for_each_crtc_in_state(state, crtc, crtc_state, i) {
+			if (crtc_state->active) {
+				DRM_DEBUG_ATOMIC("[CRTC:%d] requires full modeset\n",
+						 crtc->base.id);
+				return -EINVAL;
+
+			}
+		}
+	}
+
 	DRM_DEBUG_ATOMIC("commiting %p asynchronously\n", state);
 
 	return config->funcs->atomic_commit(state->dev, state, true);
-- 
2.5.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux