Linux Framebuffer Layer development
 help / color / mirror / Atom feed
* Re: [PATCH 42/51] DMA-API: usb: musb: use platform_device_register_full() to avoid directly messing
From: Felipe Balbi @ 2013-09-20 13:11 UTC (permalink / raw)
  To: Russell King
  Cc: alsa-devel, linux-doc, linux-mmc, linux-fbdev, linux-nvme,
	linux-ide, devel, linux-samsung-soc, linux-scsi, e1000-devel,
	b43-dev, linux-media, devicetree, dri-devel, linux-tegra,
	linux-omap, linux-arm-kernel, Solarflare linux maintainers,
	netdev, linux-usb, linux-wireless, Felipe Balbi, linux-crypto,
	Greg Kroah-Hartman, uclinux-dist-devel, linuxppc-dev
In-Reply-To: <E1VMnQk-0007sX-Ty@rmk-PC.arm.linux.org.uk>

[-- Attachment #1: Type: text/plain, Size: 731 bytes --]

Hi,

On Fri, Sep 20, 2013 at 12:14:38AM +0100, Russell King wrote:
> Use platform_device_register_full() for those drivers which can, to
> avoid messing directly with DMA masks.  This can only be done when
> the driver does not need to access the allocated musb platform device
> from within its callbacks, which may be called during the musb
> device probing.
> 
> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

you want me to carry this one through my tree or you prefer getting my
Acked-by ? Either way works for me:

Acked-by: Felipe Balbi <balbi@ti.com>

there's also the third option of me setting up a branch with only this
patch and we both merge it, that'd also work.

cheers

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply

* Re: [PATCH 39/51] DMA-API: others: use dma_set_coherent_mask()
From: Tejun Heo @ 2013-09-20 12:18 UTC (permalink / raw)
  To: Russell King
  Cc: alsa-devel, b43-dev, devel, devicetree, dri-devel, e1000-devel,
	linux-arm-kernel, linux-crypto, linux-doc, linux-fbdev, linux-ide,
	linux-media, linux-mmc, linux-nvme, linux-omap, linuxppc-dev,
	linux-samsung-soc, linux-scsi, linux-tegra, linux-usb,
	linux-wireless, netdev, Solarflare linux maintainers,
	uclinux-dist-devel, Inki Dae, Joonyoung Shim, Seung-Woo Kim, Kyun
In-Reply-To: <20130920121652.GA7630@mtj.dyndns.org>

On Fri, Sep 20, 2013 at 07:16:52AM -0500, Tejun Heo wrote:
> On Fri, Sep 20, 2013 at 12:11:38AM +0100, Russell King wrote:
> > The correct way for a driver to specify the coherent DMA mask is
> > not to directly access the field in the struct device, but to use
> > dma_set_coherent_mask().  Only arch and bus code should access this
> > member directly.
> > 
> > Convert all direct write accesses to using the correct API.
> > 
> > Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
> 
> Acked-by: Tejun Heo <tj@kernel.org>
> 
> The patch is pretty widely spread.  I don't mind how it gets routed
> but what's the plan?

Hmm... maybe hte pata_ixp4xx_cf.c part should be moved to the one
which updates pata_octeon_cf.c?

Thanks.

-- 
tejun

^ permalink raw reply

* Re: [PATCH 39/51] DMA-API: others: use dma_set_coherent_mask()
From: Tejun Heo @ 2013-09-20 12:16 UTC (permalink / raw)
  To: Russell King
  Cc: alsa-devel, linux-doc, David Airlie, linux-mmc, linux-fbdev,
	linux-nvme, linux-ide, devel, linux-samsung-soc, Joonyoung Shim,
	linux-scsi, e1000-devel, Seung-Woo Kim, b43-dev, linux-media,
	devicetree, Inki Dae, Kukjin Kim, dri-devel, linux-tegra,
	linux-omap, linux-arm-kernel, Solarflare linux maintainers,
	netdev, linux-usb, linux-wireless, Kyungmin Park
In-Reply-To: <E1VMnNq-0007s4-HN@rmk-PC.arm.linux.org.uk>

On Fri, Sep 20, 2013 at 12:11:38AM +0100, Russell King wrote:
> The correct way for a driver to specify the coherent DMA mask is
> not to directly access the field in the struct device, but to use
> dma_set_coherent_mask().  Only arch and bus code should access this
> member directly.
> 
> Convert all direct write accesses to using the correct API.
> 
> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

Acked-by: Tejun Heo <tj@kernel.org>

The patch is pretty widely spread.  I don't mind how it gets routed
but what's the plan?

Thanks.

-- 
tejun

^ permalink raw reply

* Re: [PATCH v3 0/5] ARM: vf610: Add DCU framebuffer driver for Vybrid VF610 platform
From: Tomi Valkeinen @ 2013-09-20 10:04 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <81BA6E5E0BC2344391CABCEE22D1B6D842FD6A@039-SN1MPN1-003.039d.mgd.msft.net>

[-- Attachment #1: Type: text/plain, Size: 1546 bytes --]

On 13/09/13 10:07, Wang Huan-B18965 wrote:
> My comments inline.
> 
>> -----Original Message----- From: Tomi Valkeinen
>> [mailto:tomi.valkeinen@ti.com] Sent: Wednesday, September 04, 2013
>> 6:33 PM To: Wang Huan-B18965 Cc: plagnioj@jcrosoft.com;
>> linux-fbdev@vger.kernel.org; linux-arm- kernel@lists.infradead.org;
>> Jin Zhengxiong-R64188; Estevam Fabio-R49496; shawn.guo@linaro.org 
>> Subject: Re: [PATCH v3 0/5] ARM: vf610: Add DCU framebuffer driver
>> for Vybrid VF610 platform
>> 
>> Hi,
>> 
>> On 03/09/13 11:21, Wang Huan-B18965 wrote:
>>> Hi, Jean-Christophe, Tomi,
>>> 
>>> Could you please help to review these patches? Thanks!
>> 
>> There seemed to be some strong opinions that there should be a drm 
>> driver for this hardware, instead of an fb driver. So as there
>> seems to be disagreements about this, I'll leave this series to
>> Jean-Christophe, who's the primary maintainer.
> [Alison Wang]
> 
> Thanks for Tomi's comments.
> 
> I agree that we can implement the DRM driver for the DCU. As the
> bandwidth limitation, I suggest we use the fb driver firstly. On the
> other hand, the fb driver can meet the application requirement based
> on this SoC. We'll try to provide the DRM driver when this IP
> integrated into other SoC.

If you plan to move to DRM driver anyway, I would strongly suggest
merging only the DRM driver. If we merge the fb driver, and a bit later
the DRM driver for the same hardware, we'll have two drivers of which
the other is already deprecated.

 Tomi


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 901 bytes --]

^ permalink raw reply

* Re: [PATCH 00/19] video: use dev_get_platdata()
From: Tomi Valkeinen @ 2013-09-20  9:24 UTC (permalink / raw)
  To: linux-fbdev
In-Reply-To: <000401ceb361$d84c4600$88e4d200$%han@samsung.com>

[-- Attachment #1: Type: text/plain, Size: 1357 bytes --]

On 17/09/13 07:53, Jingoo Han wrote:
> Use the wrapper function for retrieving the platform data instead of
> accessing dev->platform_data directly. This is a cosmetic change
> to make the code simpler and enhance the readability.
> 
> ---
>  drivers/video/amba-clcd.c        |    2 +-
>  drivers/video/atmel_lcdfb.c      |    4 ++--
>  drivers/video/da8xx-fb.c         |    4 ++--
>  drivers/video/ep93xx-fb.c        |    2 +-
>  drivers/video/imxfb.c            |    6 +++---
>  drivers/video/mbx/mbxfb.c        |    2 +-
>  drivers/video/mx3fb.c            |    4 ++--
>  drivers/video/nuc900fb.c         |    6 +++---
>  drivers/video/omap/hwa742.c      |    2 +-
>  drivers/video/omap/omapfb_main.c |    4 ++--
>  drivers/video/pxa168fb.c         |    6 +++---
>  drivers/video/pxafb.c            |   16 ++++++++--------
>  drivers/video/s1d13xxxfb.c       |   12 ++++++------
>  drivers/video/s3c-fb.c           |    2 +-
>  drivers/video/s3c2410fb.c        |    6 +++---
>  drivers/video/sa1100fb.c         |    4 ++--
>  drivers/video/sh_mobile_hdmi.c   |    6 +++---
>  drivers/video/simplefb.c         |    4 ++--
>  drivers/video/tmiofb.c           |   10 +++++-----
>  drivers/video/w100fb.c           |    2 +-
>  20 files changed, 52 insertions(+), 52 deletions(-)
> 
> 

Thanks, applying for 3.13.

 Tomi



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 901 bytes --]

^ permalink raw reply

* Re: [PATCH] radeon: Conditionally compile PM code
From: Tomi Valkeinen @ 2013-09-20  9:17 UTC (permalink / raw)
  To: Thierry Reding, Benjamin Herrenschmidt,
	Jean-Christophe Plagniol-Villard
  Cc: linux-fbdev, linux-kernel
In-Reply-To: <1379508512-30155-1-git-send-email-treding@nvidia.com>

[-- Attachment #1: Type: text/plain, Size: 326 bytes --]

On 18/09/13 15:48, Thierry Reding wrote:
> The power management code is only used on X86 and PowerMac. To prevent
> the compiler from warning about unused code, only build when PM and one
> of X86 or PowerMac is selected.
> 
> Signed-off-by: Thierry Reding <treding@nvidia.com>

Thanks, applied for 3.13.

 Tomi



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 901 bytes --]

^ permalink raw reply

* Re: [PATCH 1/1] video: grvga: Use module_platform_driver
From: Tomi Valkeinen @ 2013-09-20  9:03 UTC (permalink / raw)
  To: linux-fbdev
In-Reply-To: <1379658938-18080-1-git-send-email-sachin.kamat@linaro.org>

[-- Attachment #1: Type: text/plain, Size: 380 bytes --]

On 20/09/13 09:35, Sachin Kamat wrote:
> module_platform_driver removes some boilerplate code and makes
> it simple.
> 
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
> Cc: Kristoffer Glembo <kristoffer@gaisler.com>
> ---
>  drivers/video/grvga.c |   14 +-------------
>  1 file changed, 1 insertion(+), 13 deletions(-)

Thanks, applied for 3.13.

 Tomi



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 901 bytes --]

^ permalink raw reply

* Re: [PATCH 2/2] framebuffer: Remove pmag-aa-fb
From: Geert Uytterhoeven @ 2013-09-20  7:33 UTC (permalink / raw)
  To: Joe Perches, Maciej W. Rozycki
  Cc: Jean-Christophe Plagniol-Villard, Tomi Valkeinen,
	Linux Fbdev development list, linux-kernel@vger.kernel.org,
	Linux MIPS Mailing List
In-Reply-To: <6f500d88eb23fd9a4cfc5583f5ca17bc5f58fe24.1379641901.git.joe@perches.com>

Adding Maciej and linux-mips

On Fri, Sep 20, 2013 at 3:53 AM, Joe Perches <joe@perches.com> wrote:
> This driver apparently hasn't compiled since 2.5 days as
> it uses a #define that isn't around anymore.
>
> Remove it.
>
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
>  drivers/video/Kconfig      |  10 -
>  drivers/video/Makefile     |   1 -
>  drivers/video/pmag-aa-fb.c | 510 ---------------------------------------------
>  3 files changed, 521 deletions(-)
>  delete mode 100644 drivers/video/pmag-aa-fb.c
>
> diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
> index 14317b7..e92798e 100644
> --- a/drivers/video/Kconfig
> +++ b/drivers/video/Kconfig
> @@ -1821,16 +1821,6 @@ config FB_HIT
>           This is the frame buffer device driver for the Hitachi HD64461 LCD
>           frame buffer card.
>
> -config FB_PMAG_AA
> -       bool "PMAG-AA TURBOchannel framebuffer support"
> -       depends on (FB = y) && TC
> -       select FB_CFB_FILLRECT
> -       select FB_CFB_COPYAREA
> -       select FB_CFB_IMAGEBLIT
> -       help
> -         Support for the PMAG-AA TURBOchannel framebuffer card (1280x1024x1)
> -         used mainly in the MIPS-based DECstation series.
> -
>  config FB_PMAG_BA
>         tristate "PMAG-BA TURBOchannel framebuffer support"
>         depends on FB && TC
> diff --git a/drivers/video/Makefile b/drivers/video/Makefile
> index e8bae8d..5c8b340 100644
> --- a/drivers/video/Makefile
> +++ b/drivers/video/Makefile
> @@ -114,7 +114,6 @@ obj-$(CONFIG_FB_AU1100)               += au1100fb.o
>  obj-$(CONFIG_FB_AU1200)                  += au1200fb.o
>  obj-$(CONFIG_FB_VT8500)                  += vt8500lcdfb.o
>  obj-$(CONFIG_FB_WM8505)                  += wm8505fb.o
> -obj-$(CONFIG_FB_PMAG_AA)         += pmag-aa-fb.o
>  obj-$(CONFIG_FB_PMAG_BA)         += pmag-ba-fb.o
>  obj-$(CONFIG_FB_PMAGB_B)         += pmagb-b-fb.o
>  obj-$(CONFIG_FB_MAXINE)                  += maxinefb.o
> diff --git a/drivers/video/pmag-aa-fb.c b/drivers/video/pmag-aa-fb.c
> deleted file mode 100644

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply

* Re: [PATCH 01/15] video: atmel_lcdfb: Remove redundant dev_set_drvdata
From: Nicolas Ferre @ 2013-09-20  7:24 UTC (permalink / raw)
  To: linux-fbdev
In-Reply-To: <1379658744-17113-2-git-send-email-sachin.kamat@linaro.org>

On 20/09/2013 08:32, Sachin Kamat :
> Driver core sets driver data to NULL upon failure or remove.
>
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
> Cc: Nicolas Ferre <nicolas.ferre@atmel.com>

Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>

> ---
>   drivers/video/atmel_lcdfb.c |    2 --
>   1 file changed, 2 deletions(-)
>
> diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c
> index 34e934d..70052e7 100644
> --- a/drivers/video/atmel_lcdfb.c
> +++ b/drivers/video/atmel_lcdfb.c
> @@ -1318,7 +1318,6 @@ static int __init atmel_lcdfb_probe(struct platform_device *pdev)
>   	return 0;
>
>   reset_drvdata:
> -	dev_set_drvdata(dev, NULL);
>   	fb_dealloc_cmap(&info->cmap);
>   unregister_irqs:
>   	cancel_work_sync(&sinfo->task);
> @@ -1379,7 +1378,6 @@ static int __exit atmel_lcdfb_remove(struct platform_device *pdev)
>   		atmel_lcdfb_free_video_memory(sinfo);
>   	}
>
> -	dev_set_drvdata(dev, NULL);
>   	framebuffer_release(info);
>
>   	return 0;
>


-- 
Nicolas Ferre

^ permalink raw reply

* [RFC PATCH] video: Use fb_sys_write rather than open-coding in drivers
From: Ryan Mallon @ 2013-09-20  7:06 UTC (permalink / raw)
  To: Jean-Christophe PLAGNIOL-VILLARD, tomi.valkeinen
  Cc: linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org

Several video drivers open code the fb_write write function with code
which is very similar to fb_sys_write. Replace the open code versions
with calls to fb_sys_write. An fb_sync callback is added to each of
the drivers.
    
Signed-off-by: Ryan Mallon <rmallon@gmail.com>
---

diff --git a/drivers/video/auo_k190x.c b/drivers/video/auo_k190x.c
index 8d2499d..0eeeb26 100644
--- a/drivers/video/auo_k190x.c
+++ b/drivers/video/auo_k190x.c
@@ -362,50 +362,12 @@ out:
  * framebuffer operations
  */
 
-/*
- * this is the slow path from userspace. they can seek and write to
- * the fb. it's inefficient to do anything less than a full screen draw
- */
-static ssize_t auok190xfb_write(struct fb_info *info, const char __user *buf,
-				size_t count, loff_t *ppos)
+static int auok190xfb_sync(struct fb_info *info)
 {
 	struct auok190xfb_par *par = info->par;
-	unsigned long p = *ppos;
-	void *dst;
-	int err = 0;
-	unsigned long total_size;
-
-	if (info->state != FBINFO_STATE_RUNNING)
-		return -EPERM;
-
-	total_size = info->fix.smem_len;
-
-	if (p > total_size)
-		return -EFBIG;
-
-	if (count > total_size) {
-		err = -EFBIG;
-		count = total_size;
-	}
-
-	if (count + p > total_size) {
-		if (!err)
-			err = -ENOSPC;
-
-		count = total_size - p;
-	}
-
-	dst = (void *)(info->screen_base + p);
-
-	if (copy_from_user(dst, buf, count))
-		err = -EFAULT;
-
-	if  (!err)
-		*ppos += count;
 
 	par->update_all(par);
-
-	return (err) ? err : count;
+	return 0;
 }
 
 static void auok190xfb_fillrect(struct fb_info *info,
@@ -565,7 +527,8 @@ static int auok190xfb_set_par(struct fb_info *info)
 static struct fb_ops auok190xfb_ops = {
 	.owner		= THIS_MODULE,
 	.fb_read	= fb_sys_read,
-	.fb_write	= auok190xfb_write,
+	.fb_write	= fb_sys_write,
+	.fb_sync	= auok190xfb_sync,
 	.fb_fillrect	= auok190xfb_fillrect,
 	.fb_copyarea	= auok190xfb_copyarea,
 	.fb_imageblit	= auok190xfb_imageblit,
@@ -1066,6 +1029,7 @@ int auok190x_common_probe(struct platform_device *pdev,
 
 	memset(videomemory, 0, videomemorysize);
 	info->screen_base = (char *)videomemory;
+	info->screen_size = videomemorysize;
 	info->fix.smem_len = videomemorysize;
 
 	info->flags = FBINFO_FLAG_DEFAULT | FBINFO_VIRTFB;
diff --git a/drivers/video/broadsheetfb.c b/drivers/video/broadsheetfb.c
index b09701c..4d6231a 100644
--- a/drivers/video/broadsheetfb.c
+++ b/drivers/video/broadsheetfb.c
@@ -924,6 +924,14 @@ static void broadsheetfb_dpy_update(struct broadsheetfb_par *par)
 	mutex_unlock(&(par->io_lock));
 }
 
+static int broadsheetfb_sync(struct fb_info *info)
+{
+	struct broadsheetfb_par *par = info->par;
+
+	broadsheetfb_dpy_update(par);
+	return 0;
+}
+
 /* this is called back from the deferred io workqueue */
 static void broadsheetfb_dpy_deferred_io(struct fb_info *info,
 				struct list_head *pagelist)
@@ -998,56 +1006,11 @@ static void broadsheetfb_imageblit(struct fb_info *info,
 	broadsheetfb_dpy_update(par);
 }
 
-/*
- * this is the slow path from userspace. they can seek and write to
- * the fb. it's inefficient to do anything less than a full screen draw
- */
-static ssize_t broadsheetfb_write(struct fb_info *info, const char __user *buf,
-				size_t count, loff_t *ppos)
-{
-	struct broadsheetfb_par *par = info->par;
-	unsigned long p = *ppos;
-	void *dst;
-	int err = 0;
-	unsigned long total_size;
-
-	if (info->state != FBINFO_STATE_RUNNING)
-		return -EPERM;
-
-	total_size = info->fix.smem_len;
-
-	if (p > total_size)
-		return -EFBIG;
-
-	if (count > total_size) {
-		err = -EFBIG;
-		count = total_size;
-	}
-
-	if (count + p > total_size) {
-		if (!err)
-			err = -ENOSPC;
-
-		count = total_size - p;
-	}
-
-	dst = (void *)(info->screen_base + p);
-
-	if (copy_from_user(dst, buf, count))
-		err = -EFAULT;
-
-	if  (!err)
-		*ppos += count;
-
-	broadsheetfb_dpy_update(par);
-
-	return (err) ? err : count;
-}
-
 static struct fb_ops broadsheetfb_ops = {
 	.owner		= THIS_MODULE,
 	.fb_read        = fb_sys_read,
-	.fb_write	= broadsheetfb_write,
+	.fb_write	= fb_sys_write,
+	.fb_sync	= broadsheetfb_sync,
 	.fb_fillrect	= broadsheetfb_fillrect,
 	.fb_copyarea	= broadsheetfb_copyarea,
 	.fb_imageblit	= broadsheetfb_imageblit,
@@ -1106,6 +1069,7 @@ static int broadsheetfb_probe(struct platform_device *dev)
 		goto err_fb_rel;
 
 	info->screen_base = (char *)videomemory;
+	info->screen_size = videomemorysize;
 	info->fbops = &broadsheetfb_ops;
 
 	broadsheetfb_var.xres = dpyw;
diff --git a/drivers/video/hecubafb.c b/drivers/video/hecubafb.c
index 59d2318..e8361e1 100644
--- a/drivers/video/hecubafb.c
+++ b/drivers/video/hecubafb.c
@@ -114,6 +114,14 @@ static void hecubafb_dpy_update(struct hecubafb_par *par)
 	apollo_send_command(par, APOLLO_DISPLAY_IMG);
 }
 
+static int hecubafb_sync(struct fb_info *info)
+{
+	struct hecubafb_par *par = info->par;
+
+	hecubafb_dpy_update(par);
+	return 0;
+}
+
 /* this is called back from the deferred io workqueue */
 static void hecubafb_dpy_deferred_io(struct fb_info *info,
 				struct list_head *pagelist)
@@ -151,56 +159,11 @@ static void hecubafb_imageblit(struct fb_info *info,
 	hecubafb_dpy_update(par);
 }
 
-/*
- * this is the slow path from userspace. they can seek and write to
- * the fb. it's inefficient to do anything less than a full screen draw
- */
-static ssize_t hecubafb_write(struct fb_info *info, const char __user *buf,
-				size_t count, loff_t *ppos)
-{
-	struct hecubafb_par *par = info->par;
-	unsigned long p = *ppos;
-	void *dst;
-	int err = 0;
-	unsigned long total_size;
-
-	if (info->state != FBINFO_STATE_RUNNING)
-		return -EPERM;
-
-	total_size = info->fix.smem_len;
-
-	if (p > total_size)
-		return -EFBIG;
-
-	if (count > total_size) {
-		err = -EFBIG;
-		count = total_size;
-	}
-
-	if (count + p > total_size) {
-		if (!err)
-			err = -ENOSPC;
-
-		count = total_size - p;
-	}
-
-	dst = (void __force *) (info->screen_base + p);
-
-	if (copy_from_user(dst, buf, count))
-		err = -EFAULT;
-
-	if  (!err)
-		*ppos += count;
-
-	hecubafb_dpy_update(par);
-
-	return (err) ? err : count;
-}
-
 static struct fb_ops hecubafb_ops = {
 	.owner		= THIS_MODULE,
 	.fb_read        = fb_sys_read,
-	.fb_write	= hecubafb_write,
+	.fb_write	= fb_sys_write,
+	.fb_sync	= hecubafb_sync,
 	.fb_fillrect	= hecubafb_fillrect,
 	.fb_copyarea	= hecubafb_copyarea,
 	.fb_imageblit	= hecubafb_imageblit,
@@ -240,6 +203,7 @@ static int hecubafb_probe(struct platform_device *dev)
 		goto err_fballoc;
 
 	info->screen_base = (char __force __iomem *)videomemory;
+	info->screen_size = videomemorysize;
 	info->fbops = &hecubafb_ops;
 
 	info->var = hecubafb_var;
diff --git a/drivers/video/metronomefb.c b/drivers/video/metronomefb.c
index f30150d..7f79916 100644
--- a/drivers/video/metronomefb.c
+++ b/drivers/video/metronomefb.c
@@ -447,6 +447,14 @@ static void metronomefb_dpy_update(struct metronomefb_par *par)
 	metronome_display_cmd(par);
 }
 
+static int metronomefb_sync(struct fb_info *info)
+{
+	struct metronomefb_par *par = info->par;
+
+	metronomefb_dpy_udpate(par);
+	return 0;
+}
+
 static u16 metronomefb_dpy_update_page(struct metronomefb_par *par, int index)
 {
 	int i;
@@ -510,55 +518,10 @@ static void metronomefb_imageblit(struct fb_info *info,
 	metronomefb_dpy_update(par);
 }
 
-/*
- * this is the slow path from userspace. they can seek and write to
- * the fb. it is based on fb_sys_write
- */
-static ssize_t metronomefb_write(struct fb_info *info, const char __user *buf,
-				size_t count, loff_t *ppos)
-{
-	struct metronomefb_par *par = info->par;
-	unsigned long p = *ppos;
-	void *dst;
-	int err = 0;
-	unsigned long total_size;
-
-	if (info->state != FBINFO_STATE_RUNNING)
-		return -EPERM;
-
-	total_size = info->fix.smem_len;
-
-	if (p > total_size)
-		return -EFBIG;
-
-	if (count > total_size) {
-		err = -EFBIG;
-		count = total_size;
-	}
-
-	if (count + p > total_size) {
-		if (!err)
-			err = -ENOSPC;
-
-		count = total_size - p;
-	}
-
-	dst = (void __force *)(info->screen_base + p);
-
-	if (copy_from_user(dst, buf, count))
-		err = -EFAULT;
-
-	if  (!err)
-		*ppos += count;
-
-	metronomefb_dpy_update(par);
-
-	return (err) ? err : count;
-}
-
 static struct fb_ops metronomefb_ops = {
 	.owner		= THIS_MODULE,
-	.fb_write	= metronomefb_write,
+	.fb_write	= fb_sys_write,
+	.fb_sync	= metronomefb_sync,
 	.fb_fillrect	= metronomefb_fillrect,
 	.fb_copyarea	= metronomefb_copyarea,
 	.fb_imageblit	= metronomefb_imageblit,
@@ -633,6 +596,7 @@ static int metronomefb_probe(struct platform_device *dev)
 		goto err_fb_rel;
 
 	info->screen_base = (char __force __iomem *)videomemory;
+	info->screen_size = videomemorysize;
 	info->fbops = &metronomefb_ops;
 
 	metronomefb_fix.line_length = fw;
diff --git a/drivers/video/ssd1307fb.c b/drivers/video/ssd1307fb.c
index 44967c8..2b46790 100644
--- a/drivers/video/ssd1307fb.c
+++ b/drivers/video/ssd1307fb.c
@@ -198,36 +198,12 @@ static void ssd1307fb_update_display(struct ssd1307fb_par *par)
 	kfree(array);
 }
 
-
-static ssize_t ssd1307fb_write(struct fb_info *info, const char __user *buf,
-		size_t count, loff_t *ppos)
+static int ssd1307fb_sync(struct fb_info *info)
 {
 	struct ssd1307fb_par *par = info->par;
-	unsigned long total_size;
-	unsigned long p = *ppos;
-	u8 __iomem *dst;
-
-	total_size = info->fix.smem_len;
-
-	if (p > total_size)
-		return -EINVAL;
-
-	if (count + p > total_size)
-		count = total_size - p;
-
-	if (!count)
-		return -EINVAL;
-
-	dst = (void __force *) (info->screen_base + p);
-
-	if (copy_from_user(dst, buf, count))
-		return -EFAULT;
 
 	ssd1307fb_update_display(par);
-
-	*ppos += count;
-
-	return count;
+	return 0;
 }
 
 static void ssd1307fb_fillrect(struct fb_info *info, const struct fb_fillrect *rect)
@@ -254,7 +230,8 @@ static void ssd1307fb_imageblit(struct fb_info *info, const struct fb_image *ima
 static struct fb_ops ssd1307fb_ops = {
 	.owner		= THIS_MODULE,
 	.fb_read	= fb_sys_read,
-	.fb_write	= ssd1307fb_write,
+	.fb_write	= fb_sys_write,
+	.fb_sync	= ssd1307fb_sync,
 	.fb_fillrect	= ssd1307fb_fillrect,
 	.fb_copyarea	= ssd1307fb_copyarea,
 	.fb_imageblit	= ssd1307fb_imageblit,
@@ -493,6 +470,7 @@ static int ssd1307fb_probe(struct i2c_client *client,
 	info->var.blue.offset = 0;
 
 	info->screen_base = (u8 __force __iomem *)vmem;
+	info->screen_size = vmem_size;
 	info->fix.smem_start = (unsigned long)vmem;
 	info->fix.smem_len = vmem_size;
 


^ permalink raw reply related

* [PATCH 2/2] backlight: tosa: Remove redundant spi_set_drvdata
From: Sachin Kamat @ 2013-09-20  6:50 UTC (permalink / raw)
  To: linux-fbdev

Driver core sets driver data to NULL upon failure or remove.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
 drivers/video/backlight/tosa_lcd.c |    6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/video/backlight/tosa_lcd.c b/drivers/video/backlight/tosa_lcd.c
index bf08157..be5d636 100644
--- a/drivers/video/backlight/tosa_lcd.c
+++ b/drivers/video/backlight/tosa_lcd.c
@@ -198,7 +198,7 @@ static int tosa_lcd_probe(struct spi_device *spi)
 	ret = devm_gpio_request_one(&spi->dev, TOSA_GPIO_TG_ON,
 				GPIOF_OUT_INIT_LOW, "tg #pwr");
 	if (ret < 0)
-		goto err_gpio_tg;
+		return ret;
 
 	mdelay(60);
 
@@ -219,8 +219,6 @@ static int tosa_lcd_probe(struct spi_device *spi)
 
 err_register:
 	tosa_lcd_tg_off(data);
-err_gpio_tg:
-	spi_set_drvdata(spi, NULL);
 	return ret;
 }
 
@@ -235,8 +233,6 @@ static int tosa_lcd_remove(struct spi_device *spi)
 
 	tosa_lcd_tg_off(data);
 
-	spi_set_drvdata(spi, NULL);
-
 	return 0;
 }
 
-- 
1.7.9.5


^ permalink raw reply related

* [PATCH 1/2] backlight: l4f00242t03: Remove redundant spi_set_drvdata
From: Sachin Kamat @ 2013-09-20  6:50 UTC (permalink / raw)
  To: linux-fbdev

Driver core sets driver data to NULL upon failure or remove.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
 drivers/video/backlight/l4f00242t03.c |    1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/video/backlight/l4f00242t03.c b/drivers/video/backlight/l4f00242t03.c
index a35a38c..59eebe0 100644
--- a/drivers/video/backlight/l4f00242t03.c
+++ b/drivers/video/backlight/l4f00242t03.c
@@ -244,7 +244,6 @@ static int l4f00242t03_remove(struct spi_device *spi)
 
 	l4f00242t03_lcd_power_set(priv->ld, FB_BLANK_POWERDOWN);
 	lcd_device_unregister(priv->ld);
-	spi_set_drvdata(spi, NULL);
 
 	return 0;
 }
-- 
1.7.9.5


^ permalink raw reply related

* [PATCH 1/1] video: grvga: Use module_platform_driver
From: Sachin Kamat @ 2013-09-20  6:47 UTC (permalink / raw)
  To: linux-fbdev

module_platform_driver removes some boilerplate code and makes
it simple.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Cc: Kristoffer Glembo <kristoffer@gaisler.com>
---
 drivers/video/grvga.c |   14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)

diff --git a/drivers/video/grvga.c b/drivers/video/grvga.c
index 01fbcaf..c078701 100644
--- a/drivers/video/grvga.c
+++ b/drivers/video/grvga.c
@@ -555,19 +555,7 @@ static struct platform_driver grvga_driver = {
 	.remove		= grvga_remove,
 };
 
-
-static int __init grvga_init(void)
-{
-	return platform_driver_register(&grvga_driver);
-}
-
-static void __exit grvga_exit(void)
-{
-	platform_driver_unregister(&grvga_driver);
-}
-
-module_init(grvga_init);
-module_exit(grvga_exit);
+module_platform_driver(grvga_driver);
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Aeroflex Gaisler");
-- 
1.7.9.5


^ permalink raw reply related

* [PATCH 15/15] video: xilinxfb: Remove redundant dev_set_drvdata
From: Sachin Kamat @ 2013-09-20  6:44 UTC (permalink / raw)
  To: linux-fbdev

Driver core sets driver data to NULL upon failure or remove.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
 drivers/video/xilinxfb.c |    2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/video/xilinxfb.c b/drivers/video/xilinxfb.c
index 84c664e..0e1dd33 100644
--- a/drivers/video/xilinxfb.c
+++ b/drivers/video/xilinxfb.c
@@ -369,7 +369,6 @@ err_fbmem:
 
 err_region:
 	kfree(drvdata);
-	dev_set_drvdata(dev, NULL);
 
 	return rc;
 }
@@ -404,7 +403,6 @@ static int xilinxfb_release(struct device *dev)
 #endif
 
 	kfree(drvdata);
-	dev_set_drvdata(dev, NULL);
 
 	return 0;
 }
