* [PATCH v4] fbdev: sh_mobile_lcdc: use dma_mmap_coherent
@ 2012-08-16 10:13 Hideki EIRAKU
2012-08-16 12:16 ` Laurent Pinchart
0 siblings, 1 reply; 4+ messages in thread
From: Hideki EIRAKU @ 2012-08-16 10:13 UTC (permalink / raw)
To: Florian Tobias Schandinat
Cc: linux-fbdev, linux-kernel, Marek Szyprowski, Laurent Pinchart,
Katsuya MATSUBARA, Damian Hobson-Garcia, Hideki EIRAKU
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>
---
drivers/video/sh_mobile_lcdcfb.c | 20 ++++++++++++++++++++
1 files changed, 20 insertions(+), 0 deletions(-)
diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c
index 699487c..bccfd7e 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)
return 1;
}
+static int
+sh_mobile_lcdc_overlay_mmap(struct fb_info *info, struct vm_area_struct *vma)
+{
+ struct sh_mobile_lcdc_overlay *ovl = info->par;
+
+ return dma_mmap_coherent(ovl->channel->lcdc->dev, vma, ovl->fb_mem,
+ ovl->dma_handle, ovl->fb_size);
+}
+
static struct fb_ops sh_mobile_lcdc_overlay_ops = {
.owner = THIS_MODULE,
.fb_read = fb_sys_read,
@@ -1626,6 +1635,7 @@ static struct fb_ops sh_mobile_lcdc_overlay_ops = {
.fb_ioctl = sh_mobile_lcdc_overlay_ioctl,
.fb_check_var = sh_mobile_lcdc_overlay_check_var,
.fb_set_par = sh_mobile_lcdc_overlay_set_par,
+ .fb_mmap = sh_mobile_lcdc_overlay_mmap,
};
static void
@@ -2093,6 +2103,15 @@ static int sh_mobile_lcdc_blank(int blank, struct fb_info *info)
return 0;
}
+static int
+sh_mobile_lcdc_mmap(struct fb_info *info, struct vm_area_struct *vma)
+{
+ struct sh_mobile_lcdc_chan *ch = info->par;
+
+ return dma_mmap_coherent(ch->lcdc->dev, vma, ch->fb_mem,
+ ch->dma_handle, ch->fb_size);
+}
+
static struct fb_ops sh_mobile_lcdc_ops = {
.owner = THIS_MODULE,
.fb_setcolreg = sh_mobile_lcdc_setcolreg,
@@ -2108,6 +2127,7 @@ static struct fb_ops sh_mobile_lcdc_ops = {
.fb_release = sh_mobile_lcdc_release,
.fb_check_var = sh_mobile_lcdc_check_var,
.fb_set_par = sh_mobile_lcdc_set_par,
+ .fb_mmap = sh_mobile_lcdc_mmap,
};
static void
--
1.7.0.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v4] fbdev: sh_mobile_lcdc: use dma_mmap_coherent
2012-08-16 10:13 [PATCH v4] fbdev: sh_mobile_lcdc: use dma_mmap_coherent Hideki EIRAKU
@ 2012-08-16 12:16 ` Laurent Pinchart
2012-12-10 10:31 ` Hideki EIRAKU
0 siblings, 1 reply; 4+ messages in thread
From: Laurent Pinchart @ 2012-08-16 12:16 UTC (permalink / raw)
To: Hideki EIRAKU
Cc: Florian Tobias Schandinat, linux-fbdev, linux-kernel,
Marek Szyprowski, Katsuya MATSUBARA, Damian Hobson-Garcia
Hi Eiraku-san,
On Thursday 16 August 2012 19:13:20 Hideki EIRAKU wrote:
> 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>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
I will push the patch to v3.7 through my tree.
> ---
> drivers/video/sh_mobile_lcdcfb.c | 20 ++++++++++++++++++++
> 1 files changed, 20 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/video/sh_mobile_lcdcfb.c
> b/drivers/video/sh_mobile_lcdcfb.c index 699487c..bccfd7e 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) return 1;
> }
>
> +static int
> +sh_mobile_lcdc_overlay_mmap(struct fb_info *info, struct vm_area_struct
> *vma) +{
> + struct sh_mobile_lcdc_overlay *ovl = info->par;
> +
> + return dma_mmap_coherent(ovl->channel->lcdc->dev, vma, ovl->fb_mem,
> + ovl->dma_handle, ovl->fb_size);
> +}
> +
> static struct fb_ops sh_mobile_lcdc_overlay_ops = {
> .owner = THIS_MODULE,
> .fb_read = fb_sys_read,
> @@ -1626,6 +1635,7 @@ static struct fb_ops sh_mobile_lcdc_overlay_ops = {
> .fb_ioctl = sh_mobile_lcdc_overlay_ioctl,
> .fb_check_var = sh_mobile_lcdc_overlay_check_var,
> .fb_set_par = sh_mobile_lcdc_overlay_set_par,
> + .fb_mmap = sh_mobile_lcdc_overlay_mmap,
> };
>
> static void
> @@ -2093,6 +2103,15 @@ static int sh_mobile_lcdc_blank(int blank, struct
> fb_info *info) return 0;
> }
>
> +static int
> +sh_mobile_lcdc_mmap(struct fb_info *info, struct vm_area_struct *vma)
> +{
> + struct sh_mobile_lcdc_chan *ch = info->par;
> +
> + return dma_mmap_coherent(ch->lcdc->dev, vma, ch->fb_mem,
> + ch->dma_handle, ch->fb_size);
> +}
> +
> static struct fb_ops sh_mobile_lcdc_ops = {
> .owner = THIS_MODULE,
> .fb_setcolreg = sh_mobile_lcdc_setcolreg,
> @@ -2108,6 +2127,7 @@ static struct fb_ops sh_mobile_lcdc_ops = {
> .fb_release = sh_mobile_lcdc_release,
> .fb_check_var = sh_mobile_lcdc_check_var,
> .fb_set_par = sh_mobile_lcdc_set_par,
> + .fb_mmap = sh_mobile_lcdc_mmap,
> };
>
> static void
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v4] fbdev: sh_mobile_lcdc: use dma_mmap_coherent
2012-08-16 12:16 ` Laurent Pinchart
@ 2012-12-10 10:31 ` Hideki EIRAKU
2012-12-10 22:54 ` Laurent Pinchart
0 siblings, 1 reply; 4+ messages in thread
From: Hideki EIRAKU @ 2012-12-10 10:31 UTC (permalink / raw)
To: laurent.pinchart
Cc: FlorianSchandinat, linux-fbdev, linux-kernel, m.szyprowski, matsu,
dhobsong
Hi Laurent,
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Subject: Re: [PATCH v4] fbdev: sh_mobile_lcdc: use dma_mmap_coherent
Date: Thu, 16 Aug 2012 14:16:32 +0200
> Hi Eiraku-san,
>
> On Thursday 16 August 2012 19:13:20 Hideki EIRAKU wrote:
>> 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>
>
> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
>
> I will push the patch to v3.7 through my tree.
I'd like to use this patch to test IOMMU implementation of Renesas
IPMMU. But I could not find it in v3.7-rc8. Could you please tell me if
this has already been merged somewhere or not?
--
Hideki EIRAKU <hdk@igel.co.jp>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v4] fbdev: sh_mobile_lcdc: use dma_mmap_coherent
2012-12-10 10:31 ` Hideki EIRAKU
@ 2012-12-10 22:54 ` Laurent Pinchart
0 siblings, 0 replies; 4+ messages in thread
From: Laurent Pinchart @ 2012-12-10 22:54 UTC (permalink / raw)
To: Hideki EIRAKU
Cc: FlorianSchandinat, linux-fbdev, linux-kernel, m.szyprowski, matsu,
dhobsong
Hi Eiraku-san,
On Monday 10 December 2012 19:31:25 Hideki EIRAKU wrote:
> On Thu, 16 Aug 2012 14:16:32 +0200 Laurent Pinchart wrote:
> > On Thursday 16 August 2012 19:13:20 Hideki EIRAKU wrote:
> >> 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>
> >
> > Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> >
> > I will push the patch to v3.7 through my tree.
>
> I'd like to use this patch to test IOMMU implementation of Renesas
> IPMMU. But I could not find it in v3.7-rc8. Could you please tell me if
> this has already been merged somewhere or not?
I'm afraid the patch got delayed to v3.8, sorry about that. I've sent a pull
request for v3.8, the patch is currently in linux-next
(bf10a53765b4435a5349a92a5a51753902ed86f1) and will be merged during the next
merge window (which should open in the very near future).
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-12-10 22:54 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-16 10:13 [PATCH v4] fbdev: sh_mobile_lcdc: use dma_mmap_coherent Hideki EIRAKU
2012-08-16 12:16 ` Laurent Pinchart
2012-12-10 10:31 ` Hideki EIRAKU
2012-12-10 22:54 ` Laurent Pinchart
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).