drm/exynos: ipp: introduce last_buf_id 68/46768/3
authorHyungwon Hwang <human.hwang@samsung.com>
Wed, 26 Aug 2015 02:11:07 +0000 (11:11 +0900)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Thu, 27 Aug 2015 09:53:25 +0000 (02:53 -0700)
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 <human.hwang@samsung.com>
drivers/gpu/drm/exynos/exynos_drm_ipp.c
drivers/gpu/drm/exynos/exynos_drm_ipp.h

index 0f387c9a8b508a91eb08de6e6097c0efde791a50..2626cd07de3cdf03cc2afa26624298e8eeeea76a 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 d4f0b588220b82e8ede44b50bf73edbfcc8db96c..a09fc1152186de297b10ba0e4475a110f181fb94 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];
 };
 
 /*