From: Yoichi Yuasa <yuasa@linux-mips.org>
To: alan@linux.intel.com
Cc: yuasa@linux-mips.org, linux-kernel@vger.kernel.org,
linux-fbdev@vger.kernel.org
Subject: [PATCH] gma500: Fix mmap frambuffer
Date: Thu, 15 Mar 2012 12:28:16 +0000 [thread overview]
Message-ID: <20120315212816.475b0b18.yuasa@linux-mips.org> (raw)
It cannot map correctly if page fault begins from a intermediate address.
Signed-off-by: Yoichi Yuasa <yuasa@linux-mips.org>
---
drivers/gpu/drm/gma500/framebuffer.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/gpu/drm/gma500/framebuffer.c b/drivers/gpu/drm/gma500/framebuffer.c
index be61673..5154493 100644
--- a/drivers/gpu/drm/gma500/framebuffer.c
+++ b/drivers/gpu/drm/gma500/framebuffer.c
@@ -158,7 +158,7 @@ static int psbfb_vm_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
unsigned long phys_addr = (unsigned long)dev_priv->stolen_base;
page_num = (vma->vm_end - vma->vm_start) >> PAGE_SHIFT;
- address = (unsigned long)vmf->virtual_address;
+ address = (unsigned long)vmf->virtual_address - (vmf->pgoff << PAGE_SHIFT);
vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
--
1.7.0.4
next reply other threads:[~2012-03-15 12:28 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-15 12:28 Yoichi Yuasa [this message]
2012-03-15 14:47 ` [PATCH] gma500: Fix mmap frambuffer Alan Cox
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=20120315212816.475b0b18.yuasa@linux-mips.org \
--to=yuasa@linux-mips.org \
--cc=alan@linux.intel.com \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.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).