* [PATCH 1/2] drivers/video: Kconfig, fix mxsfb build
From: Markus Pargmann @ 2013-04-24 8:08 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1366790894-20426-1-git-send-email-mpa@pengutronix.de>
From: Markus Pargmann <mpargmann@allfex.org>
Kernel build fails with commit 669406534b4abb827d1bdc39bb5e2d5255818ae2
This patch replaces OF_VIDEOMODE symbol by VIDEOMODE_HELPERS.
Signed-off-by: Markus Pargmann <mpargmann@allfex.org>
---
drivers/video/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index d8ecc52..6246056 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -2429,7 +2429,7 @@ config FB_MXS
select FB_CFB_COPYAREA
select FB_CFB_IMAGEBLIT
select FB_MODE_HELPERS
- select OF_VIDEOMODE
+ select VIDEOMODE_HELPERS
help
Framebuffer support for the MXS SoC.
--
1.8.1.5
^ permalink raw reply related
* [PATCH 0/2] drivers/video: mxs-fb: build fixes
From: Markus Pargmann @ 2013-04-24 8:08 UTC (permalink / raw)
To: linux-arm-kernel
Hi,
mxs-fb commit
669406534b4abb827d1bdc39bb5e2d5255818ae2 video: mxsfb: get display timings from device tree
creates a build failure together with those commits:
a38884f681a4d044befd30d9f3d19a0821bae63a videomode: simplify videomode Kconfig and Makefile
6cd2c7db41eab204b6474534df4ca68a7dc53d86 videomode: videomode_from_timing work
All of them are in linux-next, so mxs-fb fails to build there.
Regards,
Markus
^ permalink raw reply
* Re: [PATCH 07/11] fbdev/sa1100fb: use vm_iomap_memory()
From: Russell King - ARM Linux @ 2013-04-23 18:53 UTC (permalink / raw)
To: Tomi Valkeinen; +Cc: linux-fbdev, linux-kernel
In-Reply-To: <1366699018-5439-7-git-send-email-tomi.valkeinen@ti.com>
On Tue, Apr 23, 2013 at 09:36:54AM +0300, Tomi Valkeinen wrote:
> Use vm_iomap_memory() instead of [io_]remap_pfn_range().
> vm_iomap_memory() gives us much simpler API to map memory to userspace,
> and reduces possibilities for bugs.
>
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
> Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
Thanks.
^ permalink raw reply
* [PATCH] Handle efifb with no lfb_base better.
From: Peter Jones @ 2013-04-23 15:23 UTC (permalink / raw)
To: Florian Tobias Schandinat
Cc: Josh Boyer, linux-fbdev, linux-kernel, Peter Jones
Right now we get a WARN from platform_device_unregister() because our
platform_device has no ->release function. This is clearly wrong, but
we should be warning so we can figure out what happened, as this failure
results in bug reports. So WARN() about the real problem, and use the
registration function that gives us a default release() function.
This fixes the tracback reported at
https://bugzilla.redhat.com/show_bug.cgi?id„0621 , though it does not
fix the actual /problem/ the user is seeing.
Signed-off-by: Peter Jones <pjones@redhat.com>
---
drivers/video/efifb.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/drivers/video/efifb.c b/drivers/video/efifb.c
index 50fe668..390b61b 100644
--- a/drivers/video/efifb.c
+++ b/drivers/video/efifb.c
@@ -285,6 +285,7 @@ static void efifb_destroy(struct fb_info *info)
{
if (info->screen_base)
iounmap(info->screen_base);
+ fb_dealloc_cmap(&info->cmap);
if (request_mem_succeeded)
release_mem_region(info->apertures->ranges[0].base,
info->apertures->ranges[0].size);
@@ -382,6 +383,8 @@ static int __init efifb_probe(struct platform_device *dev)
if (!screen_info.pages)
screen_info.pages = 1;
if (!screen_info.lfb_base) {
+ WARN(1, KERN_WARNING, "invalid framebuffer address for "
+ "device '%s'\n", dev_name(dev));
printk(KERN_DEBUG "efifb: invalid framebuffer address\n");
return -ENODEV;
}
@@ -544,9 +547,7 @@ static struct platform_driver efifb_driver = {
},
};
-static struct platform_device efifb_device = {
- .name = "efifb",
-};
+static struct platform_device *efifb_device;
static int __init efifb_init(void)
{
@@ -571,9 +572,9 @@ static int __init efifb_init(void)
if (!screen_info.lfb_linelength)
return -ENODEV;
- ret = platform_device_register(&efifb_device);
- if (ret)
- return ret;
+ efifb_device = platform_device_register_simple("efifb", 0, NULL, 0);
+ if (IS_ERROR(efifb_device))
+ return PTR_ERR(efifb_device);
/*
* This is not just an optimization. We will interfere
@@ -582,7 +583,7 @@ static int __init efifb_init(void)
*/
ret = platform_driver_probe(&efifb_driver, efifb_probe);
if (ret) {
- platform_device_unregister(&efifb_device);
+ platform_device_unregister(efifb_device);
return ret;
}
--
1.8.1.4
^ permalink raw reply related
* [PATCH 11/11] fbdev: improve fb_mmap bounds checks
From: Tomi Valkeinen @ 2013-04-23 6:36 UTC (permalink / raw)
To: linux-fbdev, linux-kernel
Cc: Tomi Valkeinen, Steve Glendinning, Bernie Thompson
In-Reply-To: <1366699018-5439-1-git-send-email-tomi.valkeinen@ti.com>
Improve fb_mmap bounds checks in gbefb, smscufx, udlfb and vfb drivers to
prevent possible uint overflows.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: Steve Glendinning <steve.glendinning@smsc.com>
Cc: Bernie Thompson <bernie@plugable.com>
---
drivers/video/gbefb.c | 4 +++-
drivers/video/smscufx.c | 6 +++++-
drivers/video/udlfb.c | 6 +++++-
drivers/video/vfb.c | 7 +++++--
4 files changed, 18 insertions(+), 5 deletions(-)
diff --git a/drivers/video/gbefb.c b/drivers/video/gbefb.c
index bda5e39..ceab370 100644
--- a/drivers/video/gbefb.c
+++ b/drivers/video/gbefb.c
@@ -1016,7 +1016,9 @@ static int gbefb_mmap(struct fb_info *info,
/* check range */
if (vma->vm_pgoff > (~0UL >> PAGE_SHIFT))
return -EINVAL;
- if (offset + size > gbe_mem_size)
+ if (size > gbe_mem_size)
+ return -EINVAL;
+ if (offset > gbe_mem_size - size)
return -EINVAL;
/* remap using the fastest write-through mode on architecture */
diff --git a/drivers/video/smscufx.c b/drivers/video/smscufx.c
index 97bd662..b2b33fc 100644
--- a/drivers/video/smscufx.c
+++ b/drivers/video/smscufx.c
@@ -782,7 +782,11 @@ static int ufx_ops_mmap(struct fb_info *info, struct vm_area_struct *vma)
unsigned long offset = vma->vm_pgoff << PAGE_SHIFT;
unsigned long page, pos;
- if (offset + size > info->fix.smem_len)
+ if (vma->vm_pgoff > (~0UL >> PAGE_SHIFT))
+ return -EINVAL;
+ if (size > info->fix.smem_len)
+ return -EINVAL;
+ if (offset > info->fix.smem_len - size)
return -EINVAL;
pos = (unsigned long)info->fix.smem_start + offset;
diff --git a/drivers/video/udlfb.c b/drivers/video/udlfb.c
index 86d449e..ec03e72 100644
--- a/drivers/video/udlfb.c
+++ b/drivers/video/udlfb.c
@@ -324,7 +324,11 @@ static int dlfb_ops_mmap(struct fb_info *info, struct vm_area_struct *vma)
unsigned long offset = vma->vm_pgoff << PAGE_SHIFT;
unsigned long page, pos;
- if (offset + size > info->fix.smem_len)
+ if (vma->vm_pgoff > (~0UL >> PAGE_SHIFT))
+ return -EINVAL;
+ if (size > info->fix.smem_len)
+ return -EINVAL;
+ if (offset > info->fix.smem_len - size)
return -EINVAL;
pos = (unsigned long)info->fix.smem_start + offset;
diff --git a/drivers/video/vfb.c b/drivers/video/vfb.c
index 8bc1f93..ee5985e 100644
--- a/drivers/video/vfb.c
+++ b/drivers/video/vfb.c
@@ -420,9 +420,12 @@ static int vfb_mmap(struct fb_info *info,
unsigned long offset = vma->vm_pgoff << PAGE_SHIFT;
unsigned long page, pos;
- if (offset + size > info->fix.smem_len) {
+ if (vma->vm_pgoff > (~0UL >> PAGE_SHIFT))
+ return -EINVAL;
+ if (size > info->fix.smem_len)
+ return -EINVAL;
+ if (offset > info->fix.smem_len - size)
return -EINVAL;
- }
pos = (unsigned long)info->fix.smem_start + offset;
--
1.7.10.4
^ permalink raw reply related
* [PATCH 10/11] fbdev/ps3fb: use vm_iomap_memory()
From: Tomi Valkeinen @ 2013-04-23 6:36 UTC (permalink / raw)
To: linux-fbdev, linux-kernel; +Cc: Tomi Valkeinen, Geert Uytterhoeven
In-Reply-To: <1366699018-5439-1-git-send-email-tomi.valkeinen@ti.com>
Use vm_iomap_memory() instead of [io_]remap_pfn_range().
vm_iomap_memory() gives us much simpler API to map memory to userspace,
and reduces possibilities for bugs.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
---
drivers/video/ps3fb.c | 15 ++++-----------
1 file changed, 4 insertions(+), 11 deletions(-)
diff --git a/drivers/video/ps3fb.c b/drivers/video/ps3fb.c
index 920c27b..1bdeb08 100644
--- a/drivers/video/ps3fb.c
+++ b/drivers/video/ps3fb.c
@@ -705,21 +705,14 @@ static int ps3fb_pan_display(struct fb_var_screeninfo *var,
static int ps3fb_mmap(struct fb_info *info, struct vm_area_struct *vma)
{
- unsigned long size, offset;
+ int r;
- size = vma->vm_end - vma->vm_start;
- offset = vma->vm_pgoff << PAGE_SHIFT;
- if (offset + size > info->fix.smem_len)
- return -EINVAL;
-
- offset += info->fix.smem_start;
- if (remap_pfn_range(vma, vma->vm_start, offset >> PAGE_SHIFT,
- size, vma->vm_page_prot))
- return -EAGAIN;
+ r = vm_ioremap_memory(vma, info->fix.smem_start, info->fix.smem_len);
dev_dbg(info->device, "ps3fb: mmap framebuffer P(%lx)->V(%lx)\n",
offset, vma->vm_start);
- return 0;
+
+ return r;
}
/*
--
1.7.10.4
^ permalink raw reply related
* [PATCH 09/11] fbdev/sgivwfb: use vm_iomap_memory()
From: Tomi Valkeinen @ 2013-04-23 6:36 UTC (permalink / raw)
To: linux-fbdev, linux-kernel; +Cc: Tomi Valkeinen
In-Reply-To: <1366699018-5439-1-git-send-email-tomi.valkeinen@ti.com>
Use vm_iomap_memory() instead of [io_]remap_pfn_range().
vm_iomap_memory() gives us much simpler API to map memory to userspace,
and reduces possibilities for bugs.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
drivers/video/sgivwfb.c | 20 +++++++-------------
1 file changed, 7 insertions(+), 13 deletions(-)
diff --git a/drivers/video/sgivwfb.c b/drivers/video/sgivwfb.c
index 2331fad..b2a8912 100644
--- a/drivers/video/sgivwfb.c
+++ b/drivers/video/sgivwfb.c
@@ -705,23 +705,17 @@ static int sgivwfb_setcolreg(u_int regno, u_int red, u_int green,
static int sgivwfb_mmap(struct fb_info *info,
struct vm_area_struct *vma)
{
- unsigned long size = vma->vm_end - vma->vm_start;
- unsigned long offset = vma->vm_pgoff << PAGE_SHIFT;
+ int r;
- if (vma->vm_pgoff > (~0UL >> PAGE_SHIFT))
- return -EINVAL;
- if (offset + size > sgivwfb_mem_size)
- return -EINVAL;
- offset += sgivwfb_mem_phys;
pgprot_val(vma->vm_page_prot) - pgprot_val(vma->vm_page_prot) | _PAGE_PCD;
- vma->vm_flags |= VM_IO;
- if (remap_pfn_range(vma, vma->vm_start, offset >> PAGE_SHIFT,
- size, vma->vm_page_prot))
- return -EAGAIN;
+ pgprot_val(vma->vm_page_prot) | _PAGE_PCD;
+
+ r = vm_iomap_memory(vma, sgivwfb_mem_phys, sgivwfb_mem_size);
+
printk(KERN_DEBUG "sgivwfb: mmap framebuffer P(%lx)->V(%lx)\n",
offset, vma->vm_start);
- return 0;
+
+ return r;
}
int __init sgivwfb_setup(char *options)
--
1.7.10.4
^ permalink raw reply related
* [PATCH 08/11] fbdev/vermillion: use vm_iomap_memory()
From: Tomi Valkeinen @ 2013-04-23 6:36 UTC (permalink / raw)
To: linux-fbdev, linux-kernel; +Cc: Tomi Valkeinen, Alan Hourihane
In-Reply-To: <1366699018-5439-1-git-send-email-tomi.valkeinen@ti.com>
Use vm_iomap_memory() instead of [io_]remap_pfn_range().
vm_iomap_memory() gives us much simpler API to map memory to userspace,
and reduces possibilities for bugs.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: Alan Hourihane <alanh@fairlite.demon.co.uk>
---
drivers/video/vermilion/vermilion.c | 14 ++++----------
1 file changed, 4 insertions(+), 10 deletions(-)
diff --git a/drivers/video/vermilion/vermilion.c b/drivers/video/vermilion/vermilion.c
index 0aa516f..09a1366 100644
--- a/drivers/video/vermilion/vermilion.c
+++ b/drivers/video/vermilion/vermilion.c
@@ -1003,24 +1003,18 @@ static int vmlfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
static int vmlfb_mmap(struct fb_info *info, struct vm_area_struct *vma)
{
struct vml_info *vinfo = container_of(info, struct vml_info, info);
- unsigned long size = vma->vm_end - vma->vm_start;
unsigned long offset = vma->vm_pgoff << PAGE_SHIFT;
int ret;
- if (vma->vm_pgoff > (~0UL >> PAGE_SHIFT))
- return -EINVAL;
- if (offset + size > vinfo->vram_contig_size)
- return -EINVAL;
ret = vmlfb_vram_offset(vinfo, offset);
if (ret)
return -EINVAL;
- offset += vinfo->vram_start;
+
pgprot_val(vma->vm_page_prot) |= _PAGE_PCD;
pgprot_val(vma->vm_page_prot) &= ~_PAGE_PWT;
- if (remap_pfn_range(vma, vma->vm_start, offset >> PAGE_SHIFT,
- size, vma->vm_page_prot))
- return -EAGAIN;
- return 0;
+
+ return vm_iomap_memory(vma, vinfo->vram_start,
+ vinfo->vram_contig_size);
}
static int vmlfb_sync(struct fb_info *info)
--
1.7.10.4
^ permalink raw reply related
* [PATCH 07/11] fbdev/sa1100fb: use vm_iomap_memory()
From: Tomi Valkeinen @ 2013-04-23 6:36 UTC (permalink / raw)
To: linux-fbdev, linux-kernel; +Cc: Tomi Valkeinen, Russell King
In-Reply-To: <1366699018-5439-1-git-send-email-tomi.valkeinen@ti.com>
Use vm_iomap_memory() instead of [io_]remap_pfn_range().
vm_iomap_memory() gives us much simpler API to map memory to userspace,
and reduces possibilities for bugs.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
---
drivers/video/sa1100fb.c | 16 +++-------------
1 file changed, 3 insertions(+), 13 deletions(-)
diff --git a/drivers/video/sa1100fb.c b/drivers/video/sa1100fb.c
index cfbde5e..f34c858 100644
--- a/drivers/video/sa1100fb.c
+++ b/drivers/video/sa1100fb.c
@@ -556,7 +556,7 @@ static int sa1100fb_mmap(struct fb_info *info,
struct vm_area_struct *vma)
{
struct sa1100fb_info *fbi = (struct sa1100fb_info *)info;
- unsigned long start, len, off = vma->vm_pgoff << PAGE_SHIFT;
+ unsigned long off = vma->vm_pgoff << PAGE_SHIFT;
if (off < info->fix.smem_len) {
vma->vm_pgoff += 1; /* skip over the palette */
@@ -564,19 +564,9 @@ static int sa1100fb_mmap(struct fb_info *info,
fbi->map_dma, fbi->map_size);
}
- start = info->fix.mmio_start;
- len = PAGE_ALIGN((start & ~PAGE_MASK) + info->fix.mmio_len);
-
- if ((vma->vm_end - vma->vm_start + off) > len)
- return -EINVAL;
-
- off += start & PAGE_MASK;
- vma->vm_pgoff = off >> PAGE_SHIFT;
- vma->vm_flags |= VM_IO;
vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
- return io_remap_pfn_range(vma, vma->vm_start, off >> PAGE_SHIFT,
- vma->vm_end - vma->vm_start,
- vma->vm_page_prot);
+
+ return vm_iomap_memory(vma, info->fix.mmio_start, info->fix.mmio_len);
}
static struct fb_ops sa1100fb_ops = {
--
1.7.10.4
^ permalink raw reply related
* [PATCH 06/11] fbdev/fb-puv3: use vm_iomap_memory()
From: Tomi Valkeinen @ 2013-04-23 6:36 UTC (permalink / raw)
To: linux-fbdev, linux-kernel; +Cc: Tomi Valkeinen, Guan Xuetao
In-Reply-To: <1366699018-5439-1-git-send-email-tomi.valkeinen@ti.com>
Use vm_iomap_memory() instead of [io_]remap_pfn_range().
vm_iomap_memory() gives us much simpler API to map memory to userspace,
and reduces possibilities for bugs.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: Guan Xuetao <gxt@mprc.pku.edu.cn>
---
drivers/video/fb-puv3.c | 14 +-------------
1 file changed, 1 insertion(+), 13 deletions(-)
diff --git a/drivers/video/fb-puv3.c b/drivers/video/fb-puv3.c
index 7d106f1f..27fc956 100644
--- a/drivers/video/fb-puv3.c
+++ b/drivers/video/fb-puv3.c
@@ -640,21 +640,9 @@ static int unifb_pan_display(struct fb_var_screeninfo *var,
int unifb_mmap(struct fb_info *info,
struct vm_area_struct *vma)
{
- unsigned long size = vma->vm_end - vma->vm_start;
- unsigned long offset = vma->vm_pgoff << PAGE_SHIFT;
- unsigned long pos = info->fix.smem_start + offset;
-
- if (offset + size > info->fix.smem_len)
- return -EINVAL;
-
vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
- if (io_remap_pfn_range(vma, vma->vm_start, pos >> PAGE_SHIFT, size,
- vma->vm_page_prot))
- return -EAGAIN;
-
- /* VM_IO | VM_DONTEXPAND | VM_DONTDUMP are set by remap_pfn_range() */
- return 0;
+ return vm_iomap_memory(vma, info->fix.smem_start, info->fix.smem_len);
}
static struct fb_ops unifb_ops = {
--
1.7.10.4
^ permalink raw reply related
* [PATCH 05/11] fbdev/controlfb: use vm_iomap_memory()
From: Tomi Valkeinen @ 2013-04-23 6:36 UTC (permalink / raw)
To: linux-fbdev, linux-kernel; +Cc: Tomi Valkeinen
In-Reply-To: <1366699018-5439-1-git-send-email-tomi.valkeinen@ti.com>
Use vm_iomap_memory() instead of [io_]remap_pfn_range().
vm_iomap_memory() gives us much simpler API to map memory to userspace,
and reduces possibilities for bugs.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
drivers/video/controlfb.c | 50 ++++++++++++++++++---------------------------
1 file changed, 20 insertions(+), 30 deletions(-)
diff --git a/drivers/video/controlfb.c b/drivers/video/controlfb.c
index 0c189b3..67b77b4 100644
--- a/drivers/video/controlfb.c
+++ b/drivers/video/controlfb.c
@@ -285,36 +285,26 @@ static int controlfb_pan_display(struct fb_var_screeninfo *var,
static int controlfb_mmap(struct fb_info *info,
struct vm_area_struct *vma)
{
- unsigned long off, start;
- u32 len;
-
- off = vma->vm_pgoff << PAGE_SHIFT;
-
- /* frame buffer memory */
- start = info->fix.smem_start;
- len = PAGE_ALIGN((start & ~PAGE_MASK)+info->fix.smem_len);
- if (off >= len) {
- /* memory mapped io */
- off -= len;
- if (info->var.accel_flags)
- return -EINVAL;
- start = info->fix.mmio_start;
- len = PAGE_ALIGN((start & ~PAGE_MASK)+info->fix.mmio_len);
- vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
- } else {
- /* framebuffer */
- vma->vm_page_prot = pgprot_cached_wthru(vma->vm_page_prot);
- }
- start &= PAGE_MASK;
- if ((vma->vm_end - vma->vm_start + off) > len)
- return -EINVAL;
- off += start;
- vma->vm_pgoff = off >> PAGE_SHIFT;
- if (io_remap_pfn_range(vma, vma->vm_start, off >> PAGE_SHIFT,
- vma->vm_end - vma->vm_start, vma->vm_page_prot))
- return -EAGAIN;
-
- return 0;
+ unsigned long mmio_pgoff;
+ unsigned long start;
+ u32 len;
+
+ start = info->fix.smem_start;
+ len = info->fix.smem_len;
+ mmio_pgoff = PAGE_ALIGN((start & ~PAGE_MASK) + len) >> PAGE_SHIFT;
+ if (vma->vm_pgoff >= mmio_pgoff) {
+ if (info->var.accel_flags)
+ return -EINVAL;
+ vma->vm_pgoff -= mmio_pgoff;
+ start = info->fix.mmio_start;
+ len = info->fix.mmio_len;
+ vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
+ } else {
+ /* framebuffer */
+ vma->vm_page_prot = pgprot_cached_wthru(vma->vm_page_prot);
+ }
+
+ return vm_iomap_memory(vma, start, len);
}
static int controlfb_blank(int blank_mode, struct fb_info *info)
--
1.7.10.4
^ permalink raw reply related
* [PATCH 04/11] fbdev/au1200fb: use vm_iomap_memory()
From: Tomi Valkeinen @ 2013-04-23 6:36 UTC (permalink / raw)
To: linux-fbdev, linux-kernel; +Cc: Tomi Valkeinen, Ralf Baechle, Manuel Lauss
In-Reply-To: <1366699018-5439-1-git-send-email-tomi.valkeinen@ti.com>
Use vm_iomap_memory() instead of [io_]remap_pfn_range().
vm_iomap_memory() gives us much simpler API to map memory to userspace,
and reduces possibilities for bugs.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Manuel Lauss <manuel.lauss@googlemail.com>
---
drivers/video/au1200fb.c | 26 +-------------------------
1 file changed, 1 insertion(+), 25 deletions(-)
diff --git a/drivers/video/au1200fb.c b/drivers/video/au1200fb.c
index 1b59054..6ce6b83 100644
--- a/drivers/video/au1200fb.c
+++ b/drivers/video/au1200fb.c
@@ -1235,36 +1235,12 @@ static int au1200fb_fb_blank(int blank_mode, struct fb_info *fbi)
static int au1200fb_fb_mmap(struct fb_info *info, struct vm_area_struct *vma)
{
- unsigned int len;
- unsigned long start=0, off;
struct au1200fb_device *fbdev = info->par;
- if (vma->vm_pgoff > (~0UL >> PAGE_SHIFT)) {
- return -EINVAL;
- }
-
- start = fbdev->fb_phys & PAGE_MASK;
- len = PAGE_ALIGN((start & ~PAGE_MASK) + fbdev->fb_len);
-
- off = vma->vm_pgoff << PAGE_SHIFT;
-
- if ((vma->vm_end - vma->vm_start + off) > len) {
- return -EINVAL;
- }
-
- off += start;
- vma->vm_pgoff = off >> PAGE_SHIFT;
-
vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
pgprot_val(vma->vm_page_prot) |= _CACHE_MASK; /* CCA=7 */
- vma->vm_flags |= VM_IO;
-
- return io_remap_pfn_range(vma, vma->vm_start, off >> PAGE_SHIFT,
- vma->vm_end - vma->vm_start,
- vma->vm_page_prot);
-
- return 0;
+ return vm_iomap_memory(vma, fbdev->fb_phys, fbdev->fb_len);
}
static void set_global(u_int cmd, struct au1200_lcd_global_regs_t *pdata)
--
1.7.10.4
^ permalink raw reply related
* [PATCH 03/11] fbdev/au1100fb: use vm_iomap_memory()
From: Tomi Valkeinen @ 2013-04-23 6:36 UTC (permalink / raw)
To: linux-fbdev, linux-kernel; +Cc: Tomi Valkeinen
In-Reply-To: <1366699018-5439-1-git-send-email-tomi.valkeinen@ti.com>
Use vm_iomap_memory() instead of [io_]remap_pfn_range().
vm_iomap_memory() gives us much simpler API to map memory to userspace,
and reduces possibilities for bugs.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
drivers/video/au1100fb.c | 28 +---------------------------
1 file changed, 1 insertion(+), 27 deletions(-)
diff --git a/drivers/video/au1100fb.c b/drivers/video/au1100fb.c
index ddabaa8..0473b11 100644
--- a/drivers/video/au1100fb.c
+++ b/drivers/video/au1100fb.c
@@ -375,39 +375,13 @@ void au1100fb_fb_rotate(struct fb_info *fbi, int angle)
int au1100fb_fb_mmap(struct fb_info *fbi, struct vm_area_struct *vma)
{
struct au1100fb_device *fbdev;
- unsigned int len;
- unsigned long start=0, off;
fbdev = to_au1100fb_device(fbi);
- if (vma->vm_pgoff > (~0UL >> PAGE_SHIFT)) {
- return -EINVAL;
- }
-
- start = fbdev->fb_phys & PAGE_MASK;
- len = PAGE_ALIGN((start & ~PAGE_MASK) + fbdev->fb_len);
-
- off = vma->vm_pgoff << PAGE_SHIFT;
-
- if ((vma->vm_end - vma->vm_start + off) > len) {
- return -EINVAL;
- }
-
- off += start;
- vma->vm_pgoff = off >> PAGE_SHIFT;
-
vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
pgprot_val(vma->vm_page_prot) |= (6 << 9); //CCA=6
- vma->vm_flags |= VM_IO;
-
- if (io_remap_pfn_range(vma, vma->vm_start, off >> PAGE_SHIFT,
- vma->vm_end - vma->vm_start,
- vma->vm_page_prot)) {
- return -EAGAIN;
- }
-
- return 0;
+ return vm_iomap_memory(vma, fbdev->fb_phys, fbdev->fb_len);
}
static struct fb_ops au1100fb_ops --
1.7.10.4
^ permalink raw reply related
* [PATCH 02/11] fbdev/omapfb: use vm_iomap_memory()
From: Tomi Valkeinen @ 2013-04-23 6:36 UTC (permalink / raw)
To: linux-fbdev, linux-kernel; +Cc: Tomi Valkeinen
In-Reply-To: <1366699018-5439-1-git-send-email-tomi.valkeinen@ti.com>
Use vm_iomap_memory() instead of [io_]remap_pfn_range().
vm_iomap_memory() gives us much simpler API to map memory to userspace,
and reduces possibilities for bugs.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
drivers/video/omap2/omapfb/omapfb-main.c | 30 +++++++-----------------------
1 file changed, 7 insertions(+), 23 deletions(-)
diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c
index ca585ef..717f13a 100644
--- a/drivers/video/omap2/omapfb/omapfb-main.c
+++ b/drivers/video/omap2/omapfb/omapfb-main.c
@@ -1101,41 +1101,25 @@ static int omapfb_mmap(struct fb_info *fbi, struct vm_area_struct *vma)
struct omapfb_info *ofbi = FB2OFB(fbi);
struct fb_fix_screeninfo *fix = &fbi->fix;
struct omapfb2_mem_region *rg;
- unsigned long off;
unsigned long start;
u32 len;
- int r = -EINVAL;
-
- if (vma->vm_end - vma->vm_start = 0)
- return 0;
- if (vma->vm_pgoff > (~0UL >> PAGE_SHIFT))
- return -EINVAL;
- off = vma->vm_pgoff << PAGE_SHIFT;
+ int r;
rg = omapfb_get_mem_region(ofbi->region);
start = omapfb_get_region_paddr(ofbi);
len = fix->smem_len;
- if (off >= len)
- goto error;
- if ((vma->vm_end - vma->vm_start + off) > len)
- goto error;
-
- off += start;
- DBG("user mmap region start %lx, len %d, off %lx\n", start, len, off);
+ DBG("user mmap region start %lx, len %d, off %lx\n", start, len,
+ vma->vm_pgoff << PAGE_SHIFT);
- vma->vm_pgoff = off >> PAGE_SHIFT;
- /* VM_IO | VM_DONTEXPAND | VM_DONTDUMP are set by remap_pfn_range() */
vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot);
vma->vm_ops = &mmap_user_ops;
vma->vm_private_data = rg;
- if (io_remap_pfn_range(vma, vma->vm_start, off >> PAGE_SHIFT,
- vma->vm_end - vma->vm_start,
- vma->vm_page_prot)) {
- r = -EAGAIN;
+
+ r = vm_iomap_memory(vma, start, len);
+ if (r)
goto error;
- }
/* vm_ops.open won't be called for mmap itself. */
atomic_inc(&rg->map_count);
@@ -1144,7 +1128,7 @@ static int omapfb_mmap(struct fb_info *fbi, struct vm_area_struct *vma)
return 0;
- error:
+error:
omapfb_put_mem_region(ofbi->region);
return r;
--
1.7.10.4
^ permalink raw reply related
* [PATCH 01/11] fbdev/fbmem: use vm_iomap_memory()
From: Tomi Valkeinen @ 2013-04-23 6:36 UTC (permalink / raw)
To: linux-fbdev, linux-kernel; +Cc: Tomi Valkeinen
Use vm_iomap_memory() instead of [io_]remap_pfn_range().
vm_iomap_memory() gives us much simpler API to map memory to userspace,
and reduces possibilities for bugs.
Original patch from Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
drivers/video/fbmem.c | 36 ++++++++++++------------------------
1 file changed, 12 insertions(+), 24 deletions(-)
diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c
index 7c25408..0598aa9 100644
--- a/drivers/video/fbmem.c
+++ b/drivers/video/fbmem.c
@@ -1373,15 +1373,12 @@ fb_mmap(struct file *file, struct vm_area_struct * vma)
{
struct fb_info *info = file_fb_info(file);
struct fb_ops *fb;
- unsigned long off;
+ unsigned long mmio_pgoff;
unsigned long start;
u32 len;
if (!info)
return -ENODEV;
- if (vma->vm_pgoff > (~0UL >> PAGE_SHIFT))
- return -EINVAL;
- off = vma->vm_pgoff << PAGE_SHIFT;
fb = info->fbops;
if (!fb)
return -ENODEV;
@@ -1393,32 +1390,23 @@ fb_mmap(struct file *file, struct vm_area_struct * vma)
return res;
}
- /* frame buffer memory */
+ /* Map mmio if pgoff points past the fb */
start = info->fix.smem_start;
- len = PAGE_ALIGN((start & ~PAGE_MASK) + info->fix.smem_len);
- if (off >= len) {
- /* memory mapped io */
- off -= len;
- if (info->var.accel_flags) {
- mutex_unlock(&info->mm_lock);
+ len = info->fix.smem_len;
+ mmio_pgoff = PAGE_ALIGN((start & ~PAGE_MASK) + len) >> PAGE_SHIFT;
+ if (vma->vm_pgoff >= mmio_pgoff) {
+ if (info->var.accel_flags)
return -EINVAL;
- }
+ vma->vm_pgoff -= mmio_pgoff;
start = info->fix.mmio_start;
- len = PAGE_ALIGN((start & ~PAGE_MASK) + info->fix.mmio_len);
+ len = info->fix.mmio_len;
}
mutex_unlock(&info->mm_lock);
- start &= PAGE_MASK;
- if ((vma->vm_end - vma->vm_start + off) > len)
- return -EINVAL;
- off += start;
- vma->vm_pgoff = off >> PAGE_SHIFT;
- /* VM_IO | VM_DONTEXPAND | VM_DONTDUMP are set by io_remap_pfn_range()*/
+
vma->vm_page_prot = vm_get_page_prot(vma->vm_flags);
- fb_pgprotect(file, vma, off);
- if (io_remap_pfn_range(vma, vma->vm_start, off >> PAGE_SHIFT,
- vma->vm_end - vma->vm_start, vma->vm_page_prot))
- return -EAGAIN;
- return 0;
+ fb_pgprotect(file, vma, start);
+
+ return vm_iomap_memory(vma, start, len);
}
static int
--
1.7.10.4
^ permalink raw reply related
* Re: [PATCH v4 2/2] video: imxfb: Add DT support
From: Jean-Christophe PLAGNIOL-VILLARD @ 2013-04-22 15:51 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20130421081115.GA31179@pengutronix.de>
On 10:11 Sun 21 Apr , Markus Pargmann wrote:
> On Thu, Apr 18, 2013 at 06:06:14PM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> > On 15:03 Thu 18 Apr , Markus Pargmann wrote:
> > > Add devicetree support for imx framebuffer driver. It uses the generic
> > > display bindings and helper functions.
> > >
> > > Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
> > > Cc: Fabio Estevam <festevam@gmail.com>
> > > Cc: Mark Rutland <mark.rutland@arm.com>
> > > ---
> > >
> > > Notes:
> > > Changes in v4:
> > > - Remove eukrea specific dmacr property.
> > > - Add optional dmacr property. If not present, the dmacr reset value is not
> > > changed.
> > >
> > > Changes in v3:
> > > - Fix returncodes of of_read_mode function and print error messages
> > > - Introduce a lower bound check for bits per pixel
> > > - Calculate correct bytes per pixel value before using it for the calculation of
> > > memory size
> > > - Change DT property names
> > >
> > > Changes in v2:
> > > - Removed pwmr register property
> > > - Cleanup of devicetree binding documentation
> > > - Use default values for pwmr and lscr1
> > >
> > > .../devicetree/bindings/video/fsl,imx-fb.txt | 51 ++++++
> > > drivers/video/imxfb.c | 194 +++++++++++++++++----
> > > 2 files changed, 210 insertions(+), 35 deletions(-)
> > > create mode 100644 Documentation/devicetree/bindings/video/fsl,imx-fb.txt
> > >
> > > diff --git a/Documentation/devicetree/bindings/video/fsl,imx-fb.txt b/Documentation/devicetree/bindings/video/fsl,imx-fb.txt
> > > new file mode 100644
> > > index 0000000..aff16a4
> > > --- /dev/null
> > > +++ b/Documentation/devicetree/bindings/video/fsl,imx-fb.txt
> > > @@ -0,0 +1,51 @@
> > > +Freescale imx21 Framebuffer
> > > +
> > > +This framebuffer driver supports devices imx1, imx21, imx25, and imx27.
> > > +
> > > +Required properties:
> > > +- compatible : "fsl,<chip>-fb", chip should be imx1 or imx21
> > > +- reg : Should contain 1 register ranges(address and length)
> > > +- interrupts : One interrupt of the fb dev
> > > +
> > > +Required nodes:
> > > +- display: Phandle to a display node as described in
> > > + Documentation/devicetree/bindings/video/display-timing.txt
> > > + Additional, the display node has to define properties:
> > > + - fsl,bpp: Bits per pixel
> > > + - fsl,pcr: LCDC PCR value
> > > +
> > > +Optional properties:
> > > +- fsl,dmacr: DMA Control Register value. This is optional. By default, the
> > > + register is not modified as recommended by the datasheet.
> > > +- fsl,lscr1: LCDC Sharp Configuration Register value.
> > > +
> > > +Example:
> > > +
> > > + imxfb: fb@10021000 {
> > > + compatible = "fsl,imx27-fb", "fsl,imx21-fb";
> > you put both when in the doc you request one
>
> Thanks, fixed.
>
> > > + interrupts = <61>;
> > > + reg = <0x10021000 0x1000>;
> > > + display = <&display0>;
> > > + };
> > > +
> > > + ...
> > > +
> > > + display0: display0 {
> > > + model = "Primeview-PD050VL1";
> > > + native-mode = <&timing_disp0>;
> > > + fsl,bpp = <16>; /* non-standard but required */
> > there is a generic binding bit-per-pixel use a cross other IP
>
> I can't find a generic binding for that. There are only 2 other drivers
> using a "bpp" property, but they both use it within different contexts.
> tilcdc panel uses it within a "panel-info" property and via,vt8500-fb
> within modes. So I think it would be better to use a clear distinction
> because there is no generic binding. That was also suggested in comments
> on version 2 of this patch:
> https://patchwork.kernel.org/patch/2220511/
via use bits-per-pixel
atmel ditto
mxs ditto IIRC
Best Regards,
J.
>
> Regards,
>
> Markus
>
> > > + fsl,pcr = <0xf0c88080>; /* non-standard but required */
> > > + display-timings {
> > > + timing_disp0: 640x480 {
> > > + hactive = <640>;
> > > + vactive = <480>;
> > > + hback-porch = <112>;
> > > + hfront-porch = <36>;
> > > + hsync-len = <32>;
> > > + vback-porch = <33>;
> > > + vfront-porch = <33>;
> > > + vsync-len = <2>;
> > > + clock-frequency = <25000000>;
> > > + };
> > > + };
> > > + };
> > > diff --git a/drivers/video/imxfb.c b/drivers/video/imxfb.c
> > > index ef2b587..e0230f8 100644
> > > --- a/drivers/video/imxfb.c
> > > +++ b/drivers/video/imxfb.c
> > > @@ -32,6 +32,12 @@
> > > #include <linux/io.h>
> > > #include <linux/math64.h>
> > > #include <linux/uaccess.h>
> > > +#include <linux/of.h>
> > > +#include <linux/of_device.h>
> > > +
> > > +#include <video/of_display_timing.h>
> > > +#include <video/of_videomode.h>
> > > +#include <video/videomode.h>
> > >
> > > #include <linux/platform_data/video-imxfb.h>
> > >
> > > @@ -117,10 +123,11 @@
> > > #define LGWCR_GWAV(alpha) (((alpha) & 0xff) << 24)
> > > #define LGWCR_GWE (1 << 22)
> > >
> > > +#define IMXFB_LSCR1_DEFAULT 0x00120300
> > > +
> > > /* Used fb-mode. Can be set on kernel command line, therefore file-static. */
> > > static const char *fb_mode;
> > >
> > > -
> > > /*
> > > * These are the bitfields for each
> > > * display depth that we support.
> > > @@ -192,6 +199,19 @@ static struct platform_device_id imxfb_devtype[] = {
> > > };
> > > MODULE_DEVICE_TABLE(platform, imxfb_devtype);
> > >
> > > +static struct of_device_id imxfb_of_dev_id[] = {
> > > + {
> > > + .compatible = "fsl,imx1-fb",
> > > + .data = &imxfb_devtype[IMX1_FB],
> > > + }, {
> > > + .compatible = "fsl,imx21-fb",
> > > + .data = &imxfb_devtype[IMX21_FB],
> > > + }, {
> > > + /* sentinel */
> > > + }
> > > +};
> > > +MODULE_DEVICE_TABLE(of, imxfb_of_dev_id);
> > > +
> > > static inline int is_imx1_fb(struct imxfb_info *fbi)
> > > {
> > > return fbi->devtype = IMX1_FB;
> > > @@ -324,6 +344,9 @@ static const struct imx_fb_videomode *imxfb_find_mode(struct imxfb_info *fbi)
> > > struct imx_fb_videomode *m;
> > > int i;
> > >
> > > + if (!fb_mode)
> > > + return &fbi->mode[0];
> > > +
> > > for (i = 0, m = &fbi->mode[0]; i < fbi->num_modes; i++, m++) {
> > > if (!strcmp(m->mode.name, fb_mode))
> > > return m;
> > > @@ -479,6 +502,9 @@ static int imxfb_bl_update_status(struct backlight_device *bl)
> > > struct imxfb_info *fbi = bl_get_data(bl);
> > > int brightness = bl->props.brightness;
> > >
> > > + if (!fbi->pwmr)
> > > + return 0;
> > > +
> > > if (bl->props.power != FB_BLANK_UNBLANK)
> > > brightness = 0;
> > > if (bl->props.fb_blank != FB_BLANK_UNBLANK)
> > > @@ -719,10 +745,14 @@ static int imxfb_activate_var(struct fb_var_screeninfo *var, struct fb_info *inf
> > >
> > > writel(fbi->pcr, fbi->regs + LCDC_PCR);
> > > #ifndef PWMR_BACKLIGHT_AVAILABLE
> > > - writel(fbi->pwmr, fbi->regs + LCDC_PWMR);
> > > + if (fbi->pwmr)
> > > + writel(fbi->pwmr, fbi->regs + LCDC_PWMR);
> > > #endif
> > > writel(fbi->lscr1, fbi->regs + LCDC_LSCR1);
> > > - writel(fbi->dmacr, fbi->regs + LCDC_DMACR);
> > > +
> > > + /* dmacr = 0 is no valid value, as we need DMA control marks. */
> > > + if (fbi->dmacr)
> > > + writel(fbi->dmacr, fbi->regs + LCDC_DMACR);
> > >
> > > return 0;
> > > }
> > > @@ -758,13 +788,12 @@ static int imxfb_resume(struct platform_device *dev)
> > > #define imxfb_resume NULL
> > > #endif
> > >
> > > -static int __init imxfb_init_fbinfo(struct platform_device *pdev)
> > > +static int imxfb_init_fbinfo(struct platform_device *pdev)
> > > {
> > > struct imx_fb_platform_data *pdata = pdev->dev.platform_data;
> > > struct fb_info *info = dev_get_drvdata(&pdev->dev);
> > > struct imxfb_info *fbi = info->par;
> > > - struct imx_fb_videomode *m;
> > > - int i;
> > > + struct device_node *np;
> > >
> > > pr_debug("%s\n",__func__);
> > >
> > > @@ -795,41 +824,95 @@ static int __init imxfb_init_fbinfo(struct platform_device *pdev)
> > > info->fbops = &imxfb_ops;
> > > info->flags = FBINFO_FLAG_DEFAULT |
> > > FBINFO_READS_FAST;
> > > - info->var.grayscale = pdata->cmap_greyscale;
> > > - fbi->cmap_inverse = pdata->cmap_inverse;
> > > - fbi->cmap_static = pdata->cmap_static;
> > > - fbi->lscr1 = pdata->lscr1;
> > > - fbi->dmacr = pdata->dmacr;
> > > - fbi->pwmr = pdata->pwmr;
> > > - fbi->lcd_power = pdata->lcd_power;
> > > - fbi->backlight_power = pdata->backlight_power;
> > > -
> > > - for (i = 0, m = &pdata->mode[0]; i < pdata->num_modes; i++, m++)
> > > - info->fix.smem_len = max_t(size_t, info->fix.smem_len,
> > > - m->mode.xres * m->mode.yres * m->bpp / 8);
> > > + if (pdata) {
> > > + info->var.grayscale = pdata->cmap_greyscale;
> > > + fbi->cmap_inverse = pdata->cmap_inverse;
> > > + fbi->cmap_static = pdata->cmap_static;
> > > + fbi->lscr1 = pdata->lscr1;
> > > + fbi->dmacr = pdata->dmacr;
> > > + fbi->pwmr = pdata->pwmr;
> > > + fbi->lcd_power = pdata->lcd_power;
> > > + fbi->backlight_power = pdata->backlight_power;
> > > + } else {
> > > + np = pdev->dev.of_node;
> > > + info->var.grayscale = of_property_read_bool(np,
> > > + "cmap-greyscale");
> > > + fbi->cmap_inverse = of_property_read_bool(np, "cmap-inverse");
> > > + fbi->cmap_static = of_property_read_bool(np, "cmap-static");
> > > +
> > > + fbi->lscr1 = IMXFB_LSCR1_DEFAULT;
> > > + of_property_read_u32(np, "fsl,lscr1", &fbi->lscr1);
> > > +
> > > + of_property_read_u32(np, "fsl,dmacr", &fbi->dmacr);
> > > +
> > > + /* These two function pointers could be used by some specific
> > > + * platforms. */
> > > + fbi->lcd_power = NULL;
> > > + fbi->backlight_power = NULL;
> > > + }
> > > +
> > > + return 0;
> > > +}
> > > +
> > > +static int imxfb_of_read_mode(struct device *dev, struct device_node *np,
> > > + struct imx_fb_videomode *imxfb_mode)
> > > +{
> > > + int ret;
> > > + struct fb_videomode *of_mode = &imxfb_mode->mode;
> > > + u32 bpp;
> > > + u32 pcr;
> > > +
> > > + ret = of_property_read_string(np, "model", &of_mode->name);
> > > + if (ret)
> > > + of_mode->name = NULL;
> > > +
> > > + ret = of_get_fb_videomode(np, of_mode, OF_USE_NATIVE_MODE);
> > > + if (ret) {
> > > + dev_err(dev, "Failed to get videomode from DT\n");
> > > + return ret;
> > > + }
> > > +
> > > + ret = of_property_read_u32(np, "fsl,bpp", &bpp);
> > > + ret |= of_property_read_u32(np, "fsl,pcr", &pcr);
> > > +
> > > + if (ret) {
> > > + dev_err(dev, "Failed to read bpp and pcr from DT\n");
> > > + return -EINVAL;
> > > + }
> > > +
> > > + if (bpp < 1 || bpp > 255) {
> > > + dev_err(dev, "Bits per pixel have to be between 1 and 255\n");
> > > + return -EINVAL;
> > > + }
> > > +
> > > + imxfb_mode->bpp = bpp;
> > > + imxfb_mode->pcr = pcr;
> > >
> > > return 0;
> > > }
> > >
> > > -static int __init imxfb_probe(struct platform_device *pdev)
> > > +static int imxfb_probe(struct platform_device *pdev)
> > > {
> > > struct imxfb_info *fbi;
> > > struct fb_info *info;
> > > struct imx_fb_platform_data *pdata;
> > > struct resource *res;
> > > + struct imx_fb_videomode *m;
> > > + const struct of_device_id *of_id;
> > > int ret, i;
> > > + int bytes_per_pixel;
> > >
> > > dev_info(&pdev->dev, "i.MX Framebuffer driver\n");
> > >
> > > + of_id = of_match_device(imxfb_of_dev_id, &pdev->dev);
> > > + if (of_id)
> > > + pdev->id_entry = of_id->data;
> > > +
> > > res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> > > if (!res)
> > > return -ENODEV;
> > >
> > > pdata = pdev->dev.platform_data;
> > > - if (!pdata) {
> > > - dev_err(&pdev->dev,"No platform_data available\n");
> > > - return -ENOMEM;
> > > - }
> > >
> > > info = framebuffer_alloc(sizeof(struct imxfb_info), &pdev->dev);
> > > if (!info)
> > > @@ -837,15 +920,55 @@ static int __init imxfb_probe(struct platform_device *pdev)
> > >
> > > fbi = info->par;
> > >
> > > - if (!fb_mode)
> > > - fb_mode = pdata->mode[0].mode.name;
> > > -
> > > platform_set_drvdata(pdev, info);
> > >
> > > ret = imxfb_init_fbinfo(pdev);
> > > if (ret < 0)
> > > goto failed_init;
> > >
> > > + if (pdata) {
> > > + if (!fb_mode)
> > > + fb_mode = pdata->mode[0].mode.name;
> > > +
> > > + fbi->mode = pdata->mode;
> > > + fbi->num_modes = pdata->num_modes;
> > > + } else {
> > > + struct device_node *display_np;
> > > + fb_mode = NULL;
> > > +
> > > + display_np = of_parse_phandle(pdev->dev.of_node, "display", 0);
> > > + if (!display_np) {
> > > + dev_err(&pdev->dev, "No display defined in devicetree\n");
> > > + ret = -EINVAL;
> > > + goto failed_of_parse;
> > > + }
> > > +
> > > + /*
> > > + * imxfb does not support more modes, we choose only the native
> > > + * mode.
> > > + */
> > > + fbi->num_modes = 1;
> > > +
> > > + fbi->mode = devm_kzalloc(&pdev->dev,
> > > + sizeof(struct imx_fb_videomode), GFP_KERNEL);
> > > + if (!fbi->mode) {
> > > + ret = -ENOMEM;
> > > + goto failed_of_parse;
> > > + }
> > > +
> > > + ret = imxfb_of_read_mode(&pdev->dev, display_np, fbi->mode);
> > > + if (ret)
> > > + goto failed_of_parse;
> > > + }
> > > +
> > > + /* Calculate maximum bytes used per pixel. In most cases this should
> > > + * be the same as m->bpp/8 */
> > > + m = &fbi->mode[0];
> > > + bytes_per_pixel = (m->bpp + 7) / 8;
> > > + for (i = 0; i < fbi->num_modes; i++, m++)
> > > + info->fix.smem_len = max_t(size_t, info->fix.smem_len,
> > > + m->mode.xres * m->mode.yres * bytes_per_pixel);
> > > +
> > > res = request_mem_region(res->start, resource_size(res),
> > > DRIVER_NAME);
> > > if (!res) {
> > > @@ -878,7 +1001,8 @@ static int __init imxfb_probe(struct platform_device *pdev)
> > > goto failed_ioremap;
> > > }
> > >
> > > - if (!pdata->fixed_screen_cpu) {
> > > + /* Seems not being used by anyone, so no support for oftree */
> > > + if (!pdata || !pdata->fixed_screen_cpu) {
> > > fbi->map_size = PAGE_ALIGN(info->fix.smem_len);
> > > fbi->map_cpu = dma_alloc_writecombine(&pdev->dev,
> > > fbi->map_size, &fbi->map_dma, GFP_KERNEL);
> > > @@ -903,18 +1027,16 @@ static int __init imxfb_probe(struct platform_device *pdev)
> > > info->fix.smem_start = fbi->screen_dma;
> > > }
> > >
> > > - if (pdata->init) {
> > > + if (pdata && pdata->init) {
> > > ret = pdata->init(fbi->pdev);
> > > if (ret)
> > > goto failed_platform_init;
> > > }
> > >
> > > - fbi->mode = pdata->mode;
> > > - fbi->num_modes = pdata->num_modes;
> > >
> > > INIT_LIST_HEAD(&info->modelist);
> > > - for (i = 0; i < pdata->num_modes; i++)
> > > - fb_add_videomode(&pdata->mode[i].mode, &info->modelist);
> > > + for (i = 0; i < fbi->num_modes; i++)
> > > + fb_add_videomode(&fbi->mode[i].mode, &info->modelist);
> > >
> > > /*
> > > * This makes sure that our colour bitfield
> > > @@ -944,10 +1066,10 @@ static int __init imxfb_probe(struct platform_device *pdev)
> > > failed_register:
> > > fb_dealloc_cmap(&info->cmap);
> > > failed_cmap:
> > > - if (pdata->exit)
> > > + if (pdata && pdata->exit)
> > > pdata->exit(fbi->pdev);
> > > failed_platform_init:
> > > - if (!pdata->fixed_screen_cpu)
> > > + if (pdata && !pdata->fixed_screen_cpu)
> > > dma_free_writecombine(&pdev->dev,fbi->map_size,fbi->map_cpu,
> > > fbi->map_dma);
> > > failed_map:
> > > @@ -956,6 +1078,7 @@ failed_ioremap:
> > > failed_getclock:
> > > release_mem_region(res->start, resource_size(res));
> > > failed_req:
> > > +failed_of_parse:
> > > kfree(info->pseudo_palette);
> > > failed_init:
> > > platform_set_drvdata(pdev, NULL);
> > > @@ -980,7 +1103,7 @@ static int imxfb_remove(struct platform_device *pdev)
> > > unregister_framebuffer(info);
> > >
> > > pdata = pdev->dev.platform_data;
> > > - if (pdata->exit)
> > > + if (pdata && pdata->exit)
> > > pdata->exit(fbi->pdev);
> > >
> > > fb_dealloc_cmap(&info->cmap);
> > > @@ -1009,6 +1132,7 @@ static struct platform_driver imxfb_driver = {
> > > .shutdown = imxfb_shutdown,
> > > .driver = {
> > > .name = DRIVER_NAME,
> > > + .of_match_table = imxfb_of_dev_id,
> > > },
> > > .id_table = imxfb_devtype,
> > > };
> > > --
> > > 1.8.1.5
> > >
> >
>
> --
> Pengutronix e.K. | |
> Industrial Linux Solutions | http://www.pengutronix.de/ |
> Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
> Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
^ permalink raw reply
* Re: [PATCH RESEND] video: mxsfb: Fix colors display on lower color depth
From: Marek Vasut @ 2013-04-22 14:30 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <51750EB9.3020301@free-electrons.com>
Dear Maxime Ripard,
> Hi Marek,
>
> Le 22/04/2013 11:16, Marek Vasut a écrit :
> > Dear Maxime Ripard,
> >
> >> The current code always registers as a 32 bits display, and uses the
> >> hardware to drop the MSB of each color to abjust to the interface width
> >> used by the panel.
> >>
> >> This results on 18 bits (and probably 16 bits display as well) in colors
> >> being displayed poorly, because the MSB are obviously the most important
> >> bits for each color definition.
> >>
> >> The default controller behaviour when using an interface width smaller
> >> than the color depth is to drop the LSBs of each color, which makes more
> >> sense because you lose the least important part of the color definition.
> >>
> >> So, to fix the colors display, just get back to the default controller
> >> behaviour.
> >>
> >> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
> >
> > Did you receive my latest email? Check M28EVK (imx28-m28evk.dts), it uses
> > 18bit LCD and works without this patch I think.
>
> Thanks for the pointer. You mentionned in your other mail that it was
> wired on 24bits but that the screen is actually 18 bits. I went to
> search for the schematics to look at the wirings to see what could
> differ, but I couldn't find any for the M28EVK. Are they publicly
> available?
Yes, [1] page 6 .
[1] http://www.denx-cs.de/doku/sites/default/files/M28EVK_V20_0.pdf
Best regards,
Marek Vasut
^ permalink raw reply
* Re: [RFC v2] video: ARM CLCD: Add DT & CDF support
From: Russell King - ARM Linux @ 2013-04-22 14:28 UTC (permalink / raw)
To: Pawel Moll
Cc: linux-fbdev, linux-media, dri-devel, devicetree-discuss,
linux-arm-kernel, Laurent Pinchart, Linus Walleij
In-Reply-To: <1366306402-21651-1-git-send-email-pawel.moll@arm.com>
On Thu, Apr 18, 2013 at 06:33:21PM +0100, Pawel Moll wrote:
> This patch adds basic DT bindings for the PL11x CLCD cells
> and make their fbdev driver use them, together with the
> Common Display Framework.
>
> The DT provides information about the hardware configuration
> and limitations (eg. the largest supported resolution)
> but the video modes come exclusively from the Common
> Display Framework drivers, referenced to by the standard CDF
> binding.
>
> Signed-off-by: Pawel Moll <pawel.moll@arm.com>
Much better.
I will point out though that there be all sorts of worms here when you
come to the previous ARM evaluation boards (which is why the capabilities
stuff got written in the first place) where there's a horrid mixture of
BGR/RGB ordering at various levels of the system - some of which must be
set correctly because the CLCD output isn't strictly used as R bits
G bits and B bits (to support different formats from the CLCD's native
formats.)
^ permalink raw reply
* Re: [PATCH RESEND] video: mxsfb: Fix colors display on lower color depth
From: Maxime Ripard @ 2013-04-22 10:19 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <201304221116.18080.marex@denx.de>
Hi Marek,
Le 22/04/2013 11:16, Marek Vasut a écrit :
> Dear Maxime Ripard,
>
>> The current code always registers as a 32 bits display, and uses the
>> hardware to drop the MSB of each color to abjust to the interface width
>> used by the panel.
>>
>> This results on 18 bits (and probably 16 bits display as well) in colors
>> being displayed poorly, because the MSB are obviously the most important
>> bits for each color definition.
>>
>> The default controller behaviour when using an interface width smaller
>> than the color depth is to drop the LSBs of each color, which makes more
>> sense because you lose the least important part of the color definition.
>>
>> So, to fix the colors display, just get back to the default controller
>> behaviour.
>>
>> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
>
> Did you receive my latest email? Check M28EVK (imx28-m28evk.dts), it uses 18bit
> LCD and works without this patch I think.
Thanks for the pointer. You mentionned in your other mail that it was
wired on 24bits but that the screen is actually 18 bits. I went to
search for the schematics to look at the wirings to see what could
differ, but I couldn't find any for the M28EVK. Are they publicly available?
Thanks,
Maxime
--
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply
* Re: [PATCH RESEND] video: mxsfb: Fix colors display on lower color depth
From: Maxime Ripard @ 2013-04-22 10:15 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <201304221108.17339.jbe@pengutronix.de>
Hi Juergen,
Le 22/04/2013 11:08, Juergen Beisert a écrit :
> Hi Maxime,
>
> Maxime Ripard wrote:
>> The current code always registers as a 32 bits display, and uses the
>> hardware to drop the MSB of each color to abjust to the interface width
>> used by the panel.
>>
>> This results on 18 bits (and probably 16 bits display as well) in colors
>> being displayed poorly, because the MSB are obviously the most important
>> bits for each color definition.
>
> But the "def_rgb666" bitfield description reports correctly to use bit 0..5
> for each colour component in this mode. Maybe your userland program has a bug
> and forgets to honor the bitfield description?
Hmmm, that might be the case actually, yes, I'll check into this and let
you know. Thanks!
--
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply
* [PATCH 4/4] ssd1307fb: Make use of horizontal addressing mode
From: Maxime Ripard @ 2013-04-22 10:02 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1366624945-5708-1-git-send-email-maxime.ripard@free-electrons.com>
By default, the ssd1307 controller uses an addressing mode called page
addressing. This mode only increments the column cursor in memory when
writing data but will not increments the page cursor when we are at the
end of the page.
However, the controller supports another addressing mode, called
horizontal addressing, that will maintain both the page and column
cursors when writing data to the controller.
That means that we can just remove the code that increments the current
page address and reset the column cursor when reaching the end of the
line, allowing to have a lower data overhead, and a simpler driver.
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
---
drivers/video/ssd1307fb.c | 51 +++++++++++++++++++++++++++++++++------------
1 file changed, 38 insertions(+), 13 deletions(-)
diff --git a/drivers/video/ssd1307fb.c b/drivers/video/ssd1307fb.c
index cab5f7c..259c9ee 100644
--- a/drivers/video/ssd1307fb.c
+++ b/drivers/video/ssd1307fb.c
@@ -19,6 +19,12 @@
#define SSD1307FB_DATA 0x40
#define SSD1307FB_COMMAND 0x80
+#define SSD1307FB_SET_ADDRESS_MODE 0x20
+#define SSD1307FB_SET_ADDRESS_MODE_HORIZONTAL (0x00)
+#define SSD1307FB_SET_ADDRESS_MODE_VERTICAL (0x01)
+#define SSD1307FB_SET_ADDRESS_MODE_PAGE (0x02)
+#define SSD1307FB_SET_COL_RANGE 0x21
+#define SSD1307FB_SET_PAGE_RANGE 0x22
#define SSD1307FB_CONTRAST 0x81
#define SSD1307FB_CHARGE_PUMP 0x8d
#define SSD1307FB_SEG_REMAP_ON 0xa1
@@ -135,9 +141,15 @@ static inline int ssd1307fb_write_data(struct i2c_client *client, u8 data)
static void ssd1307fb_update_display(struct ssd1307fb_par *par)
{
+ struct ssd1307fb_array *array;
u8 *vmem = par->info->screen_base;
int i, j, k;
+ array = ssd1307fb_alloc_array(par->width * par->height / 8,
+ SSD1307FB_DATA);
+ if (!array)
+ return;
+
/*
* The screen is divided in pages, each having a height of 8
* pixels, and the width of the screen. When sending a byte of
@@ -168,29 +180,22 @@ static void ssd1307fb_update_display(struct ssd1307fb_par *par)
*/
for (i = 0; i < (par->height / 8); i++) {
- struct ssd1307fb_array *array;
- ssd1307fb_write_cmd(par->client,
- SSD1307FB_START_PAGE_ADDRESS + i + par->page_offset);
- ssd1307fb_write_cmd(par->client, 0x00);
- ssd1307fb_write_cmd(par->client, 0x10);
-
- array = ssd1307fb_alloc_array(par->width, SSD1307FB_DATA);
-
for (j = 0; j < par->width; j++) {
- array->data[j] = 0;
+ u32 array_idx = i * par->width + j;
+ array->data[array_idx] = 0;
for (k = 0; k < 8; k++) {
u32 page_length = par->width * i;
u32 index = page_length + (par->width * k + j) / 8;
u8 byte = *(vmem + index);
u8 bit = byte & (1 << (j % 8));
bit = bit >> (j % 8);
- array->data[j] |= bit << k;
+ array->data[array_idx] |= bit << k;
}
}
-
- ssd1307fb_write_array(par->client, array, par->width);
- kfree(array);
}
+
+ ssd1307fb_write_array(par->client, array, par->width * par->height / 8);
+ kfree(array);
}
@@ -371,6 +376,26 @@ static int ssd1307fb_ssd1306_init(struct ssd1307fb_par *par)
if (ret < 0)
return ret;
+ /* Switch to horizontal addressing mode */
+ ret = ssd1307fb_write_cmd(par->client, SSD1307FB_SET_ADDRESS_MODE);
+ ret = ret & ssd1307fb_write_cmd(par->client,
+ SSD1307FB_SET_ADDRESS_MODE_HORIZONTAL);
+ if (ret < 0)
+ return ret;
+
+ ret = ssd1307fb_write_cmd(par->client, SSD1307FB_SET_COL_RANGE);
+ ret = ret & ssd1307fb_write_cmd(par->client, 0x0);
+ ret = ret & ssd1307fb_write_cmd(par->client, par->width - 1);
+ if (ret < 0)
+ return ret;
+
+ ret = ssd1307fb_write_cmd(par->client, SSD1307FB_SET_PAGE_RANGE);
+ ret = ret & ssd1307fb_write_cmd(par->client, 0x0);
+ ret = ret & ssd1307fb_write_cmd(par->client,
+ par->page_offset + (par->height / 8) - 1);
+ if (ret < 0)
+ return ret;
+
/* Turn on the display */
ret = ssd1307fb_write_cmd(par->client, SSD1307FB_DISPLAY_ON);
if (ret < 0)
--
1.7.10.4
^ permalink raw reply related
* [PATCH 3/4] ssd1307fb: Speed up the communication with the controller
From: Maxime Ripard @ 2013-04-22 10:02 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1366624945-5708-1-git-send-email-maxime.ripard@free-electrons.com>
The code until now was sending only 1pixel-wide page segment at once,
and started a new transfer every time. It has proven very inefficient,
because for one byte to display on the screen, we had to actually send 3
bytes over I2C: the address, the type of data that was going to the
controller, and then the actual data.
This patches changes that by sending a whole page at once, avoiding most
of this expensive overhead.
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
---
drivers/video/ssd1307fb.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/drivers/video/ssd1307fb.c b/drivers/video/ssd1307fb.c
index 35f5348..cab5f7c 100644
--- a/drivers/video/ssd1307fb.c
+++ b/drivers/video/ssd1307fb.c
@@ -168,23 +168,28 @@ static void ssd1307fb_update_display(struct ssd1307fb_par *par)
*/
for (i = 0; i < (par->height / 8); i++) {
+ struct ssd1307fb_array *array;
ssd1307fb_write_cmd(par->client,
SSD1307FB_START_PAGE_ADDRESS + i + par->page_offset);
ssd1307fb_write_cmd(par->client, 0x00);
ssd1307fb_write_cmd(par->client, 0x10);
+ array = ssd1307fb_alloc_array(par->width, SSD1307FB_DATA);
+
for (j = 0; j < par->width; j++) {
- u8 buf = 0;
+ array->data[j] = 0;
for (k = 0; k < 8; k++) {
u32 page_length = par->width * i;
u32 index = page_length + (par->width * k + j) / 8;
u8 byte = *(vmem + index);
u8 bit = byte & (1 << (j % 8));
bit = bit >> (j % 8);
- buf |= bit << k;
+ array->data[j] |= bit << k;
}
- ssd1307fb_write_data(par->client, buf);
}
+
+ ssd1307fb_write_array(par->client, array, par->width);
+ kfree(array);
}
}
--
1.7.10.4
^ permalink raw reply related
* [PATCH 2/4] ssd1307fb: Rework the communication functions
From: Maxime Ripard @ 2013-04-22 10:02 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1366624945-5708-1-git-send-email-maxime.ripard@free-electrons.com>
To efficiently send a whole page to the display, we need to be able to
manipulate more easily the data arrays that has to be sent to the OLED
controller. As such, this patch introduces a ssd1307fb_array structure
that handles both the small header to be sent over i2c, which contains
the type of information sent, and the raw bytes after that.
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
---
drivers/video/ssd1307fb.c | 77 +++++++++++++++++++++++++++++----------------
1 file changed, 50 insertions(+), 27 deletions(-)
diff --git a/drivers/video/ssd1307fb.c b/drivers/video/ssd1307fb.c
index 5ab5281..35f5348 100644
--- a/drivers/video/ssd1307fb.c
+++ b/drivers/video/ssd1307fb.c
@@ -51,6 +51,11 @@ struct ssd1307fb_par {
u32 width;
};
+struct ssd1307fb_array {
+ u8 type;
+ u8 data[0];
+};
+
static struct fb_fix_screeninfo ssd1307fb_fix = {
.id = "Solomon SSD1307",
.type = FB_TYPE_PACKED_PIXELS,
@@ -65,49 +70,67 @@ static struct fb_var_screeninfo ssd1307fb_var = {
.bits_per_pixel = 1,
};
-static int ssd1307fb_write_array(struct i2c_client *client, u8 type, u8 *cmd, u32 len)
+static struct ssd1307fb_array *ssd1307fb_alloc_array(u32 len, u8 type)
{
- u8 *buf;
- int ret = 0;
-
- buf = kzalloc(len + 1, GFP_KERNEL);
- if (!buf) {
- dev_err(&client->dev, "Couldn't allocate sending buffer.\n");
- return -ENOMEM;
- }
+ struct ssd1307fb_array *array;
- buf[0] = type;
- memcpy(buf + 1, cmd, len);
+ array = kzalloc(sizeof(struct ssd1307fb_array) + len, GFP_KERNEL);
+ if (!array)
+ return NULL;
- ret = i2c_master_send(client, buf, len + 1);
- if (ret != len + 1) {
- dev_err(&client->dev, "Couldn't send I2C command.\n");
- goto error;
- }
+ array->type = type;
-error:
- kfree(buf);
- return ret;
+ return array;
}
-static inline int ssd1307fb_write_cmd_array(struct i2c_client *client, u8 *cmd, u32 len)
+static int ssd1307fb_write_array(struct i2c_client *client,
+ struct ssd1307fb_array *array, u32 len)
{
- return ssd1307fb_write_array(client, SSD1307FB_COMMAND, cmd, len);
+ int ret;
+
+ len += sizeof(struct ssd1307fb_array);
+
+ ret = i2c_master_send(client, (u8 *)array, len);
+ if (ret != len) {
+ dev_err(&client->dev, "Couldn't send I2C command.\n");
+ return ret;
+ }
+
+ return 0;
}
static inline int ssd1307fb_write_cmd(struct i2c_client *client, u8 cmd)
{
- return ssd1307fb_write_cmd_array(client, &cmd, 1);
-}
+ struct ssd1307fb_array *array;
+ int ret;
-static inline int ssd1307fb_write_data_array(struct i2c_client *client, u8 *cmd, u32 len)
-{
- return ssd1307fb_write_array(client, SSD1307FB_DATA, cmd, len);
+ array = ssd1307fb_alloc_array(1, SSD1307FB_COMMAND);
+ if (!array)
+ return -ENOMEM;
+
+ array->data[0] = cmd;
+
+ ret = ssd1307fb_write_array(client, array, 1);
+ kfree(array);
+
+ return ret;
}
static inline int ssd1307fb_write_data(struct i2c_client *client, u8 data)
{
- return ssd1307fb_write_data_array(client, &data, 1);
+ struct ssd1307fb_array *array;
+ int ret;
+
+ array = ssd1307fb_alloc_array(1, SSD1307FB_DATA);
+ if (!array)
+ return -ENOMEM;
+
+ array->data[0] = data;
+
+ ret = ssd1307fb_write_array(client, array, 1);
+ kfree(array);
+
+ return ret;
}
static void ssd1307fb_update_display(struct ssd1307fb_par *par)
--
1.7.10.4
^ permalink raw reply related
* [PATCH 1/4] ARM: cfa10036: dt: Change i2c0 clock frequency
From: Maxime Ripard @ 2013-04-22 10:02 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1366624945-5708-1-git-send-email-maxime.ripard@free-electrons.com>
The OLED display can work faster. Change the i2c controller clock
frequency to remove the tearing effect that can be seen on the display.
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
---
arch/arm/boot/dts/imx28-cfa10036.dts | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm/boot/dts/imx28-cfa10036.dts b/arch/arm/boot/dts/imx28-cfa10036.dts
index 40488f5a8..a524caf 100644
--- a/arch/arm/boot/dts/imx28-cfa10036.dts
+++ b/arch/arm/boot/dts/imx28-cfa10036.dts
@@ -67,6 +67,7 @@
i2c0: i2c@80058000 {
pinctrl-names = "default";
pinctrl-0 = <&i2c0_pins_b>;
+ clock-frequency = <400000>;
status = "okay";
ssd1306: oled@3c {
--
1.7.10.4
^ permalink raw reply related
* [PATCH 0/4] drivers: video: Optimisations for the ssd1307fb driver
From: Maxime Ripard @ 2013-04-22 10:02 UTC (permalink / raw)
To: linux-arm-kernel
Hi everyone,
This is a patchset to improve significantly (by an order of magnitude)
the refreshing time of the SSD1306 and SSD1307.
We do so by sending the pixels by batches, instead of 8 at a time,
combined with some additionnal features found on these controllers
that allows to send a whole screen content at once.
This obviously removes the tearing effect that was previously seen
with these controllers.
This patchset depends on the "Add support for the Solomon SSD1306 OLED
Controller" I sent previously.
Thanks,
Maxime
Maxime Ripard (4):
ARM: cfa10036: dt: Change i2c0 clock frequency
ssd1307fb: Rework the communication functions
ssd1307fb: Speed up the communication with the controller
ssd1307fb: Make use of horizontal addressing mode
arch/arm/boot/dts/imx28-cfa10036.dts | 1 +
drivers/video/ssd1307fb.c | 123 ++++++++++++++++++++++++----------
2 files changed, 89 insertions(+), 35 deletions(-)
--
1.7.10.4
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox