linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: heiko@sntech.de (Heiko Stuebner)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2] drm/rockchip: create the fake mmap offset during gem creation
Date: Mon, 09 Nov 2015 20:50:43 +0100	[thread overview]
Message-ID: <4982827.0pnZflEOSR@phil> (raw)

Similarly to the equivalent exynos-fix in commit 48cf53f4343a
("drm/exynos: create a fake mmap offset with gem creation") the rockchip
drm driver also calls the drm_gem_create_mmap_offset fake-offset creation
on every invocation of rockchip_gem_dumb_map_offset.

Move that to the creation of the gem to only create that offset once.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
---
 drivers/gpu/drm/rockchip/rockchip_drm_gem.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c
index 4ab2f20..e50d113 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c
@@ -126,8 +126,14 @@ struct rockchip_gem_object *
 	if (ret)
 		goto err_free_rk_obj;
 
+	ret = drm_gem_create_mmap_offset(obj);
+	if (ret)
+		goto err_free_buf;
+
 	return rk_obj;
 
+err_free_buf:
+	rockchip_gem_free_buf(rk_obj);
 err_free_rk_obj:
 	kfree(rk_obj);
 	return ERR_PTR(ret);
@@ -196,7 +202,6 @@ int rockchip_gem_dumb_map_offset(struct drm_file *file_priv,
 				 uint64_t *offset)
 {
 	struct drm_gem_object *obj;
-	int ret;
 
 	obj = drm_gem_object_lookup(dev, file_priv, handle);
 	if (!obj) {
@@ -204,14 +209,9 @@ int rockchip_gem_dumb_map_offset(struct drm_file *file_priv,
 		return -EINVAL;
 	}
 
-	ret = drm_gem_create_mmap_offset(obj);
-	if (ret)
-		goto out;
-
 	*offset = drm_vma_node_offset_addr(&obj->vma_node);
 	DRM_DEBUG_KMS("offset = 0x%llx\n", *offset);
 
-out:
 	drm_gem_object_unreference_unlocked(obj);
 
 	return 0;
-- 
2.6.2

             reply	other threads:[~2015-11-09 19:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-09 19:50 Heiko Stuebner [this message]
2015-11-09 19:52 ` [PATCH 2/2] drm/rockchip: unset pgoff when mmap'ing gems Heiko Stuebner
2015-11-10  5:53   ` Mark yao
2015-11-10  6:17 ` [PATCH 1/2] drm/rockchip: create the fake mmap offset during gem creation Mark yao
2015-11-10  6:46   ` Heiko Stuebner
2015-11-10  9:26     ` Mark yao
2015-11-10  9:28       ` Heiko Stuebner
2015-11-10  9:38         ` Mark yao
2015-11-16 16:21   ` Daniel Vetter

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=4982827.0pnZflEOSR@phil \
    --to=heiko@sntech.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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;
as well as URLs for NNTP newsgroup(s).