drm: Create drm_send_event helpers
Use them in the core vblank code and exynos/vmwgfx drivers. Note that the difference between wake_up_all and _interruptible in vmwgfx doesn't matter since the only waiter is the core code in drm_fops.c. And that is interruptible. v2: Adjust existing kerneldoc too. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> (v1) Acked-by: Daniel Stone <daniels@collabora.com> Cc: Alex Deucher <alexander.deucher@amd.com> Cc: Thomas Hellstrom <thellstrom@vmware.com> Cc: Inki Dae <inki.dae@samsung.com> Link: http://patchwork.freedesktop.org/patch/msgid/1452548477-15905-6-git-send-email-daniel.vetter@ffwll.ch Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> [danvet: Squash in compile fixup, spotted by 0-day.] Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
@@ -880,7 +880,6 @@ static void g2d_finish_event(struct g2d_data *g2d, u32 cmdlist_no)
|
||||
struct g2d_runqueue_node *runqueue_node = g2d->runqueue_node;
|
||||
struct drm_exynos_pending_g2d_event *e;
|
||||
struct timeval now;
|
||||
unsigned long flags;
|
||||
|
||||
if (list_empty(&runqueue_node->event_list))
|
||||
return;
|
||||
@@ -893,10 +892,7 @@ static void g2d_finish_event(struct g2d_data *g2d, u32 cmdlist_no)
|
||||
e->event.tv_usec = now.tv_usec;
|
||||
e->event.cmdlist_no = cmdlist_no;
|
||||
|
||||
spin_lock_irqsave(&drm_dev->event_lock, flags);
|
||||
list_move_tail(&e->base.link, &e->base.file_priv->event_list);
|
||||
wake_up_interruptible(&e->base.file_priv->event_wait);
|
||||
spin_unlock_irqrestore(&drm_dev->event_lock, flags);
|
||||
drm_send_event(drm_dev, &e->base);
|
||||
}
|
||||
|
||||
static irqreturn_t g2d_irq_handler(int irq, void *dev_id)
|
||||
|
@@ -1407,7 +1407,6 @@ static int ipp_send_event(struct exynos_drm_ippdrv *ippdrv,
|
||||
struct drm_exynos_ipp_send_event *e;
|
||||
struct list_head *head;
|
||||
struct timeval now;
|
||||
unsigned long flags;
|
||||
u32 tbuf_id[EXYNOS_DRM_OPS_MAX] = {0, };
|
||||
int ret, i;
|
||||
|
||||
@@ -1520,10 +1519,7 @@ static int ipp_send_event(struct exynos_drm_ippdrv *ippdrv,
|
||||
for_each_ipp_ops(i)
|
||||
e->event.buf_id[i] = tbuf_id[i];
|
||||
|
||||
spin_lock_irqsave(&drm_dev->event_lock, flags);
|
||||
list_move_tail(&e->base.link, &e->base.file_priv->event_list);
|
||||
wake_up_interruptible(&e->base.file_priv->event_wait);
|
||||
spin_unlock_irqrestore(&drm_dev->event_lock, flags);
|
||||
drm_send_event(drm_dev, &e->base);
|
||||
mutex_unlock(&c_node->event_lock);
|
||||
|
||||
DRM_DEBUG_KMS("done cmd[%d]prop_id[%d]buf_id[%d]\n",
|
||||
|
Reference in New Issue
Block a user