Skip to contentSkip to conversation

drm/atomic: Reject async flips on a disabled pipe

PATCH New Daniel Vetter 1 participant 1 message Dec 3, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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

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.

---
 drivers/gpu/drm/drm_atomic.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)
drivers/gpu/drm/drm_atomic.c +14 -1
index 791876e4657c..3c171e9e1cf5 100644
@@ -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);
Signature · 6 lines
2.5.1

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx