Skip to content

Commit 3cb43cc

Browse files
committed
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: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
1 parent 1f96bee commit 3cb43cc

File tree

2 files changed

+1
-11
lines changed

2 files changed

+1
-11
lines changed

drivers/gpu/drm/drm_atomic_helper.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1915,10 +1915,6 @@ int drm_atomic_helper_page_flip(struct drm_crtc *crtc,
19151915
if (ret != 0)
19161916
goto fail;
19171917

1918-
/* TODO: ->page_flip is the only driver callback where the core
1919-
* doesn't update plane->fb. For now patch it up here. */
1920-
plane->fb = plane->state->fb;
1921-
19221918
/* Driver takes ownership of state on successful async commit. */
19231919
return 0;
19241920
fail:

drivers/gpu/drm/drm_crtc.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5345,13 +5345,7 @@ int drm_mode_page_flip_ioctl(struct drm_device *dev,
53455345
/* Keep the old fb, don't unref it. */
53465346
crtc->primary->old_fb = NULL;
53475347
} else {
5348-
/*
5349-
* Warn if the driver hasn't properly updated the crtc->fb
5350-
* field to reflect that the new framebuffer is now used.
5351-
* Failing to do so will screw with the reference counting
5352-
* on framebuffers.
5353-
*/
5354-
WARN_ON(crtc->primary->fb != fb);
5348+
crtc->primary->fb = fb;
53555349
/* Unref only the old framebuffer. */
53565350
fb = NULL;
53575351
}

0 commit comments

Comments
 (0)