|
@@ -1117,19 +1117,19 @@ drm_atomic_helper_wait_for_vblanks(struct drm_device *dev,
|
|
|
struct drm_crtc *crtc;
|
|
|
struct drm_crtc_state *old_crtc_state;
|
|
|
int i, ret;
|
|
|
+ unsigned crtc_mask = 0;
|
|
|
|
|
|
- for_each_crtc_in_state(old_state, crtc, old_crtc_state, i) {
|
|
|
- /* No one cares about the old state, so abuse it for tracking
|
|
|
- * and store whether we hold a vblank reference (and should do a
|
|
|
- * vblank wait) in the ->enable boolean. */
|
|
|
- old_crtc_state->enable = false;
|
|
|
+ /*
|
|
|
+ * Legacy cursor ioctls are completely unsynced, and userspace
|
|
|
+ * relies on that (by doing tons of cursor updates).
|
|
|
+ */
|
|
|
+ if (old_state->legacy_cursor_update)
|
|
|
+ return;
|
|
|
|
|
|
- if (!crtc->state->active)
|
|
|
- continue;
|
|
|
+ for_each_crtc_in_state(old_state, crtc, old_crtc_state, i) {
|
|
|
+ struct drm_crtc_state *new_crtc_state = crtc->state;
|
|
|
|
|
|
- /* Legacy cursor ioctls are completely unsynced, and userspace
|
|
|
- * relies on that (by doing tons of cursor updates). */
|
|
|
- if (old_state->legacy_cursor_update)
|
|
|
+ if (!new_crtc_state->active)
|
|
|
continue;
|
|
|
|
|
|
if (!drm_atomic_helper_framebuffer_changed(dev,
|
|
@@ -1140,16 +1140,16 @@ drm_atomic_helper_wait_for_vblanks(struct drm_device *dev,
|
|
|
if (ret != 0)
|
|
|
continue;
|
|
|
|
|
|
- old_crtc_state->enable = true;
|
|
|
- old_crtc_state->last_vblank_count = drm_crtc_vblank_count(crtc);
|
|
|
+ crtc_mask |= drm_crtc_mask(crtc);
|
|
|
+ old_state->crtcs[i].last_vblank_count = drm_crtc_vblank_count(crtc);
|
|
|
}
|
|
|
|
|
|
for_each_crtc_in_state(old_state, crtc, old_crtc_state, i) {
|
|
|
- if (!old_crtc_state->enable)
|
|
|
+ if (!(crtc_mask & drm_crtc_mask(crtc)))
|
|
|
continue;
|
|
|
|
|
|
ret = wait_event_timeout(dev->vblank[i].queue,
|
|
|
- old_crtc_state->last_vblank_count !=
|
|
|
+ old_state->crtcs[i].last_vblank_count !=
|
|
|
drm_crtc_vblank_count(crtc),
|
|
|
msecs_to_jiffies(50));
|
|
|
|