From: "Ørjan Eide" <orjan.eide@arm.com>
To: linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
linux-rockchip@lists.infradead.org
Cc: djkurtz@chromium.org
Subject: [PATCH 1/2] drm: rockchip: Don't pass DRM fake offset to dma-api
Date: Thu, 16 Apr 2015 16:41:51 +0200 [thread overview]
Message-ID: <1429195312-25898-1-git-send-email-orjan.eide@arm.com> (raw)
Set vm_pgoff to 0 after using it to look up the GEM node, before passing
it on rockchip_gem_mmap_buf() where the offset must be from the start of
the buffer.
Passing in the fake offset currently works because the
dma_mmap_attrs implementation that is used for this device,
arm_iommu_mmap_attrs, ignores the offset completely.
Signed-off-by: Ørjan Eide <orjan.eide@arm.com>
---
drivers/gpu/drm/rockchip/rockchip_drm_gem.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c
index 7ca8799e..69f01c3 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c
@@ -94,6 +94,11 @@ int rockchip_gem_mmap(struct file *filp, struct vm_area_struct *vma)
return -EACCES;
}
+ /* Set vm_pgoff (used as a fake buffer offset by DRM) to 0 and map the
+ * whole buffer from the start.
+ */
+ vma->vm_pgoff = 0;
+
obj = container_of(node, struct drm_gem_object, vma_node);
ret = rockchip_gem_mmap_buf(obj, vma);
--
1.9.1
next reply other threads:[~2015-04-16 14:42 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-16 14:41 Ørjan Eide [this message]
2015-04-16 14:41 ` [PATCH 2/2] ARM: DMA: Use vm_pgoff for IOMMU mmap Ørjan Eide
2015-04-20 4:13 ` Daniel Kurtz
2015-04-18 16:55 ` [PATCH 1/2] drm: rockchip: Don't pass DRM fake offset to dma-api Heiko Stübner
2015-04-20 5:34 ` Mark yao
2015-04-20 5:44 ` Mark yao
2015-07-07 7:02 ` Daniel Kurtz
2015-04-20 4:13 ` Daniel Kurtz
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=1429195312-25898-1-git-send-email-orjan.eide@arm.com \
--to=orjan.eide@arm.com \
--cc=djkurtz@chromium.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rockchip@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
all inboxes | Powered by JetHome®