-- 
1.7.9.5


^ permalink raw reply related

* [PATCH 14/15] video: tcx: Remove redundant dev_set_drvdata
From: Sachin Kamat @ 2013-09-20  6:44 UTC (permalink / raw)
  To: linux-fbdev

Driver core sets driver data to NULL upon failure or remove.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
 drivers/video/tcx.c |    2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/video/tcx.c b/drivers/video/tcx.c
index c000852..1f3a327 100644
--- a/drivers/video/tcx.c
+++ b/drivers/video/tcx.c
@@ -498,8 +498,6 @@ static int tcx_remove(struct platform_device *op)
 
 	framebuffer_release(info);
 
-	dev_set_drvdata(&op->dev, NULL);
-
 	return 0;
 }
 
-- 
1.7.9.5


^ permalink raw reply related

* [PATCH 13/15] video: sunxvr1000: Remove redundant dev_set_drvdata
From: Sachin Kamat @ 2013-09-20  6:44 UTC (permalink / raw)
  To: linux-fbdev

Driver core sets driver data to NULL upon failure or remove.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
 drivers/video/sunxvr1000.c |    2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/video/sunxvr1000.c b/drivers/video/sunxvr1000.c
index cc6f48b..58241b4 100644
--- a/drivers/video/sunxvr1000.c
+++ b/drivers/video/sunxvr1000.c
@@ -186,8 +186,6 @@ static int gfb_remove(struct platform_device *op)
 
         framebuffer_release(info);
 
