mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrzej Hajda <a.hajda@samsung.com>
To: Inki Dae <inki.dae@samsung.com>
Cc: Andrzej Hajda <a.hajda@samsung.com>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Joonyoung Shim <jy0922.shim@samsung.com>,
	Seung-Woo Kim <sw0312.kim@samsung.com>,
	Kyungmin Park <kyungmin.park@samsung.com>,
	dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org (open list),
	linux-samsung-soc@vger.kernel.org (moderated list:ARM/S5P EXYNOS
	AR...)
Subject: [PATCH 07/12] drm/exynos/ipp: simplify memory check function
Date: Thu, 03 Jul 2014 15:10:32 +0200	[thread overview]
Message-ID: <1404393037-17299-8-git-send-email-a.hajda@samsung.com> (raw)
In-Reply-To: <1404393037-17299-1-git-send-email-a.hajda@samsung.com>

The only thing function should check is if there are buffers in respective
queues.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
---
 drivers/gpu/drm/exynos/exynos_drm_ipp.c | 44 ++++++++-------------------------
 1 file 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 89ff7e3..b7ce14e 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,
 	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;
-	struct drm_exynos_ipp_mem_node *m_node;
-	struct list_head *head;
-	int ret, i, count[EXYNOS_DRM_OPS_MAX] = { 0, };
-
-	for_each_ipp_ops(i) {
-		/* source/destination memory list */
-		head = &c_node->mem_list[i];
-
-		/* 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]++;
-		}
+	switch (c_node->property.cmd) {
+	case IPP_CMD_WB:
+		return !list_empty(&c_node->mem_list[EXYNOS_DRM_OPS_DST]);
+	case IPP_CMD_OUTPUT:
+		return !list_empty(&c_node->mem_list[EXYNOS_DRM_OPS_SRC]);
+	case IPP_CMD_M2M:
+	default:
+		return !list_empty(&c_node->mem_list[EXYNOS_DRM_OPS_SRC]) &&
+		       !list_empty(&c_node->mem_list[EXYNOS_DRM_OPS_DST]);
 	}
-
-	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
-- 
1.9.1


  parent reply	other threads:[~2014-07-03 13:12 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-03 13:10 [PATCH 00/12] drm/exynos/ipp: image post processing improvements, part three Andrzej Hajda
2014-07-03 13:10 ` [PATCH 01/12] drm/exynos/ipp: remove type casting Andrzej Hajda
2014-07-03 13:10 ` [PATCH 02/12] drm/exynos/ipp: remove unused field from exynos_drm_ipp_private Andrzej Hajda
2014-07-03 13:10 ` [PATCH 03/12] drm/exynos/ipp: remove struct exynos_drm_ipp_private Andrzej Hajda
2014-07-03 13:10 ` [PATCH 04/12] drm/exynos/ipp: correct address type Andrzej Hajda
2014-07-03 13:10 ` [PATCH 05/12] drm/exynos/ipp: remove temporary variable Andrzej Hajda
2014-07-03 13:10 ` [PATCH 06/12] drm/exynos/ipp: remove incorrect checks of list_first_entry result Andrzej Hajda
2014-07-03 13:10 ` Andrzej Hajda [this message]
2014-07-03 13:10 ` [PATCH 08/12] drm/exynos/ipp: remove useless registration checks Andrzej Hajda
2014-07-03 13:10 ` [PATCH 09/12] drm/exynos/ipp: simplify ipp_find_obj Andrzej Hajda
2014-07-03 13:10 ` [PATCH 10/12] drm/exynos/ipp: remove redundant messages Andrzej Hajda
2014-07-03 13:10 ` [PATCH 11/12] drm/exynos/ipp: simplify ipp_create_id Andrzej Hajda
2014-07-03 13:10 ` [PATCH 12/12] drm/exynos/ipp: simplify ipp_find_driver Andrzej Hajda
2014-07-09 14:47 ` [PATCH 00/12] drm/exynos/ipp: image post processing improvements, part three Inki Dae
2014-07-21  9:23   ` Andrzej Hajda
2014-07-22  0:54     ` Inki Dae
2014-07-22 13:42 ` Inki Dae

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1404393037-17299-8-git-send-email-a.hajda@samsung.com \
    --to=a.hajda@samsung.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=inki.dae@samsung.com \
    --cc=jy0922.shim@samsung.com \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=sw0312.kim@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®