diff options
author | Russell King <rmk+kernel@armlinux.org.uk> | 2017-07-08 10:16:52 +0100 |
---|---|---|
committer | Russell King <rmk+kernel@armlinux.org.uk> | 2017-12-08 12:19:44 +0000 |
commit | b972a80f447da0b69648c33c719fe3089a17dacc (patch) | |
tree | 08c9f5986cc70051199e5d5d6d03964a9c487c4e /drivers/gpu/drm/armada/armada_crtc.c | |
parent | a3f6a18f9a74b64209f8ab957dd94ade8bf5a7b2 (diff) |
drm/armada: move fb retirement into armada_plane_work
Both the primary and overlay planes retire framebuffers in a similar
manner; this can be consolidated by moving the retirement up to the
armada_plane_work layer.
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Diffstat (limited to 'drivers/gpu/drm/armada/armada_crtc.c')
-rw-r--r-- | drivers/gpu/drm/armada/armada_crtc.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/gpu/drm/armada/armada_crtc.c b/drivers/gpu/drm/armada/armada_crtc.c index be3fd82ef516..d1f4171966cc 100644 --- a/drivers/gpu/drm/armada/armada_crtc.c +++ b/drivers/gpu/drm/armada/armada_crtc.c @@ -24,7 +24,6 @@ struct armada_frame_work { struct armada_plane_work work; struct drm_pending_vblank_event *event; struct armada_regs regs[4]; - struct drm_framebuffer *old_fb; }; enum csc_mode { @@ -221,11 +220,16 @@ static void armada_drm_plane_work_call(struct armada_crtc *dcrtc, void (*fn)(struct armada_crtc *, struct armada_plane_work *)) { struct armada_plane *dplane = drm_to_armada_plane(work->plane); + struct drm_framebuffer *fb = work->old_fb; if (fn) fn(dcrtc, work); drm_crtc_vblank_put(&dcrtc->crtc); + /* Finally, queue the process-half of the cleanup. */ + if (fb) + armada_drm_queue_unref_work(dcrtc->crtc.dev, fb); + wake_up(&dplane->frame_wait); } @@ -287,8 +291,6 @@ static void armada_drm_crtc_finish_frame_work(struct armada_crtc *dcrtc, spin_unlock_irqrestore(&dev->event_lock, flags); } - /* Finally, queue the process-half of the cleanup. */ - __armada_drm_queue_unref_work(dcrtc->crtc.dev, fwork->old_fb); kfree(fwork); } @@ -339,7 +341,7 @@ static void armada_drm_crtc_finish_fb(struct armada_crtc *dcrtc, work = armada_drm_crtc_alloc_frame_work(dcrtc->crtc.primary); if (work) { - work->old_fb = fb; + work->work.old_fb = fb; if (armada_drm_plane_work_queue(dcrtc, &work->work) == 0) return; @@ -1031,7 +1033,7 @@ static int armada_drm_crtc_page_flip(struct drm_crtc *crtc, return -ENOMEM; work->event = event; - work->old_fb = dcrtc->crtc.primary->fb; + work->work.old_fb = dcrtc->crtc.primary->fb; i = armada_drm_crtc_calc_fb(fb, crtc->x, crtc->y, work->regs, dcrtc->interlaced); |