-	dev_set_drvdata(&op->dev, NULL);
-
 	return 0;
 }
 
-- 
1.7.9.5


^ permalink raw reply related

* [PATCH 12/15] video: platinumfb: Remove redundant dev_set_drvdata
From: Sachin Kamat @ 2013-09-20  6:44 UTC (permalink / raw)
  To: linux-fbdev

Driver core sets driver data to NULL upon failure or remove.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
 drivers/video/platinumfb.c |    1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/video/platinumfb.c b/drivers/video/platinumfb.c
index 3d86bac..b644037 100644
--- a/drivers/video/platinumfb.c
+++ b/drivers/video/platinumfb.c
@@ -639,7 +639,6 @@ static int platinumfb_probe(struct platform_device* odev)
 		iounmap(pinfo->frame_buffer);
 		iounmap(pinfo->platinum_regs);
 		iounmap(pinfo->cmap_regs);
-		dev_set_drvdata(&odev->dev, NULL);
 		framebuffer_release(info);
 	}
 
-- 
1.7.9.5


^ permalink raw reply related

* [PATCH 11/15] video: p9100: Remove redundant dev_set_drvdata
From: Sachin Kamat @ 2013-09-20  6:44 UTC (permalink / raw)
  To: linux-fbdev

Driver core sets driver data to NULL upon failure or remove.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
 drivers/video/p9100.c |    2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/video/p9100.c b/drivers/video/p9100.c
index 4b23af6..367cea8 100644
--- a/drivers/video/p9100.c
+++ b/drivers/video/p9100.c
@@ -339,8 +339,6 @@ static int p9100_remove(struct platform_device *op)
 
 	framebuffer_release(info);
 
-	dev_set_drvdata(&op->dev, NULL);
-
 	return 0;
 }
 
-- 
1.7.9.5


^ permalink raw reply related

* [PATCH 10/15] video: ffb: Remove redundant dev_set_drvdata
From: Sachin Kamat @ 2013-09-20  6:44 UTC (permalink / raw)
  To: linux-fbdev

Driver core sets driver data to NULL upon failure or remove.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
 drivers/video/ffb.c |    2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/video/ffb.c b/drivers/video/ffb.c
index 6d27447..4c4ffa6 100644
--- a/drivers/video/ffb.c
+++ b/drivers/video/ffb.c
@@ -1035,8 +1035,6 @@ static int ffb_remove(struct platform_device *op)
 
 	framebuffer_release(info);
 
-	dev_set_drvdata(&op->dev, NULL);
-
 	return 0;
 }
 
-- 
1.7.9.5


^ permalink raw reply related

* [PATCH 09/15] video: cg6: Remove redundant dev_set_drvdata
From: Sachin Kamat @ 2013-09-20  6:44 UTC (permalink / raw)
  To: linux-fbdev

Driver core sets driver data to NULL upon failure or remove.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
 drivers/video/cg6.c |    2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/video/cg6.c b/drivers/video/cg6.c
index 3545dec..f070ec3 100644
--- a/drivers/video/cg6.c
+++ b/drivers/video/cg6.c
@@ -839,8 +839,6 @@ static int cg6_remove(struct platform_device *op)
 
 	framebuffer_release(info);
 
-	dev_set_drvdata(&op->dev, NULL);
-
 	return 0;
 }
 
-- 
1.7.9.5


^ permalink raw reply related

* [PATCH 08/15] video: cg3: Remove redundant dev_set_drvdata
From: Sachin Kamat @ 2013-09-20  6:44 UTC (permalink / raw)
  To: linux-fbdev

Driver core sets driver data to NULL upon failure or remove.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
 drivers/video/cg3.c |    2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/video/cg3.c b/drivers/video/cg3.c
index 9f63507..64a89d5 100644
--- a/drivers/video/cg3.c
+++ b/drivers/video/cg3.c
@@ -446,8 +446,6 @@ static int cg3_remove(struct platform_device *op)
 
 	framebuffer_release(info);
 
-	dev_set_drvdata(&op->dev, NULL);
-
 	return 0;
 }
 
-- 
1.7.9.5


