diff options
author | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2018-03-22 16:22:58 +0100 |
---|---|---|
committer | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2018-03-29 18:14:21 +0200 |
commit | a36c027db57b6a33970c5c830a0d143f0e98c248 (patch) | |
tree | f4a9d23d45f076ac755d36bfc09fd6f7f917658d /drivers/gpu/drm/drm_crtc.c | |
parent | drm: Make the fb refcount handover less magic (diff) | |
download | linux-a36c027db57b6a33970c5c830a0d143f0e98c248.tar.xz linux-a36c027db57b6a33970c5c830a0d143f0e98c248.zip |
drm: Use plane->state->fb over plane->fb
Stop looking at plane->fb on atomic drivers. Use plane->state->fb
instead.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180322152313.6561-9-ville.syrjala@linux.intel.com
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Diffstat (limited to 'drivers/gpu/drm/drm_crtc.c')
-rw-r--r-- | drivers/gpu/drm/drm_crtc.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index 537ffaab855c..a231dd5dce16 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c @@ -597,13 +597,20 @@ retry: /* If we have a mode we need a framebuffer. */ /* If we pass -1, set the mode with the currently bound fb */ if (crtc_req->fb_id == -1) { - if (!plane->fb) { + struct drm_framebuffer *old_fb; + + if (plane->state) + old_fb = plane->state->fb; + else + old_fb = plane->fb; + + if (!old_fb) { DRM_DEBUG_KMS("CRTC doesn't have current FB\n"); ret = -EINVAL; goto out; } - fb = plane->fb; + fb = old_fb; /* Make refcounting symmetric with the lookup path. */ drm_framebuffer_get(fb); } else { |