Commit 3cb43cc0 authored by Daniel Vetter's avatar Daniel Vetter

drm: Update plane->fb also for page_flip

The legacy page_flip driver entry point is the only one left which
requires drivers to update plane->fb themselves. All the other entry
hooks will patch things up for the driver as needed since no one seems
to reliable get this right, see e.g. drm_mode_set_config_internal or
the plane->fb/old_fb handling in drm_mode_atomic_ioctl.

Therefore unify things, which allows us to ditch a TODO from
drm_atomic_helper_page_flip.

This should also help the atomic transition in i915 since we keep a
bit of legacy cruft only around because of this special behaviour in
->page_flip.

Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
parent 1f96beec
...@@ -1915,10 +1915,6 @@ int drm_atomic_helper_page_flip(struct drm_crtc *crtc, ...@@ -1915,10 +1915,6 @@ int drm_atomic_helper_page_flip(struct drm_crtc *crtc,
if (ret != 0) if (ret != 0)
goto fail; goto fail;
/* TODO: ->page_flip is the only driver callback where the core
* doesn't update plane->fb. For now patch it up here. */
plane->fb = plane->state->fb;
/* Driver takes ownership of state on successful async commit. */ /* Driver takes ownership of state on successful async commit. */
return 0; return 0;
fail: fail:
......
...@@ -5345,13 +5345,7 @@ int drm_mode_page_flip_ioctl(struct drm_device *dev, ...@@ -5345,13 +5345,7 @@ int drm_mode_page_flip_ioctl(struct drm_device *dev,
/* Keep the old fb, don't unref it. */ /* Keep the old fb, don't unref it. */
crtc->primary->old_fb = NULL; crtc->primary->old_fb = NULL;
} else { } else {
/* crtc->primary->fb = fb;
* Warn if the driver hasn't properly updated the crtc->fb
* field to reflect that the new framebuffer is now used.
* Failing to do so will screw with the reference counting
* on framebuffers.
*/
WARN_ON(crtc->primary->fb != fb);
/* Unref only the old framebuffer. */ /* Unref only the old framebuffer. */
fb = NULL; fb = NULL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment