diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2015-08-07 11:33:05 +0300 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2015-10-01 16:33:28 +0300 |
commit | 4a8506d2d68724b6d326621118874c07095c6645 (patch) | |
tree | 7dbe4d69e457c52aaff05902dc5d364666b7e6f7 /drivers/gpu/drm/armada/armada_overlay.c | |
parent | 4b5dda82c20c2eee500520010c0558789592d62f (diff) | |
download | linux-4a8506d2d68724b6d326621118874c07095c6645.tar.xz |
drm/armada: convert overlay plane vbl worker to a armada plane worker
Convert the overlay plane to use the generic armada plane worker
infrastructure which is shared with the primary plane.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers/gpu/drm/armada/armada_overlay.c')
-rw-r--r-- | drivers/gpu/drm/armada/armada_overlay.c | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/drivers/gpu/drm/armada/armada_overlay.c b/drivers/gpu/drm/armada/armada_overlay.c index 9a5bab765085..5c22b380f8f3 100644 --- a/drivers/gpu/drm/armada/armada_overlay.c +++ b/drivers/gpu/drm/armada/armada_overlay.c @@ -37,7 +37,7 @@ struct armada_ovl_plane { uint32_t dst_yx; uint32_t ctrl0; struct { - struct armada_vbl_event update; + struct armada_plane_work work; struct armada_regs regs[13]; } vbl; struct armada_ovl_plane_properties prop; @@ -82,14 +82,13 @@ static void armada_ovl_retire_fb(struct armada_ovl_plane *dplane, } /* === Plane support === */ -static void armada_ovl_plane_vbl(struct armada_crtc *dcrtc, void *data) +static void armada_ovl_plane_work(struct armada_crtc *dcrtc, + struct armada_plane *plane, struct armada_plane_work *work) { - struct armada_ovl_plane *dplane = data; + struct armada_ovl_plane *dplane = container_of(plane, struct armada_ovl_plane, base); armada_drm_crtc_update_regs(dcrtc, dplane->vbl.regs); armada_ovl_retire_fb(dplane, NULL); - - wake_up(&dplane->base.frame_wait); } static int @@ -162,9 +161,8 @@ armada_ovl_plane_update(struct drm_plane *plane, struct drm_crtc *crtc, dcrtc->base + LCD_SPU_SRAM_PARA1); } - wait_event_timeout(dplane->base.frame_wait, - list_empty(&dplane->vbl.update.node), - HZ/25); + if (armada_drm_plane_work_wait(&dplane->base, HZ / 25) == 0) + armada_drm_plane_work_cancel(dcrtc, &dplane->base); if (plane->fb != fb) { struct armada_gem_object *obj = drm_fb_obj(fb); @@ -255,7 +253,8 @@ armada_ovl_plane_update(struct drm_plane *plane, struct drm_crtc *crtc, } if (idx) { armada_reg_queue_end(dplane->vbl.regs, idx); - armada_drm_vbl_event_add(dcrtc, &dplane->vbl.update); + armada_drm_plane_work_queue(dcrtc, &dplane->base, + &dplane->vbl.work); } return 0; } @@ -270,14 +269,13 @@ static int armada_ovl_plane_disable(struct drm_plane *plane) return 0; dcrtc = drm_to_armada_crtc(dplane->base.base.crtc); - dcrtc->plane = NULL; - armada_drm_vbl_event_remove(dcrtc, &dplane->vbl.update); + armada_drm_plane_work_cancel(dcrtc, &dplane->base); + armada_drm_crtc_plane_disable(dcrtc, plane); + dcrtc->plane = NULL; dplane->ctrl0 = 0; - armada_drm_crtc_plane_disable(dcrtc, plane); - fb = xchg(&dplane->old_fb, NULL); if (fb) drm_framebuffer_unreference(fb); @@ -456,8 +454,7 @@ int armada_overlay_plane_create(struct drm_device *dev, unsigned long crtcs) return ret; } - armada_drm_vbl_event_init(&dplane->vbl.update, armada_ovl_plane_vbl, - dplane); + dplane->vbl.work.fn = armada_ovl_plane_work; ret = drm_universal_plane_init(dev, &dplane->base.base, crtcs, &armada_ovl_plane_funcs, |