aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorHideki EIRAKU <hdk@igel.co.jp>2012-08-16 06:13:20 -0400
committerLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>2012-11-21 09:31:45 -0500
commitbf10a53765b4435a5349a92a5a51753902ed86f1 (patch)
treebbd727583e795cd0ad9394bab9af9ce0e69903c6 /drivers
parentf4a75d2eb7b1e2206094b901be09adb31ba63681 (diff)
fbdev: sh_mobile_lcdc: use dma_mmap_coherent
fb_mmap() implemented in fbmem.c uses smem_start as the physical address of the frame buffer. In the sh_mobile_lcdc driver, the smem_start is a dma_addr_t that is not a physical address when IOMMU is enabled. dma_mmap_coherent() maps the address correctly. Signed-off-by: Hideki EIRAKU <hdk@igel.co.jp> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/video/sh_mobile_lcdcfb.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c
index 699487c287b2..bccfd7eff39b 100644
--- a/drivers/video/sh_mobile_lcdcfb.c
+++ b/drivers/video/sh_mobile_lcdcfb.c
@@ -1614,6 +1614,15 @@ static int sh_mobile_lcdc_overlay_blank(int blank, struct fb_info *info)
1614 return 1; 1614 return 1;
1615} 1615}
1616 1616
1617static int
1618sh_mobile_lcdc_overlay_mmap(struct fb_info *info, struct vm_area_struct *vma)
1619{
1620 struct sh_mobile_lcdc_overlay *ovl = info->par;
1621
1622 return dma_mmap_coherent(ovl->channel->lcdc->dev, vma, ovl->fb_mem,
1623 ovl->dma_handle, ovl->fb_size);
1624}
1625
1617static struct fb_ops sh_mobile_lcdc_overlay_ops = { 1626static struct fb_ops sh_mobile_lcdc_overlay_ops = {
1618 .owner = THIS_MODULE, 1627 .owner = THIS_MODULE,
1619 .fb_read = fb_sys_read, 1628 .fb_read = fb_sys_read,
@@ -1626,6 +1635,7 @@ static struct fb_ops sh_mobile_lcdc_overlay_ops = {
1626 .fb_ioctl = sh_mobile_lcdc_overlay_ioctl, 1635 .fb_ioctl = sh_mobile_lcdc_overlay_ioctl,
1627 .fb_check_var = sh_mobile_lcdc_overlay_check_var, 1636 .fb_check_var = sh_mobile_lcdc_overlay_check_var,
1628 .fb_set_par = sh_mobile_lcdc_overlay_set_par, 1637 .fb_set_par = sh_mobile_lcdc_overlay_set_par,
1638 .fb_mmap = sh_mobile_lcdc_overlay_mmap,
1629}; 1639};
1630 1640
1631static void 1641static void
@@ -2093,6 +2103,15 @@ static int sh_mobile_lcdc_blank(int blank, struct fb_info *info)
2093 return 0; 2103 return 0;
2094} 2104}
2095 2105
2106static int
2107sh_mobile_lcdc_mmap(struct fb_info *info, struct vm_area_struct *vma)
2108{
2109 struct sh_mobile_lcdc_chan *ch = info->par;
2110
2111 return dma_mmap_coherent(ch->lcdc->dev, vma, ch->fb_mem,
2112 ch->dma_handle, ch->fb_size);
2113}
2114
2096static struct fb_ops sh_mobile_lcdc_ops = { 2115static struct fb_ops sh_mobile_lcdc_ops = {
2097 .owner = THIS_MODULE, 2116 .owner = THIS_MODULE,
2098 .fb_setcolreg = sh_mobile_lcdc_setcolreg, 2117 .fb_setcolreg = sh_mobile_lcdc_setcolreg,
@@ -2108,6 +2127,7 @@ static struct fb_ops sh_mobile_lcdc_ops = {
2108 .fb_release = sh_mobile_lcdc_release, 2127 .fb_release = sh_mobile_lcdc_release,
2109 .fb_check_var = sh_mobile_lcdc_check_var, 2128 .fb_check_var = sh_mobile_lcdc_check_var,
2110 .fb_set_par = sh_mobile_lcdc_set_par, 2129 .fb_set_par = sh_mobile_lcdc_set_par,
2130 .fb_mmap = sh_mobile_lcdc_mmap,
2111}; 2131};
2112 2132
2113static void 2133static void