From: Hyungwon Hwang Date: Wed, 26 Aug 2015 02:11:07 +0000 (+0900) Subject: drm/exynos: ipp: introduce last_buf_id X-Git-Tag: submit/tizen/20150901.112943~9 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2af026584c81faa37f26b86713d6331ddf70e3f3;p=platform%2Fkernel%2Flinux-exynos.git drm/exynos: ipp: introduce last_buf_id There is no reason to tie the buf idx from userspace and the real HW DMA channel. So to separate them, the buf idx from userspace must be stored to return the idx when the processing is done. This patch introduces last_buf_id to store the current processing buf id for that purpose. Change-Id: I74dd0c4c1ba59d3b94e6532dade6b5744c36b860 Signed-off-by: Hyungwon Hwang --- diff --git a/drivers/gpu/drm/exynos/exynos_drm_ipp.c b/drivers/gpu/drm/exynos/exynos_drm_ipp.c index 0f387c9a8b50..2626cd07de3c 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_ipp.c +++ b/drivers/gpu/drm/exynos/exynos_drm_ipp.c @@ -625,6 +625,7 @@ static void ipp_clean_mem_nodes(struct drm_device *drm_dev, if (ret) DRM_ERROR("failed to put m_node.\n"); } + c_node->last_buf_id[ops] = -1; mutex_unlock(&c_node->mem_lock); } @@ -799,6 +800,8 @@ static int ipp_set_mem_node(struct exynos_drm_ippdrv *ippdrv, return -EFAULT; } + c_node->last_buf_id[m_node->ops_id] = m_node->buf_id; + /* set address and enable irq */ if (ops->set_addr) { ret = ops->set_addr(ippdrv->dev, &m_node->buf_info, @@ -1581,6 +1584,11 @@ void ipp_sched_event(struct work_struct *work) return; } + event_work->buf_id[EXYNOS_DRM_OPS_SRC] = + c_node->last_buf_id[EXYNOS_DRM_OPS_SRC]; + event_work->buf_id[EXYNOS_DRM_OPS_DST] = + c_node->last_buf_id[EXYNOS_DRM_OPS_DST]; + /* * IPP supports command thread, event thread synchronization. * If IPP close immediately from user land, then IPP make diff --git a/drivers/gpu/drm/exynos/exynos_drm_ipp.h b/drivers/gpu/drm/exynos/exynos_drm_ipp.h index d4f0b588220b..a09fc1152186 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_ipp.h +++ b/drivers/gpu/drm/exynos/exynos_drm_ipp.h @@ -62,6 +62,7 @@ struct drm_exynos_ipp_cmd_work { * @event_work: event work structure. * @state: state of command node. * @filp: associated file pointer. + * @last_buf_id: store the current processing frame buf id from userspace */ struct drm_exynos_ipp_cmd_node { struct list_head list; @@ -78,6 +79,7 @@ struct drm_exynos_ipp_cmd_node { struct drm_exynos_ipp_event_work *event_work; enum drm_exynos_ipp_state state; struct drm_file *filp; + unsigned int last_buf_id[EXYNOS_DRM_OPS_MAX]; }; /*