OSDN Git Service

drm/udl: Remove struct udl_device.active_fb_16
authorThomas Zimmermann <tzimmermann@suse.de>
Tue, 10 Dec 2019 08:49:03 +0000 (09:49 +0100)
committerThomas Zimmermann <tzimmermann@suse.de>
Wed, 11 Dec 2019 16:02:16 +0000 (17:02 +0100)
The udl driver stores the currently active framebuffer to know from
where to accept damage updates.

With the conversion to plane-state damage handling, this is not necessary
any longer. The currently active framebuffer and damaged area are always
stored in the plane state.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191210084905.5570-8-tzimmermann@suse.de
drivers/gpu/drm/udl/udl_drv.h
drivers/gpu/drm/udl/udl_fb.c
drivers/gpu/drm/udl/udl_main.c
drivers/gpu/drm/udl/udl_modeset.c

index 1ade917..dd58b9a 100644 (file)
@@ -54,10 +54,6 @@ struct udl_device {
 
        struct drm_simple_display_pipe display_pipe;
 
-       /* active framebuffer on the 16-bit channel */
-       const struct drm_framebuffer *active_fb_16;
-       spinlock_t active_fb_16_lock;
-
        struct mutex gem_lock;
 
        int sku_pixel_limit;
index 98cc2ab..397c621 100644 (file)
@@ -87,7 +87,6 @@ int udl_handle_damage(struct drm_framebuffer *fb, int x, int y,
                      int width, int height)
 {
        struct drm_device *dev = fb->dev;
-       struct udl_device *udl = to_udl(dev);
        struct dma_buf_attachment *import_attach = fb->obj[0]->import_attach;
        int i, ret, tmp_ret;
        char *cmd;
@@ -96,13 +95,6 @@ int udl_handle_damage(struct drm_framebuffer *fb, int x, int y,
        int log_bpp;
        void *vaddr;
 
-       spin_lock(&udl->active_fb_16_lock);
-       if (udl->active_fb_16 != fb) {
-               spin_unlock(&udl->active_fb_16_lock);
-               return 0;
-       }
-       spin_unlock(&udl->active_fb_16_lock);
-
        ret = udl_log_cpp(fb->format->cpp[0]);
        if (ret < 0)
                return ret;
index ff3e986..5387189 100644 (file)
@@ -314,9 +314,6 @@ int udl_init(struct udl_device *udl)
 
        DRM_DEBUG("\n");
 
-       udl->active_fb_16 = NULL;
-       spin_lock_init(&udl->active_fb_16_lock);
-
        mutex_init(&udl->gem_lock);
 
        if (!udl_parse_vendor_descriptor(dev, udl->udev)) {
index c02e383..35fa7b1 100644 (file)
@@ -284,9 +284,6 @@ udl_simple_display_pipe_enable(struct drm_simple_display_pipe *pipe,
 
        wrptr = udl_dummy_render(wrptr);
 
-       spin_lock(&udl->active_fb_16_lock);
-       udl->active_fb_16 = fb;
-       spin_unlock(&udl->active_fb_16_lock);
        udl->mode_buf_len = wrptr - buf;
 
        udl_handle_damage(fb, 0, 0, fb->width, fb->height);
@@ -331,16 +328,10 @@ static void
 udl_simple_display_pipe_update(struct drm_simple_display_pipe *pipe,
                               struct drm_plane_state *old_plane_state)
 {
-       struct drm_device *dev = pipe->crtc.dev;
-       struct udl_device *udl = dev->dev_private;
        struct drm_plane_state *state = pipe->plane.state;
        struct drm_framebuffer *fb = state->fb;
        struct drm_rect rect;
 
-       spin_lock(&udl->active_fb_16_lock);
-       udl->active_fb_16 = fb;
-       spin_unlock(&udl->active_fb_16_lock);
-
        if (!fb)
                return;