diff options
author | Andrzej Hajda <a.hajda@samsung.com> | 2014-07-03 09:10:32 -0400 |
---|---|---|
committer | Inki Dae <daeinki@gmail.com> | 2014-08-03 03:52:18 -0400 |
commit | fb5ee01cfdce2a4debcaab7aeb94455d2ab29068 (patch) | |
tree | 57f15debed69eff5a2a60cc23dc21299ce40d2d4 | |
parent | 187d5edf1eaa8f6dc29f8a39fc10225d74a80d16 (diff) |
drm/exynos/ipp: simplify memory check function
The only thing function should check is if there are buffers in respective
queues.
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_ipp.c | 44 |
1 files changed, 10 insertions, 34 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_ipp.c b/drivers/gpu/drm/exynos/exynos_drm_ipp.c index 89ff7e34a6fb..b7ce14ec4ef8 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_ipp.c +++ b/drivers/gpu/drm/exynos/exynos_drm_ipp.c | |||
@@ -574,42 +574,18 @@ static void ipp_clean_cmd_node(struct ipp_context *ctx, | |||
574 | kfree(c_node); | 574 | kfree(c_node); |
575 | } | 575 | } |
576 | 576 | ||
577 | static int ipp_check_mem_list(struct drm_exynos_ipp_cmd_node *c_node) | 577 | static bool ipp_check_mem_list(struct drm_exynos_ipp_cmd_node *c_node) |
578 | { | 578 | { |
579 | struct drm_exynos_ipp_property *property = &c_node->property; | 579 | switch (c_node->property.cmd) { |
580 | struct drm_exynos_ipp_mem_node *m_node; | 580 | case IPP_CMD_WB: |
581 | struct list_head *head; | 581 | return !list_empty(&c_node->mem_list[EXYNOS_DRM_OPS_DST]); |
582 | int ret, i, count[EXYNOS_DRM_OPS_MAX] = { 0, }; | 582 | case IPP_CMD_OUTPUT: |
583 | 583 | return !list_empty(&c_node->mem_list[EXYNOS_DRM_OPS_SRC]); | |
584 | for_each_ipp_ops(i) { | 584 | case IPP_CMD_M2M: |
585 | /* source/destination memory list */ | 585 | default: |
586 | head = &c_node->mem_list[i]; | 586 | return !list_empty(&c_node->mem_list[EXYNOS_DRM_OPS_SRC]) && |
587 | 587 | !list_empty(&c_node->mem_list[EXYNOS_DRM_OPS_DST]); | |
588 | /* find memory node entry */ | ||
589 | list_for_each_entry(m_node, head, list) { | ||
590 | DRM_DEBUG_KMS("%s,count[%d]m_node[0x%x]\n", | ||
591 | i ? "dst" : "src", count[i], (int)m_node); | ||
592 | count[i]++; | ||
593 | } | ||
594 | } | 588 | } |
595 | |||
596 | DRM_DEBUG_KMS("min[%d]max[%d]\n", | ||
597 | min(count[EXYNOS_DRM_OPS_SRC], count[EXYNOS_DRM_OPS_DST]), | ||
598 | max(count[EXYNOS_DRM_OPS_SRC], count[EXYNOS_DRM_OPS_DST])); | ||
599 | |||
600 | /* | ||
601 | * M2M operations should be need paired memory address. | ||
602 | * so, need to check minimum count about src, dst. | ||
603 | * other case not use paired memory, so use maximum count | ||
604 | */ | ||
605 | if (ipp_is_m2m_cmd(property->cmd)) | ||
606 | ret = min(count[EXYNOS_DRM_OPS_SRC], | ||
607 | count[EXYNOS_DRM_OPS_DST]); | ||
608 | else | ||
609 | ret = max(count[EXYNOS_DRM_OPS_SRC], | ||
610 | count[EXYNOS_DRM_OPS_DST]); | ||
611 | |||
612 | return ret; | ||
613 | } | 589 | } |
614 | 590 | ||
615 | static struct drm_exynos_ipp_mem_node | 591 | static struct drm_exynos_ipp_mem_node |