From: heiko@sntech.de (Heiko Stuebner)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/2] drm/rockchip: unset pgoff when mmap'ing gems
Date: Mon, 09 Nov 2015 20:52:43 +0100 [thread overview]
Message-ID: <2793929.5WVauesvFQ@phil> (raw)
In-Reply-To: <4982827.0pnZflEOSR@phil>
Commit 371f0f085f629 ("ARM: 8426/1: dma-mapping: add missing range check
in dma_mmap()") introduced offset-checking for mappings, which collides
with the fake-offset the drm sets for gems.
Other drm-drivers set this offset to 0 before doing the mapping, so
this looks like the correct way to go for rockchip as well.
Fixes: 371f0f085f629 ("ARM: 8426/1: dma-mapping: add missing range check in dma_mmap()")
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
---
This patch is definitly necessary to keep the rockchip-drm working
with kernel 4.4.
drivers/gpu/drm/rockchip/rockchip_drm_gem.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c
index e50d113..e9bc188 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c
@@ -68,6 +68,7 @@ static int rockchip_drm_gem_object_mmap(struct drm_gem_object *obj,
* VM_PFNMAP flag that was set by drm_gem_mmap_obj()/drm_gem_mmap().
*/
vma->vm_flags &= ~VM_PFNMAP;
+ vma->vm_pgoff = 0;
ret = dma_mmap_attrs(drm->dev, vma, rk_obj->kvaddr, rk_obj->dma_addr,
obj->size, &rk_obj->dma_attrs);
--
2.6.2
next prev parent reply other threads:[~2015-11-09 19:52 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-09 19:50 [PATCH 1/2] drm/rockchip: create the fake mmap offset during gem creation Heiko Stuebner
2015-11-09 19:52 ` Heiko Stuebner [this message]
2015-11-10 5:53 ` [PATCH 2/2] drm/rockchip: unset pgoff when mmap'ing gems 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=2793929.5WVauesvFQ@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).