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: 2844811 Return-Path: X-Original-To: patchwork-intel-gfx@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 50F649F2F4 for ; Wed, 14 Aug 2013 22:08:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3D3FD20508 for ; Wed, 14 Aug 2013 22:08:11 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 69338204FE for ; Wed, 14 Aug 2013 22:08:10 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 52C61E6C1C for ; Wed, 14 Aug 2013 15:08:10 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-ee0-f44.google.com (mail-ee0-f44.google.com [74.125.83.44]) by gabe.freedesktop.org (Postfix) with ESMTP id 86075E6745 for ; Wed, 14 Aug 2013 15:03:02 -0700 (PDT) Received: by mail-ee0-f44.google.com with SMTP id b47so10994eek.31 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=Y0SmnT1YZlBTuJ6Uc0Yr0R7mcXUw+2BtAHfkVBx6pjf5eiPYshMiBGplxCGM690NkY XZQVHUapsdPKItnBDxD6q5z/M1USQDWPog+m6dSTNBX1VqAsSVyDKw2zM56ZQSTxFIOB QiVyICzJ88IgxpfcsfmrtpmFgerte77kVNJ4V9x5HIH10SkeQLFsXC2FCFzCZEu0pBOR NUHG3Prpwc6t5MAA0OOPMCItw4Wblvchba5SlPdqw01tKG1gQzU74wew/sqzdDFUtWAD y73/pkHKFTPQrPiiBxKP29QA2ax/bB832Gsb13NJ+4tM5tl41coPb0vCfyJLHzxqJS7V DXeA== X-Gm-Message-State: ALoCoQmgxDxLzMjPnYuD6ddbbOqDElkCcy/W1uhJkfwUv5mY8f/+Hjytd7485Tp80PBUeOAW0CPW 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 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: Inki Dae , Daniel Vetter , Kyungmin Park Subject: [Intel-gfx] [PATCH 02/20] drm/exynos: explicit store base gem object in dma_buf->priv X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=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) {