From patchwork Thu Mar 14 09:49:43 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Inki Dae X-Patchwork-Id: 2268761 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id CD8043FCF6 for ; Thu, 14 Mar 2013 09:49:59 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B4185E65D9 for ; Thu, 14 Mar 2013 02:49:59 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout4.samsung.com (mailout4.samsung.com [203.254.224.34]) by gabe.freedesktop.org (Postfix) with ESMTP id 4EC33E5D2F for ; Thu, 14 Mar 2013 02:49:46 -0700 (PDT) Received: from epcpsbgr1.samsung.com (u141.gpu120.samsung.co.kr [203.254.230.141]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MJN00ACR9YM9OD0@mailout4.samsung.com> for dri-devel@lists.freedesktop.org; Thu, 14 Mar 2013 18:49:44 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [203.254.230.42]) by epcpsbgr1.samsung.com (EPCPMTA) with SMTP id 86.A7.20872.83D91415; Thu, 14 Mar 2013 18:49:44 +0900 (KST) X-AuditID: cbfee68d-b7f786d000005188-f8-51419d3881d3 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 2B.3E.13494.83D91415; Thu, 14 Mar 2013 18:49:44 +0900 (KST) Received: from daeinki-desktop.10.32.193.11 ([10.90.8.53]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MJN00C5J9YWPG30@mmp1.samsung.com> for dri-devel@lists.freedesktop.org; Thu, 14 Mar 2013 18:49:44 +0900 (KST) From: Inki Dae To: airlied@linux.ie, dri-devel@lists.freedesktop.org Subject: [PATCH v2 4/7] drm/exynos: Clean up some G2D codes for readability Date: Thu, 14 Mar 2013 18:49:43 +0900 Message-id: <1363254583-11782-1-git-send-email-inki.dae@samsung.com> X-Mailer: git-send-email 1.7.4.1 In-reply-to: <1363165446-7482-1-git-send-email-inki.dae@samsung.com> References: <1363165446-7482-1-git-send-email-inki.dae@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrKLMWRmVeSWpSXmKPExsVy+t8zLV2LuY6BBksX6Vpc+fqezYHR4373 caYAxigum5TUnMyy1CJ9uwSujN7Ly1kK5ohX/P25kLGB8bxQFyMnh4SAicSts1sZIWwxiQv3 1rN1MXJxCAksY5S4N2c/UIIDrGjRKi2I+CJGiRnrnrFCOOuYJB5/nsYO0s0moCoxccV9NhBb RMBUomPSUhaQImaBbkaJ5w/+soIkhAW8Jfa1XGcGsVmAGqas/wYW5xVwkdjd1A91hoLEgntv 2UA2cwLF593nBAkLCThLdD3aBjZTQuA6m8Tc1r/sEHMEJL5NPsQCcamsxKYDzBBjJCUOrrjB MoFReAEjwypG0dSC5ILipPQiQ73ixNzi0rx0veT83E2MkCDs3cF4+4D1IcZkoHETmaVEk/OB QZxXEm9obGZkYWpiamxkbmlGmrCSOK9ai3WgkEB6YklqdmpqQWpRfFFpTmrxIUYmDk6pBkan pmddX7KO5Xx8VBB9e9NZdW/Z77yfP+koX5gt8C8j6Infx2CmB5uCeSVSSyZquTLzrrmdMv2W 0Te1TfonRCfzfXmmK8C1UPLyfYfF4e89ghLNXx3gdPj8T/hMib390xkf3sm6LHIt7fmytL7z G2OdaVuP1y+Z+HNSt4tmZW90jfMWZr+b+EGJpTgj0VCLuag4EQC4DH8EWAIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrEIsWRmVeSWpSXmKPExsVy+t9jAV2LuY6BBnOXqlhc+fqezYHR4373 caYAxqgGRpuM1MSU1CKF1Lzk/JTMvHRbJe/geOd4UzMDQ11DSwtzJYW8xNxUWyUXnwBdt8wc oLFKCmWJOaVAoYDE4mIlfTtME0JD3HQtYBojdH1DguB6jAzQQMI6xozey8tZCuaIV/z9uZCx gfG8UBcjB4eEgInEolVaXYycQKaYxIV769m6GLk4hAQWMUrMWPeMFcJZxyTx+PM0dpAqNgFV iYkr7rOB2CICphIdk5aygBQxC3QzSjx/8JcVJCEs4C2xr+U6M4jNAtQwZf03sDivgIvE7qZ+ Roh1ChIL7r1lA7mCEyg+7z4nSFhIwFmi69E2lgmMvAsYGVYxiqYWJBcUJ6XnGukVJ+YWl+al 6yXn525iBIf4M+kdjKsaLA4xCnAwKvHwRog6BgqxJpYVV+YeYpTgYFYS4fX0AgrxpiRWVqUW 5ccXleakFh9iTAY6aiKzlGhyPjD+8kriDY1NzIwsjcyMTcyNjUkTVhLnPdhqHSgkkJ5Ykpqd mlqQWgSzhYmDU6qBsbTsAyPbs1v+goVPf9wTlDfIbViqEc3sYhplw/HF2FB+lo3UKcUQVX+x TYtY5H61qF2y4mnIeye+c9H7yq1PeARz/TQ3tV2YHLt/UuClJK9I5vzdQa8TdzltXrqUmd+o Jsmy4NuGs6m/uLP3bT/wzqjMRJHBREW74LxwxtXLH9b7TVtXomqvxFKckWioxVxUnAgAJp0L RrUCAAA= DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Cc: kyungmin.park@samsung.com, sw0312.kim@samsung.com, YoungJun Cho X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org From: YoungJun Cho This patch just cleans up G2D codes for readability. For this, it changes the member of g2d_cmdlist_node, obj_type into buf_type. Changelog v2: - Revert irrelevant codes. Signed-off-by: YoungJun Cho Signed-off-by: Inki Dae Signed-off-by: Kyungmin Park --- drivers/gpu/drm/exynos/exynos_drm_g2d.c | 16 +++++++--------- 1 files changed, 7 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_g2d.c b/drivers/gpu/drm/exynos/exynos_drm_g2d.c index 1ff1144..7c1aac3 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_g2d.c +++ b/drivers/gpu/drm/exynos/exynos_drm_g2d.c @@ -131,13 +131,12 @@ struct g2d_cmdlist_userptr { bool in_pool; bool out_of_list; }; - struct g2d_cmdlist_node { struct list_head list; struct g2d_cmdlist *cmdlist; unsigned int map_nr; unsigned long handles[MAX_BUF_ADDR_NR]; - unsigned int obj_type[MAX_BUF_ADDR_NR]; + unsigned int buf_type[MAX_BUF_ADDR_NR]; dma_addr_t dma_addr; struct drm_exynos_pending_g2d_event *event; @@ -524,7 +523,7 @@ static int g2d_map_cmdlist_gem(struct g2d_data *g2d, offset = cmdlist->last - (i * 2 + 1); handle = cmdlist->data[offset]; - if (node->obj_type[i] == BUF_TYPE_GEM) { + if (node->buf_type[i] == BUF_TYPE_GEM) { addr = exynos_drm_gem_get_dma_addr(drm_dev, handle, file); if (IS_ERR(addr)) { @@ -568,7 +567,7 @@ static void g2d_unmap_cmdlist_gem(struct g2d_data *g2d, for (i = 0; i < node->map_nr; i++) { unsigned long handle = node->handles[i]; - if (node->obj_type[i] == BUF_TYPE_GEM) + if (node->buf_type[i] == BUF_TYPE_GEM) exynos_drm_gem_put_dma_addr(subdrv->drm_dev, handle, filp); else @@ -576,7 +575,7 @@ static void g2d_unmap_cmdlist_gem(struct g2d_data *g2d, false); node->handles[i] = 0; - node->obj_type[i] = 0; + node->buf_type[i] = 0; } node->map_nr = 0; @@ -642,7 +641,6 @@ static void g2d_runqueue_worker(struct work_struct *work) struct g2d_data *g2d = container_of(work, struct g2d_data, runqueue_work); - mutex_lock(&g2d->runqueue_mutex); clk_disable(g2d->gate_clk); pm_runtime_put_sync(g2d->dev); @@ -730,7 +728,7 @@ static int g2d_check_reg_offset(struct device *dev, reg_offset = (cmdlist->data[index] & ~0x7fffffff) >> 31; if (reg_offset) { - node->obj_type[i] = BUF_TYPE_USERPTR; + node->buf_type[i] = BUF_TYPE_USERPTR; cmdlist->data[index] &= ~G2D_BUF_USERPTR; } } @@ -752,8 +750,8 @@ static int g2d_check_reg_offset(struct device *dev, if (!for_addr) goto err; - if (node->obj_type[i] != BUF_TYPE_USERPTR) - node->obj_type[i] = BUF_TYPE_GEM; + if (node->buf_type[i] != BUF_TYPE_USERPTR) + node->buf_type[i] = BUF_TYPE_GEM; break; default: if (for_addr)