diff options
author | Thomas Zimmermann <tzimmermann@suse.de> | 2019-11-14 15:10:23 +0100 |
---|---|---|
committer | Thomas Zimmermann <tzimmermann@suse.de> | 2019-11-26 12:34:43 +0100 |
commit | ba59b015a0145330e2bf7ab20d504bc624fd618a (patch) | |
tree | 6137c0ebafb84410d8287ab74f0b01aedc05e308 /drivers/gpu/drm/udl/udl_modeset.c | |
parent | f3f8630a9a7c8f8ab1b16e09b254417478df5182 (diff) |
drm/udl: Store active framebuffer in device structure
The framebuffer's 'active_16' flag signals which framebuffer to flush
to device memory. Moving the 'active_16' state from struct udl_framebuffer
into struct udl_device prepares for using the generic GEM framebuffer.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20191114141025.32198-4-tzimmermann@suse.de
Diffstat (limited to 'drivers/gpu/drm/udl/udl_modeset.c')
-rw-r--r-- | drivers/gpu/drm/udl/udl_modeset.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/drivers/gpu/drm/udl/udl_modeset.c b/drivers/gpu/drm/udl/udl_modeset.c index 6582c9d27a87..44a741f463c9 100644 --- a/drivers/gpu/drm/udl/udl_modeset.c +++ b/drivers/gpu/drm/udl/udl_modeset.c @@ -332,11 +332,9 @@ static int udl_crtc_mode_set(struct drm_crtc *crtc, wrptr = udl_dummy_render(wrptr); - if (old_fb) { - struct udl_framebuffer *uold_fb = to_udl_fb(old_fb); - uold_fb->active_16 = false; - } - ufb->active_16 = true; + spin_lock(&udl->active_fb_16_lock); + udl->active_fb_16 = &ufb->base; + spin_unlock(&udl->active_fb_16_lock); udl->mode_buf_len = wrptr - buf; /* damage all of it */ @@ -364,13 +362,11 @@ static int udl_crtc_page_flip(struct drm_crtc *crtc, { struct udl_framebuffer *ufb = to_udl_fb(fb); struct drm_device *dev = crtc->dev; + struct udl_device *udl = dev->dev_private; - struct drm_framebuffer *old_fb = crtc->primary->fb; - if (old_fb) { - struct udl_framebuffer *uold_fb = to_udl_fb(old_fb); - uold_fb->active_16 = false; - } - ufb->active_16 = true; + spin_lock(&udl->active_fb_16_lock); + udl->active_fb_16 = fb; + spin_unlock(&udl->active_fb_16_lock); udl_handle_damage(ufb, 0, 0, fb->width, fb->height); |