Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Inki Dae <inki.dae@samsung.com>
To: daniel@ffwll.ch
Cc: Inki Dae <inki.dae@samsung.com>,
	intel-gfx@lists.freedesktop.org,
	Kyungmin Park <kyungmin.park@samsung.com>,
	dri-devel@lists.freedesktop.org
Subject: [PATCH 1/4] drm/exynos: explicit store base gem object in dma_buf->priv
Date: Thu, 08 Aug 2013 13:39:35 +0900	[thread overview]
Message-ID: <1375936775-20133-1-git-send-email-inki.dae@samsung.com> (raw)
In-Reply-To: <009501ce93f0$529ce090$f7d6a1b0$%dae@samsung.com>

Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
 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) {
-- 
1.7.5.4

  reply	other threads:[~2013-08-08  4:39 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-07  9:15 [PATCH 0/3] Small i915/exynos prime cleanup Daniel Vetter
2013-08-07  9:15 ` [PATCH 1/3] drm: use common drm_gem_dmabuf_release in i915/exynos drivers Daniel Vetter
2013-08-07  9:37   ` [Intel-gfx] " Chris Wilson
2013-08-07  9:40   ` Inki Dae
2013-08-07  9:55     ` Daniel Vetter
2013-08-07 10:18       ` Joonyoung Shim
2013-08-07 10:21         ` Daniel Vetter
2013-08-07 10:29           ` Joonyoung Shim
2013-08-07 12:01           ` Inki Dae
2013-08-07 12:07             ` Daniel Vetter
2013-08-07 12:37               ` Inki Dae
2013-08-07 23:21                 ` Daniel Vetter
2013-08-08  4:32                   ` Inki Dae
2013-08-08  4:39                     ` Inki Dae [this message]
2013-08-08  4:56                       ` [PATCH 1/4] drm/exynos: explicit store base gem object in dma_buf->priv Inki Dae
2013-08-08  6:58                         ` Daniel Vetter
2013-08-08  6:31                     ` [PATCH 1/3] drm: use common drm_gem_dmabuf_release in i915/exynos drivers Daniel Vetter
2013-08-07  9:15 ` [PATCH 2/3] drm/i915: unpin backing storage in dmabuf_unmap Daniel Vetter
2013-08-07  9:19   ` Daniel Vetter
2013-08-07  9:29   ` [Intel-gfx] " Chris Wilson
2013-08-07  9:49     ` Daniel Vetter
2013-08-07 10:09       ` [PATCH 1/2] " Daniel Vetter
2013-08-07 10:09         ` [PATCH 2/2] drm/i915: no interruptible locking for dma_buf->map Daniel Vetter
2013-08-07 10:30           ` Chris Wilson
2013-08-07 10:49             ` Daniel Vetter
2013-08-07 10:40         ` [PATCH 1/2] drm/i915: unpin backing storage in dmabuf_unmap Maarten Lankhorst
2013-08-08  0:50         ` Konrad Rzeszutek Wilk
2013-08-08  1:20           ` Chris Wilson
2013-08-07  9:15 ` [PATCH 3/3] drm/i915: explicit store base gem object in dma_buf->priv Daniel Vetter
2013-08-07  9:43   ` Chris Wilson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1375936775-20133-1-git-send-email-inki.dae@samsung.com \
    --to=inki.dae@samsung.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=kyungmin.park@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox