From: Peter Griffin <peter.griffin@linaro.org>
To: linux-kernel@vger.kernel.org
Cc: linaro-kernel@lists.linaro.org, Arnd Bergmann <arnd@arndb.de>,
Peter Griffin <peter.griffin@linaro.org>,
Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>,
Tomi Valkeinen <tomi.valkeinen@ti.com>,
linux-fbdev@vger.kernel.org, linux-omap@vger.kernel.org
Subject: [PATCH 13/13] video: omap: allow building on !MMU
Date: Thu, 24 Apr 2014 12:28:29 +0000 [thread overview]
Message-ID: <1398342509-10243-14-git-send-email-peter.griffin@linaro.org> (raw)
In-Reply-To: <1398342509-10243-1-git-send-email-peter.griffin@linaro.org>
From: Arnd Bergmann <arnd@arndb.de>
The omap lcdc driver has an elaborate mmap_kern function
to map the frame buffer into kernel address space as
write-combined. This uses functions that are only available
on MMU-enabled builds.
It does seem equivalent to ioremap_wc though, so we should
be able to just use that instead.
This patch is build-tested only, it needs to be run on real
hardware before applying.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Peter Griffin <peter.griffin@linaro.org>
Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: linux-fbdev@vger.kernel.org
Cc: linux-omap@vger.kernel.org
---
drivers/video/fbdev/omap/lcdc.c | 28 +++++-----------------------
1 file changed, 5 insertions(+), 23 deletions(-)
diff --git a/drivers/video/fbdev/omap/lcdc.c b/drivers/video/fbdev/omap/lcdc.c
index b52f625..40e8200 100644
--- a/drivers/video/fbdev/omap/lcdc.c
+++ b/drivers/video/fbdev/omap/lcdc.c
@@ -613,29 +613,11 @@ static void lcdc_dma_handler(u16 status, void *data)
static int mmap_kern(void)
{
- struct vm_struct *kvma;
- struct vm_area_struct vma;
- pgprot_t pgprot;
- unsigned long vaddr;
-
- kvma = get_vm_area(lcdc.vram_size, VM_IOREMAP);
- if (kvma = NULL) {
- dev_err(lcdc.fbdev->dev, "can't get kernel vm area\n");
+ void __iomem *vaddr;
+
+ vaddr = ioremap_wc(lcdc.vram_phys, lcdc.vram_size);
+ if (!vaddr)
return -ENOMEM;
- }
- vma.vm_mm = &init_mm;
-
- vaddr = (unsigned long)kvma->addr;
- vma.vm_start = vaddr;
- vma.vm_end = vaddr + lcdc.vram_size;
-
- pgprot = pgprot_writecombine(pgprot_kernel);
- if (io_remap_pfn_range(&vma, vaddr,
- lcdc.vram_phys >> PAGE_SHIFT,
- lcdc.vram_size, pgprot) < 0) {
- dev_err(lcdc.fbdev->dev, "kernel mmap for FB memory failed\n");
- return -EAGAIN;
- }
lcdc.vram_virt = (void *)vaddr;
@@ -644,7 +626,7 @@ static int mmap_kern(void)
static void unmap_kern(void)
{
- vunmap(lcdc.vram_virt);
+ iounmap(lcdc.vram_virt);
}
static int alloc_palette_ram(void)
--
1.7.9.5
next prev parent reply other threads:[~2014-04-24 12:28 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1398342509-10243-1-git-send-email-peter.griffin@linaro.org>
2014-04-24 12:28 ` [PATCH 01/13] video: sh_mobile_lcdcfb depends on meram Peter Griffin
2014-04-24 12:28 ` [PATCH 02/13] video: omap2dss: fix LPAE warnings Peter Griffin
2014-04-24 12:28 ` [PATCH 03/13] video: clarify I2C dependencies Peter Griffin
2014-04-24 12:32 ` Russell King - ARM Linux
2014-04-24 12:48 ` Arnd Bergmann
2014-04-24 12:28 ` [PATCH 04/13] video/omap: fix modular build Peter Griffin
2014-04-24 12:28 ` [PATCH 05/13] video/mbx: fix building debugfs support Peter Griffin
2014-04-24 12:28 ` [PATCH 06/13] video: export fb_prepare_logo Peter Griffin
2014-04-24 12:28 ` [PATCH 07/13] video: atmel needs FB_BACKLIGHT Peter Griffin
2014-04-24 12:28 ` [PATCH 08/13] video/backlight: LM3630A needs PWM Peter Griffin
2014-04-24 16:45 ` Bryan Wu
2014-04-25 9:00 ` Jingoo Han
2014-04-28 10:14 ` Lee Jones
2014-04-24 12:28 ` [PATCH 09/13] video/backlight: LP8788 " Peter Griffin
2014-04-24 16:45 ` Bryan Wu
2014-04-24 22:42 ` Milo Kim
2014-04-25 8:54 ` Jingoo Han
2014-04-28 10:16 ` Lee Jones
2014-04-24 12:28 ` [PATCH 10/13] video/pxa: LCD_CORGI needs BACKLIGHT_CLASS_DEVICE Peter Griffin
2014-04-24 16:46 ` Bryan Wu
2014-04-25 8:58 ` Jingoo Han
2014-04-28 10:15 ` Lee Jones
2014-04-24 12:28 ` [PATCH 11/13] video/nuc900: allow modular build Peter Griffin
2014-04-24 12:28 ` [PATCH 12/13] video/backlight: LP855X needs PWM Peter Griffin
2014-04-24 16:48 ` Bryan Wu
2014-04-24 22:43 ` Milo Kim
2014-04-25 9:02 ` Jingoo Han
2014-04-28 10:16 ` Lee Jones
2014-04-24 12:28 ` Peter Griffin [this message]
2014-05-07 9:14 ` [PATCH 13/13] video: omap: allow building on !MMU Tomi Valkeinen
2014-05-08 21:53 ` Tony Lindgren
2014-05-08 23:04 ` Aaro Koskinen
2014-05-08 23:17 ` Tony Lindgren
2014-05-09 21:21 ` Aaro Koskinen
2014-05-11 15:01 ` Tony Lindgren
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=1398342509-10243-14-git-send-email-peter.griffin@linaro.org \
--to=peter.griffin@linaro.org \
--cc=arnd@arndb.de \
--cc=linaro-kernel@lists.linaro.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=plagnioj@jcrosoft.com \
--cc=tomi.valkeinen@ti.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;
as well as URLs for NNTP newsgroup(s).