Commit fb5ee01c authored by Andrzej Hajda's avatar Andrzej Hajda Committed by Inki Dae

drm/exynos/ipp: simplify memory check function

The only thing function should check is if there are buffers in respective
queues.
Signed-off-by: default avatarAndrzej Hajda <a.hajda@samsung.com>
Signed-off-by: default avatarInki Dae <inki.dae@samsung.com>
parent 187d5edf
...@@ -574,42 +574,18 @@ static void ipp_clean_cmd_node(struct ipp_context *ctx, ...@@ -574,42 +574,18 @@ static void ipp_clean_cmd_node(struct ipp_context *ctx,
kfree(c_node); kfree(c_node);
} }
static int ipp_check_mem_list(struct drm_exynos_ipp_cmd_node *c_node) static bool ipp_check_mem_list(struct drm_exynos_ipp_cmd_node *c_node)
{ {
struct drm_exynos_ipp_property *property = &c_node->property; switch (c_node->property.cmd) {
struct drm_exynos_ipp_mem_node *m_node; case IPP_CMD_WB:
struct list_head *head; return !list_empty(&c_node->mem_list[EXYNOS_DRM_OPS_DST]);
int ret, i, count[EXYNOS_DRM_OPS_MAX] = { 0, }; case IPP_CMD_OUTPUT:
return !list_empty(&c_node->mem_list[EXYNOS_DRM_OPS_SRC]);
for_each_ipp_ops(i) { case IPP_CMD_M2M:
/* source/destination memory list */ default:
head = &c_node->mem_list[i]; return !list_empty(&c_node->mem_list[EXYNOS_DRM_OPS_SRC]) &&
!list_empty(&c_node->mem_list[EXYNOS_DRM_OPS_DST]);
/* find memory node entry */
list_for_each_entry(m_node, head, list) {
DRM_DEBUG_KMS("%s,count[%d]m_node[0x%x]\n",
i ? "dst" : "src", count[i], (int)m_node);
count[i]++;
}
} }
DRM_DEBUG_KMS("min[%d]max[%d]\n",
min(count[EXYNOS_DRM_OPS_SRC], count[EXYNOS_DRM_OPS_DST]),
max(count[EXYNOS_DRM_OPS_SRC], count[EXYNOS_DRM_OPS_DST]));
/*
* M2M operations should be need paired memory address.
* so, need to check minimum count about src, dst.
* other case not use paired memory, so use maximum count
*/
if (ipp_is_m2m_cmd(property->cmd))
ret = min(count[EXYNOS_DRM_OPS_SRC],
count[EXYNOS_DRM_OPS_DST]);
else
ret = max(count[EXYNOS_DRM_OPS_SRC],
count[EXYNOS_DRM_OPS_DST]);
return ret;
} }
static struct drm_exynos_ipp_mem_node static struct drm_exynos_ipp_mem_node
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment