From patchwork Wed Aug 14 22:02:31 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 2844810 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 11E539F2F4 for ; Wed, 14 Aug 2013 22:07:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 431B720508 for ; Wed, 14 Aug 2013 22:07:27 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 6C3E2204FE for ; Wed, 14 Aug 2013 22:07:26 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2C182E6C0C for ; Wed, 14 Aug 2013 15:07:26 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-ee0-f49.google.com (mail-ee0-f49.google.com [74.125.83.49]) by gabe.freedesktop.org (Postfix) with ESMTP id 7B2DFE63C4 for ; Wed, 14 Aug 2013 15:03:02 -0700 (PDT) Received: by mail-ee0-f49.google.com with SMTP id d41so10439eek.36 for ; Wed, 14 Aug 2013 15:03:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=1vFNIZiEM8gL05I9MFTNmxz/VyCVlVkGeEmvSiFQvmw=; b=eb0i3uOjU47gA9StA/hBuyOjIcXCwoj1I+SgWmBoFn182rEycYE+GrlRFWTPAZ6qoC XlfEYbwEBTbCgRl1qMuiUf+36JDZuN7s3e6wzsp0IpobhiC1B3XkP3m+EJi7j6eqRk88 zaVQdB4UaYDGTM2OQK1rWftRmX00tyFS0xWAo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=1vFNIZiEM8gL05I9MFTNmxz/VyCVlVkGeEmvSiFQvmw=; b=MCDkWmdZ3GI/9nDW5x5kwk8s7RBKcYzChWV8lUScjd3Rfj7nkiR8GmL6/B6ne+Yl7T o9zfCvM/jt8Qb2tNBsM9bRt8Vw/Rcexstp5/lleqiZI2HRS8p32HT845x0qDyLC975dG jbPOrb2Eg58XtHAWXei29Nn8mHede5frZFqFaGxFIbNvZC3PKtZ9lPTuVPC7mSKYoAi7 1bd5JnKXIMPvOz/n/OKazUWVj5EkvyoyNNUgxqzMQ7alrRf56ke9+x7t6YnirAETn4cW sAnqWA7gQSPl0g4e//DWI+0QSioavZ8y5JyPUbledUykjMxQQfOyZjRVlbEm+aVu6cFk O6ZQ== X-Gm-Message-State: ALoCoQlnwfykBufKcpq74RblaSma1Hj7vEiuuPnG+SO8DRx0d3SrItn2fqeNY44kZNWVf3YPW+ka X-Received: by 10.15.43.13 with SMTP id w13mr17279368eev.37.1376517781708; Wed, 14 Aug 2013 15:03:01 -0700 (PDT) Received: from aaron.ffwll.local (178-83-130-250.dynamic.hispeed.ch. [178.83.130.250]) by mx.google.com with ESMTPSA id m54sm78874820eex.2.2013.08.14.15.03.00 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 14 Aug 2013 15:03:00 -0700 (PDT) From: Daniel Vetter To: Intel Graphics Development , DRI Development Subject: [PATCH 02/20] drm/exynos: explicit store base gem object in dma_buf->priv Date: Thu, 15 Aug 2013 00:02:31 +0200 Message-Id: <1376517769-7171-3-git-send-email-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1376517769-7171-1-git-send-email-daniel.vetter@ffwll.ch> References: <1376517769-7171-1-git-send-email-daniel.vetter@ffwll.ch> Cc: Daniel Vetter , Kyungmin Park 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=-6.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,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 From: Inki Dae Signed-off-by: Inki Dae Signed-off-by: Kyungmin Park Signed-off-by: Daniel Vetter --- drivers/gpu/drm/exynos/exynos_drm_dmabuf.c | 12 ++++++++---- 1 file 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) {