^ permalink raw reply related

* [PATCH 07/15] video: cg14: Remove redundant dev_set_drvdata
From: Sachin Kamat @ 2013-09-20  6:44 UTC (permalink / raw)
  To: linux-fbdev

Driver core sets driver data to NULL upon failure or remove.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
 drivers/video/cg14.c |    2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/video/cg14.c b/drivers/video/cg14.c
index ed3b889..9626488 100644
--- a/drivers/video/cg14.c
+++ b/drivers/video/cg14.c
@@ -583,8 +583,6 @@ static int cg14_remove(struct platform_device *op)
 
 	framebuffer_release(info);
 
-	dev_set_drvdata(&op->dev, NULL);
-
 	return 0;
 }
 
-- 
1.7.9.5


^ permalink raw reply related

* [PATCH 06/15] video: bw2: Remove redundant dev_set_drvdata
From: Sachin Kamat @ 2013-09-20  6:44 UTC (permalink / raw)
  To: linux-fbdev

Driver core sets driver data to NULL upon failure or remove.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
 drivers/video/bw2.c |    2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/video/bw2.c b/drivers/video/bw2.c
index 60017fc..bc123d6 100644
--- a/drivers/video/bw2.c
+++ b/drivers/video/bw2.c
@@ -363,8 +363,6 @@ static int bw2_remove(struct platform_device *op)
 
 	framebuffer_release(info);
 
