summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/armada
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@armlinux.org.uk>2017-07-08 10:16:53 +0100
committerRussell King <rmk+kernel@armlinux.org.uk>2017-12-08 12:19:49 +0000
commiteb19be5bbe2aaf84cb347ca2a07ec19f2b92594f (patch)
tree2cd19d1300ef04f2f99e6d45cfedda8adafb6450 /drivers/gpu/drm/armada
parentb972a80f447da0b69648c33c719fe3089a17dacc (diff)
drm/armada: move event sending into armada_plane_work
Move the sending of events into the armada_plane_work structure, and combine the processing in armada_drm_plane_work_call(). Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Diffstat (limited to 'drivers/gpu/drm/armada')
-rw-r--r--drivers/gpu/drm/armada/armada_crtc.c27
-rw-r--r--drivers/gpu/drm/armada/armada_crtc.h1
2 files changed, 14 insertions, 14 deletions
diff --git a/drivers/gpu/drm/armada/armada_crtc.c b/drivers/gpu/drm/armada/armada_crtc.c
index d1f4171966cc..b043766c416c 100644
--- a/drivers/gpu/drm/armada/armada_crtc.c
+++ b/drivers/gpu/drm/armada/armada_crtc.c
@@ -22,7 +22,6 @@
struct armada_frame_work {
struct armada_plane_work work;
- struct drm_pending_vblank_event *event;
struct armada_regs regs[4];
};
@@ -220,15 +219,24 @@ 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_pending_vblank_event *event = work->event;
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);
+ if (event || fb) {
+ struct drm_device *dev = dcrtc->crtc.dev;
+ unsigned long flags;
+
+ spin_lock_irqsave(&dev->event_lock, flags);
+ if (event)
+ drm_crtc_send_vblank_event(&dcrtc->crtc, event);
+ if (fb)
+ __armada_drm_queue_unref_work(dev, fb);
+ spin_unlock_irqrestore(&dev->event_lock, flags);
+ }
wake_up(&dplane->frame_wait);
}
@@ -281,15 +289,6 @@ static void armada_drm_crtc_finish_frame_work(struct armada_crtc *dcrtc,
struct armada_plane_work *work)
{
struct armada_frame_work *fwork = container_of(work, struct armada_frame_work, work);
- unsigned long flags;
-
- if (fwork->event) {
- struct drm_device *dev = dcrtc->crtc.dev;
-
- spin_lock_irqsave(&dev->event_lock, flags);
- drm_crtc_send_vblank_event(&dcrtc->crtc, fwork->event);
- spin_unlock_irqrestore(&dev->event_lock, flags);
- }
kfree(fwork);
}
@@ -1032,7 +1031,7 @@ static int armada_drm_crtc_page_flip(struct drm_crtc *crtc,
if (!work)
return -ENOMEM;
- work->event = event;
+ work->work.event = event;
work->work.old_fb = dcrtc->crtc.primary->fb;
i = armada_drm_crtc_calc_fb(fb, crtc->x, crtc->y, work->regs,
diff --git a/drivers/gpu/drm/armada/armada_crtc.h b/drivers/gpu/drm/armada/armada_crtc.h
index b40db72c61d8..4cdd2f0eabd9 100644
--- a/drivers/gpu/drm/armada/armada_crtc.h
+++ b/drivers/gpu/drm/armada/armada_crtc.h
@@ -40,6 +40,7 @@ struct armada_plane_work {
void (*cancel)(struct armada_crtc *, struct armada_plane_work *);
struct drm_plane *plane;
struct drm_framebuffer *old_fb;
+ struct drm_pending_vblank_event *event;
};
struct armada_plane_state {