From patchwork Thu Aug 8 04:39:35 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Inki Dae X-Patchwork-Id: 2840730 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 6855BBF535 for ; Thu, 8 Aug 2013 04:40:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 89E9E2033F for ; Thu, 8 Aug 2013 04:40:27 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id C65C520256 for ; Thu, 8 Aug 2013 04:40:26 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A38DDE7285 for ; Wed, 7 Aug 2013 21:40:26 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout1.samsung.com (mailout1.samsung.com [203.254.224.24]) by gabe.freedesktop.org (Postfix) with ESMTP id 7E229E6106; Wed, 7 Aug 2013 21:39:37 -0700 (PDT) Received: from epcpsbgr5.samsung.com (u145.gpu120.samsung.co.kr [203.254.230.145]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MR700I493LFVOL0@mailout1.samsung.com>; Thu, 08 Aug 2013 13:39:36 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [172.20.52.116]) by epcpsbgr5.samsung.com (EPCPMTA) with SMTP id 5F.BE.11618.80123025; Thu, 08 Aug 2013 13:39:36 +0900 (KST) X-AuditID: cbfee691-b7fef6d000002d62-8d-52032108d5b2 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 9C.BE.32250.80123025; Thu, 08 Aug 2013 13:39:36 +0900 (KST) Received: from daeinki-desktop.10.32.193.11 ([10.252.75.62]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MR700C5Q3M07T10@mmp1.samsung.com>; Thu, 08 Aug 2013 13:39:36 +0900 (KST) From: Inki Dae To: daniel@ffwll.ch Subject: [PATCH 1/4] drm/exynos: explicit store base gem object in dma_buf->priv Date: Thu, 08 Aug 2013 13:39:35 +0900 Message-id: <1375936775-20133-1-git-send-email-inki.dae@samsung.com> X-Mailer: git-send-email 1.7.5.4 In-reply-to: <009501ce93f0$529ce090$f7d6a1b0$%dae@samsung.com> References: <009501ce93f0$529ce090$f7d6a1b0$%dae@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrCLMWRmVeSWpSXmKPExsWyRsSkRJdDkTnI4MIiLYv/2yYyW1z5+p7N YtL9CSwWsydsZrI42/SG3YHVY++3BSwe97uPM3n0bVnFGMAcxWWTkpqTWZZapG+XwJXRvL6F peAhX0XPnIOsDYzbeboYOTkkBEwkWhdPY4KwxSQu3FvP1sXIxSEksJRR4sT888wwRYtOX2GF SCxilFjQdZIZwulmkvj9ZhIbSBWbgKrExBX3wWwRAWGJ118/s4MUMQtMYpRYtWoyUAcHh7BA gMTaDQkgNSxA9c8Xzgar5xVwkZg4YT/UGQoSv46sYgWxOQXsJK59vgB2hZCArUTHm/dgiyUE /rNJHL9zkh1ikIDEt8mHWEDmSwjISmw6AHW1pMTBFTdYJjAKL2BkWMUomlqQXFCclF5kqlec mFtcmpeul5yfu4kRGMKn/z2buIPx/gHrQ4zJQOMmMkuJJucDYyCvJN7Q2MzIwtTE1NjI3NKM NGElcV71FutAIYH0xJLU7NTUgtSi+KLSnNTiQ4xMHJxSDYx+czX1Nsw1eHrn5ZzLvDJ6ElOW vnRfKZb2sK15S2hoRmZWylNdu9z6O1f117cfdFLiPe88d1b+obf/JkemfAgSfjxV8/bkKKZ9 z3v0Pu3a1pNhtaR4u8nMVzZHYs/n9Lnv7jsuaN523Krr1FGxYw3xmX5bNfoiCm4LFizvblCb o/fcYv7jswVKLMUZiYZazEXFiQCxzUptdwIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrIIsWRmVeSWpSXmKPExsVy+t9jAV0OReYgg+v7lCz+b5vIbHHl63s2 i0n3J7BYzJ6wmcnibNMbdgdWj73fFrB43O8+zuTRt2UVYwBzVAOjTUZqYkpqkUJqXnJ+SmZe uq2Sd3C8c7ypmYGhrqGlhbmSQl5ibqqtkotPgK5bZg7QUiWFssScUqBQQGJxsZK+HaYJoSFu uhYwjRG6viFBcD1GBmggYQ1jRvP6FpaCh3wVPXMOsjYwbufpYuTkkBAwkVh0+gorhC0mceHe erYuRi4OIYFFjBILuk4yQzjdTBK/30xiA6liE1CVmLjiPpgtIiAs8frrZ3aQImaBSYwSq1ZN Burg4BAWCJBYuyEBpIYFqP75wtlg9bwCLhITJ+xngtimIPHryCqwzZwCdhLXPl9gBrGFBGwl Ot68Z57AyLuAkWEVo2hqQXJBcVJ6rqFecWJucWleul5yfu4mRnCEPJPawbiyweIQowAHoxIP b0cAU5AQa2JZcWXuIUYJDmYlEd6LxUAh3pTEyqrUovz4otKc1OJDjMlAV01klhJNzgdGb15J vKGxiZmRpZG5oYWRsTlpwkrivAdarQOFBNITS1KzU1MLUotgtjBxcEo1MNa9/WFrObWyyuGC 6Wr3nF0bs2Y9zTGJ9azLDjW+tNxz2aSLZ2ezJzoeiFaZ4WwnE32Fnf+jzRFRH9lTSyRaX1Rs 35vC91hJWXPi/ge/bQ7aPv46jXn++5df3F54+rH/iRJxflxZed/D8K7F7HAW+2Nciu8jP4vO +R4192ErC8+dcPWjuTkxX5VYijMSDbWYi4oTAU8xm2jUAgAA DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Cc: intel-gfx@lists.freedesktop.org, Kyungmin Park , dri-devel@lists.freedesktop.org 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 X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Inki Dae Signed-off-by: Kyungmin Park --- drivers/gpu/drm/exynos/exynos_drm_dmabuf.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_dmabuf.c b/drivers/gpu/drm/exynos/exynos_drm_dmabuf.c index 3cd56e1..fd76449 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dmabuf.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dmabuf.c @@ -22,6 +22,11 @@ struct exynos_drm_dmabuf_attachment { bool is_mapped; }; +static struct exynos_drm_gem_obj *dma_buf_to_obj(struct dma_buf *buf) +{ + return to_exynos_gem_obj(buf->priv); +} + static int exynos_gem_attach_dma_buf(struct dma_buf *dmabuf, struct device *dev, struct dma_buf_attachment *attach) @@ -63,7 +68,7 @@ static struct sg_table * enum dma_data_direction dir) { struct exynos_drm_dmabuf_attachment *exynos_attach = attach->priv; - struct exynos_drm_gem_obj *gem_obj = attach->dmabuf->priv; + struct exynos_drm_gem_obj *gem_obj = dma_buf_to_obj(attach->dmabuf); struct drm_device *dev = gem_obj->base.dev; struct exynos_drm_gem_buf *buf; struct scatterlist *rd, *wr; @@ -180,7 +185,7 @@ struct dma_buf *exynos_dmabuf_prime_export(struct drm_device *drm_dev, { struct exynos_drm_gem_obj *exynos_gem_obj = to_exynos_gem_obj(obj); - return dma_buf_export(exynos_gem_obj, &exynos_dmabuf_ops, + return dma_buf_export(obj, &exynos_dmabuf_ops, exynos_gem_obj->base.size, flags); } @@ -198,8 +203,7 @@ struct drm_gem_object *exynos_dmabuf_prime_import(struct drm_device *drm_dev, if (dma_buf->ops == &exynos_dmabuf_ops) { struct drm_gem_object *obj; - exynos_gem_obj = dma_buf->priv; - obj = &exynos_gem_obj->base; + obj = dma_buf->priv; /* is it from our device? */ if (obj->dev == drm_dev) {