-	dev_set_drvdata(&op->dev, NULL);
-
 	return 0;
 }
 
-- 
1.7.9.5


^ permalink raw reply related

* [PATCH 05/15] video: amifb: Remove redundant dev_set_drvdata
From: Sachin Kamat @ 2013-09-20  6:44 UTC (permalink / raw)
  To: linux-fbdev

Driver core sets driver data to NULL upon failure or remove.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
 drivers/video/amifb.c |    2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/video/amifb.c b/drivers/video/amifb.c
index a6780ee..8ab304d 100644
--- a/drivers/video/amifb.c
+++ b/drivers/video/amifb.c
@@ -3748,7 +3748,6 @@ default_chipset:
 	return 0;
 
 unset_drvdata:
-	dev_set_drvdata(&pdev->dev, NULL);
 	fb_dealloc_cmap(&info->cmap);
 free_irq:
 	free_irq(IRQ_AMIGA_COPPER, info->par);
@@ -3768,7 +3767,6 @@ static int __exit amifb_remove(struct platform_device *pdev)
 	struct fb_info *info = dev_get_drvdata(&pdev->dev);
 
 	unregister_framebuffer(info);
-	dev_set_drvdata(&pdev->dev, NULL);
 	fb_dealloc_cmap(&info->cmap);
 	free_irq(IRQ_AMIGA_COPPER, info->par);
 	custom.dmacon = DMAF_ALL | DMAF_MASTER;
-- 
1.7.9.5


^ permalink raw reply related

* [PATCH 04/15] video: mb862xx: Remove redundant dev_set_drvdata
From: Sachin Kamat @ 2013-09-20  6:44 UTC (permalink / raw)
  To: linux-fbdev

Driver core sets driver data to NULL upon failure or remove.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Cc: Anatolij Gustschin <agust@denx.de>
---
 drivers/video/mb862xx/mb862xxfbdrv.c |    2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/video/mb862xx/mb862xxfbdrv.c b/drivers/video/mb862xx/mb862xxfbdrv.c
index 98d2f8c..0cd4c33 100644
--- a/drivers/video/mb862xx/mb862xxfbdrv.c
+++ b/drivers/video/mb862xx/mb862xxfbdrv.c
@@ -781,7 +781,6 @@ rel_reg:
 irqdisp:
 	irq_dispose_mapping(par->irq);
 fbrel:
-	dev_set_drvdata(dev, NULL);
 	framebuffer_release(info);
 	return ret;
 }
@@ -814,7 +813,6 @@ static int of_platform_mb862xx_remove(struct platform_device *ofdev)
 	iounmap(par->mmio_base);
 	iounmap(par->fb_base);
 
-	dev_set_drvdata(&ofdev->dev, NULL);
 	release_mem_region(par->res->start, res_size);
 	framebuffer_release(fbi);
 	return 0;
-- 
1.7.9.5


^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox