summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/drm_crtc.c
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2013-06-15 02:13:15 +0400
committerDave Airlie <airlied@redhat.com>2013-06-25 07:04:10 +0400
commitcc85e1217f598f342b69dc44710d7a7355513a1b (patch)
treeaede100e927e8f7f82695a9bc7321828b06c01b1 /drivers/gpu/drm/drm_crtc.c
parent372835a8527f85b3eff20a18c2c339e827dfd4e4 (diff)
downloadlinux-cc85e1217f598f342b69dc44710d7a7355513a1b.tar.xz
drm: check that ->set_config properly updates the fb
Historically drm lacked fb refcounting, so the updating of crtc->fb was done by the lower levels at a point convenient to get their own refcounting (e.g. refcounts for the underlying gem bo, pinning refcounts) right. With the introduction of refcounted fbs the drm core handled the fb refcounts, but still relied on drivers to update the crtc->fb pointer (this approach required the least invasive changes in drivers). Enforce this contract with a WARN_ON. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/drm_crtc.c')
-rw-r--r--drivers/gpu/drm/drm_crtc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
index c9f9f3ded9e1..a7dc1e266c98 100644
--- a/drivers/gpu/drm/drm_crtc.c
+++ b/drivers/gpu/drm/drm_crtc.c
@@ -1980,6 +1980,9 @@ int drm_mode_set_config_internal(struct drm_mode_set *set)
ret = crtc->funcs->set_config(set);
if (ret == 0) {
+ /* crtc->fb must be updated by ->set_config, enforces this. */
+ WARN_ON(fb != crtc->fb);
+
if (old_fb)
drm_framebuffer_unreference(old_fb);
if (fb)