drm/exynos: ipp: introduce last_buf_id
authorHyungwon Hwang <human.hwang@samsung.com>
Wed, 26 Aug 2015 02:11:07 +0000 (11:11 +0900)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Wed, 14 Dec 2016 04:47:49 +0000 (13:47 +0900)
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.

Signed-off-by: Hyungwon Hwang <human.hwang@samsung.com>
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
drivers/gpu/drm/exynos/exynos_drm_ipp.c
drivers/gpu/drm/exynos/exynos_drm_ipp.h

index 29249f7..a027914 100644 (file)
@@ -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
index d4f0b58..a09fc11 100644 (file)
@@ -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];
 };
 
 /*