From patchwork Thu Aug 8 07:10:39 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 2840802 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 7550F9F479 for ; Thu, 8 Aug 2013 07:23:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A45242029B for ; Thu, 8 Aug 2013 07:23:21 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id BF52020299 for ; Thu, 8 Aug 2013 07:23:20 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AE197E7570 for ; Thu, 8 Aug 2013 00:23:20 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-ee0-f43.google.com (mail-ee0-f43.google.com [74.125.83.43]) by gabe.freedesktop.org (Postfix) with ESMTP id 1448CE7546 for ; Thu, 8 Aug 2013 00:11:05 -0700 (PDT) Received: by mail-ee0-f43.google.com with SMTP id e52so1326708eek.30 for ; Thu, 08 Aug 2013 00:11:05 -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=Xeen3EOmeRisafXB+pVGu2okV/sMeeJmgbxWR6piK9KMlS2uC7tS/yfIKBG8MmXyay WAcNBavs0snqir7+34L4+Iclgnl6n7x8LyKmuq/SDmhUtdoLSUozCCySxj2Tqxse7/n+ 7Y84mJi36tLrc5v26aCvZxtCFY34ZduR3VEEA= 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=YCOEBfsoNEB02ywZeZjCHI/l0oDIlNO5WyAqhsVq3vzeFftWuXDFfSiN1FWhRd6aE8 Z7/Zl66GWCOL3zJmYyBFVgyZYVtMRmnSfyuSt4tc8WMUZ3TC+dLSg296jPtonq2N598h Us37RF0DGft3B/YSVAJ5+jPKjroN2Cni8likxwjH+yyzbR7dRsUPhqwZC8vQtuWHs8P/ Au68iOcVrwFYbyAvSyLFqBVexjbCte07pe65WW29jUEH1QESTqH17Nckr+MdLny0/kul zRJCGpY/CtpS8xJcyQkCcWedwNwQis1RpF5YfB5iem+2b2Bp4uPbr9bdjqDVCSqcEivy ZclA== X-Gm-Message-State: ALoCoQna5REUzSSHJmBgBwnn/JmvqlUVGJ/g8EX+2MHNsuMzC7rjyrg2fe1lmxOLvaQSOgYVrAP4 X-Received: by 10.15.63.142 with SMTP id m14mr6691180eex.106.1375945865234; Thu, 08 Aug 2013 00:11:05 -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 m54sm16647369eex.2.2013.08.08.00.11.03 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 08 Aug 2013 00:11:04 -0700 (PDT) From: Daniel Vetter To: Dave Airlie Subject: [PATCH 4/5] drm/exynos: explicit store base gem object in dma_buf->priv Date: Thu, 8 Aug 2013 09:10:39 +0200 Message-Id: <1375945840-9784-5-git-send-email-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1375945840-9784-1-git-send-email-daniel.vetter@ffwll.ch> References: <1375945840-9784-1-git-send-email-daniel.vetter@ffwll.ch> Cc: Daniel Vetter , Intel Graphics Development , Kyungmin Park , DRI Development 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.1 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) {