Linux Framebuffer Layer development
 help / color / mirror / Atom feed
* Re: linux-next tree addition request (fbdev)
From: Stephen Rothwell @ 2011-08-28 16:19 UTC (permalink / raw)
  To: Florian Tobias Schandinat
  Cc: linux-next, linux-fbdev@vger.kernel.org, Paul Mundt
In-Reply-To: <20110825003353.e930fc7a664dd99c953b555c@canb.auug.org.au>

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

Hi Florian,

On Thu, 25 Aug 2011 00:33:53 +1000 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> On Wed, 24 Aug 2011 13:40:46 +0000 Florian Tobias Schandinat <FlorianSchandinat@gmx.de> wrote:
> >
> > can you please add
> > 
> >     git://github.com/schandinat/linux-2.6.git fbdev-next
> > 
> > to linux-next. It collects patches for the frame buffer subsystem.
> > Can you please add the linux-fbdev@vger.kernel.org mailing list as additional
> > contact for warnings/errors/problems?
> > 
> > You probably want to drop Paul's fbdev branches as they contain some outdated
> > patches that will conflict with the newer versions.
> 
> OK, Paul is still listed as the frame buffer subsystem maintainer, so I
> will need an Ack from him.  When I get that, I will replace his tree with
> yours.  I assume someone will update the MAINTAINERS file.
> 
> I also have another tree from Paul (called fbdev-current) that contained
> fixes for Linus' current release.  I also assume that that tree will be
> dropped (unless you have a new version of that as well).

Ping?  Anyone?

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

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

^ permalink raw reply

* Re: [PATCH/RFC v2 3/3] fbdev: sh_mobile_lcdc: Support FOURCC-based format API
From: Laurent Pinchart @ 2011-08-28  8:59 UTC (permalink / raw)
  To: Florian Tobias Schandinat; +Cc: linux-fbdev, linux-media, magnus.damm
In-Reply-To: <4E57D6B2.40001@gmx.de>

Hi Florian,

Thanks for the review.

On Friday 26 August 2011 19:24:02 Florian Tobias Schandinat wrote:
> On 08/19/2011 09:37 AM, Laurent Pinchart wrote:

[snip]

> > diff --git a/drivers/video/sh_mobile_lcdcfb.c
> > b/drivers/video/sh_mobile_lcdcfb.c index 97ab8ba..ea3f619 100644
> > --- a/drivers/video/sh_mobile_lcdcfb.c
> > +++ b/drivers/video/sh_mobile_lcdcfb.c

[snip]

> > @@ -1099,51 +1154,78 @@ static int sh_mobile_check_var(struct

[snip]

> > +	if (var->format.fourcc > 1) {
> > +		switch (var->format.fourcc) {
> > +		case V4L2_PIX_FMT_NV12:
> > +		case V4L2_PIX_FMT_NV21:
> > +			var->bits_per_pixel = 12;
> > +			break;
> > +		case V4L2_PIX_FMT_RGB565:
> > +		case V4L2_PIX_FMT_NV16:
> > +		case V4L2_PIX_FMT_NV61:
> > +			var->bits_per_pixel = 16;
> > +			break;
> > +		case V4L2_PIX_FMT_BGR24:
> > +		case V4L2_PIX_FMT_NV24:
> > +		case V4L2_PIX_FMT_NV42:
> > +			var->bits_per_pixel = 24;
> > +			break;
> > +		case V4L2_PIX_FMT_BGR32:
> > +			var->bits_per_pixel = 32;
> > +			break;
> > +		default:
> > +			return -EINVAL;
> > +		}
> > +
> > +		memset(var->format.reserved, 0, sizeof(var->format.reserved));
> 
> If we decide to use another of the reserved area this won't have the
> desired behavior as the behavior of this driver will change even if it
> does not support the new field. Probably the best thing is to get the
> desired behavior is zeroing the whole struct and setting the supported
> fields to the actual values. You should check and adjust colorspace here
> as well.

Agreed. I'll fix the patch accordingly.

-- 
Regards,

Laurent Pinchart

^ permalink raw reply

* Re: [PATCH/RFC v2 1/3] fbdev: Add FOURCC-based format configuration API
From: Laurent Pinchart @ 2011-08-28  8:48 UTC (permalink / raw)
  To: Florian Tobias Schandinat; +Cc: linux-fbdev, linux-media, magnus.damm
In-Reply-To: <4E57D2B5.7020604@gmx.de>

Hi Florian,

Thank you for the review.

On Friday 26 August 2011 19:07:01 Florian Tobias Schandinat wrote:
> Hi Laurent,
> 
> hope we're close to the final thing now. Just a few minor issues.

I agree with all your comments, I'll fix the patches accordingly.

-- 
Regards,

Laurent Pinchart

^ permalink raw reply

* [PATCH] MAINTAINERS: change framebuffer maintainer
From: Florian Tobias Schandinat @ 2011-08-27 19:32 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Paul Mundt, linux-fbdev, linux-kernel, Florian Tobias Schandinat
In-Reply-To: <4E4A1AB1.6040001@gmx.de>

As Paul has not much time for it I take over maintaining the
framebuffer subsystem.

Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
---
 MAINTAINERS |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 1d445f5..ac7e485 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -2649,11 +2649,11 @@ F:	drivers/net/wan/dlci.c
 F:	drivers/net/wan/sdla.c
 
 FRAMEBUFFER LAYER
-M:	Paul Mundt <lethal@linux-sh.org>
+M:	Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
 L:	linux-fbdev@vger.kernel.org
 W:	http://linux-fbdev.sourceforge.net/
 Q:	http://patchwork.kernel.org/project/linux-fbdev/list/
-T:	git git://git.kernel.org/pub/scm/linux/kernel/git/lethal/fbdev-2.6.git
+T:	git git://github.com/schandinat/linux-2.6.git fbdev-next
 S:	Maintained
 F:	Documentation/fb/
 F:	Documentation/devicetree/bindings/fb/
-- 
1.6.3.2


^ permalink raw reply related

* Re: [PATCH 1/4] OMAP: OMAPFB: make omapfb start even when a display
From: Jaya Kumar @ 2011-08-27 10:28 UTC (permalink / raw)
  To: Tomi Valkeinen; +Cc: linux-omap, linux-fbdev, archit
In-Reply-To: <1314001636-18036-2-git-send-email-tomi.valkeinen@ti.com>

On Mon, Aug 22, 2011 at 4:27 PM, Tomi Valkeinen <tomi.valkeinen@ti.com> wrote:
> Currently omapfb wants that all the display devices have a driver,
> otherwise omapfb refuses to start. There's no real requirement to act
> like that, and this patch will make omapfb give a warning and skip that
> device.

Hi Tomi,

Just a question, I am working with an out-of-tree hdmi driver for the
NXP TDA9984 with dm3730. This worked fine in 2.6.32 as a runtime
loaded dss display driver. That is:

+static struct omap_dss_device wiser2_hdmi_device = {
+       .type = OMAP_DISPLAY_TYPE_DPI,
+       .name = "hdmi",
+       .driver_name = "hdmi_panel",
+       .phy.dpi.data_lines = 24,
+       .platform_enable = wiser2_enable_hdmi,
+       .platform_disable = wiser2_disable_hdmi,
+};
+
+static struct omap_dss_device wiser2_tv_device = {
+       .name = "tv",
+       .driver_name = "venc",
+       .type = OMAP_DISPLAY_TYPE_VENC,
+       .phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO,
+       .platform_enable = wiser2_panel_enable_tv,
+       .platform_disable = wiser2_panel_disable_tv,
+};
+
+static struct omap_dss_device *wiser2_dss_devices[] = {
+       &wiser2_dvi_device,
+       &wiser2_tv_device,
+       &wiser2_hdmi_device,
+};

so this hdmi_panel omap_dss_driver was being insmoded after init at
bootup and it worked fine, no problems with omaplfb so pvr stuff
worked fine.

I then switched to 2.6.37 (from TI devkit 2.1 gingerbread) and this
kernel wasn't so happy (panic at boot). I applied your patch below. I
also figured out that omap_vout had a similar problem as the one
you've fixed which was what was causing the panic (omap_vout tries to
call display->driver->update without checking if driver exists):
diff --git a/drivers/media/video/omap/omap_vout.c
b/drivers/media/video/omap/omap_vout.c
index 2aee372..36d69db 100644
--- a/drivers/media/video/omap/omap_vout.c
+++ b/drivers/media/video/omap/omap_vout.c
@@ -2574,24 +2591,32 @@ static int __init omap_vout_probe(struct
platform_device *pdev)
+       printk(KERN_INFO "%s:%d\n", __func__, __LINE__);
        for (i = 0; i < vid_dev->num_displays; i++) {
                struct omap_dss_device *display = vid_dev->displays[i];

-               if (display->driver->update)
+       printk(KERN_INFO "%s:%d\n", __func__, __LINE__);
+               if ((display->driver) && (display->driver->update)) {
+       printk(KERN_INFO "%s:%d\n", __func__, __LINE__);
                        display->driver->update(display, 0, 0,
                                        display->panel.timings.x_res,
                                        display->panel.timings.y_res);
+               }
+       printk(KERN_INFO "%s:%d\n", __func__, __LINE__);
        }
+       printk(KERN_INFO "%s:%d\n", __func__, __LINE__);
        return 0;

After that change, it boots up cleanly but I don't get any display
output. I noticed that:
echo 1 > /sys/devices/omapdss/display2/enabled
no longer works. display2 stays enabled=0 rather than coming on.

I'm planning on debugging this some more when I have some free time.
But I figured I should ask first if this is a known problem, whether
anyone else is testing runtime loaded omap_dss_driver stuff and if
anyone has gotten it to work with kernels 2.6.37 and above.

Thanks,
jaya

>
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
> ---
>  drivers/video/omap2/omapfb/omapfb-main.c |    5 +++--
>  1 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c
> index e5a64b3..cd2cae8e 100644
> --- a/drivers/video/omap2/omapfb/omapfb-main.c
> +++ b/drivers/video/omap2/omapfb/omapfb-main.c
> @@ -2373,9 +2373,10 @@ static int omapfb_probe(struct platform_device *pdev)
>                omap_dss_get_device(dssdev);
>
>                if (!dssdev->driver) {
> -                       dev_err(&pdev->dev, "no driver for display: %s\n",
> +                       dev_warn(&pdev->dev, "no driver for display: %s\n",
>                                dssdev->name);
> -                       r = -ENODEV;
> +                       omap_dss_put_device(dssdev);
> +                       continue;
>                }
>
>                d = &fbdev->displays[fbdev->num_displays++];
> --
> 1.7.4.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

^ permalink raw reply related

* Beloved
From: Sister Deborah Mannings @ 2011-08-27  1:49 UTC (permalink / raw)
  To: linux-fbdev

Beloved,I am Deborah Mannings.I write this email to you on my sick bed
facing death.I have a substantial sum  I would like you to help me
distribute to the needy and helpless.God bless you as you reply through
mann_deb@yahoo.cn

^ permalink raw reply

* Re: [PATCH] fbdev: fix parsing of standard timings
From: Florian Tobias Schandinat @ 2011-08-26 18:02 UTC (permalink / raw)
  To: linux-fbdev
In-Reply-To: <1314362328-30456-1-git-send-email-tomi.valkeinen@ti.com>

Hi Tomi,

On 08/26/2011 12:38 PM, Tomi Valkeinen wrote:
> The standard timings parses uses 1:1 dimensions when the ratio in the
> EDID data is 0. However, for EDID 1.3 and later the dimensions are 16:10
> when the ratio is 0.
> 
> Pass the version and revision numbers to get_std_timing() which can then
> make the right decision about dimensions.
> 
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>

Thanks, looks good to me.
I'd be happy if someone with access to the original EDID specs could confirm
this and add his reviewed by.
I also think adding a comment explaining this change would be helpful.

> ---
>  drivers/video/fbmon.c |   20 ++++++++++++++------
>  1 files changed, 14 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/video/fbmon.c b/drivers/video/fbmon.c
> index 4f57485..6a6f92e 100644
> --- a/drivers/video/fbmon.c
> +++ b/drivers/video/fbmon.c
> @@ -493,7 +493,8 @@ static int get_est_timing(unsigned char *block, struct fb_videomode *mode)
>  	return num;
>  }
>  
> -static int get_std_timing(unsigned char *block, struct fb_videomode *mode)
> +static int get_std_timing(unsigned char *block, struct fb_videomode *mode,
> +		int ver, int rev)
>  {
>  	int xres, yres = 0, refresh, ratio, i;
>  
> @@ -504,7 +505,10 @@ static int get_std_timing(unsigned char *block, struct fb_videomode *mode)
>  	ratio = (block[1] & 0xc0) >> 6;
>  	switch (ratio) {
>  	case 0:
> -		yres = xres;

/* in EDID 1.3 the meaning of 0 changed to 16:10 (prior 1:1) */

> +		if (ver < 1 || (ver = 1 && rev < 3))
> +			yres = xres;
> +		else
> +			yres = (xres * 10)/16;
>  		break;
>  	case 1:
>  		yres = (xres * 3)/4;
> @@ -533,12 +537,12 @@ static int get_std_timing(unsigned char *block, struct fb_videomode *mode)
>  }
>  
>  static int get_dst_timing(unsigned char *block,
> -			  struct fb_videomode *mode)
> +			  struct fb_videomode *mode, int ver, int rev)
>  {
>  	int j, num = 0;
>  
>  	for (j = 0; j < 6; j++, block += STD_TIMING_DESCRIPTION_SIZE)
> -		num += get_std_timing(block, &mode[num]);
> +		num += get_std_timing(block, &mode[num], ver, rev);
>  
>  	return num;
>  }
> @@ -599,6 +603,10 @@ static struct fb_videomode *fb_create_modedb(unsigned char *edid, int *dbsize)
>  	struct fb_videomode *mode, *m;
>  	unsigned char *block;
>  	int num = 0, i, first = 1;
> +	int ver, rev;
> +
> +	ver = edid[EDID_STRUCT_VERSION];
> +	rev = edid[EDID_STRUCT_REVISION];
>  
>  	mode = kzalloc(50 * sizeof(struct fb_videomode), GFP_KERNEL);
>  	if (mode = NULL)
> @@ -632,12 +640,12 @@ static struct fb_videomode *fb_create_modedb(unsigned char *edid, int *dbsize)
>  	DPRINTK("   Standard Timings\n");
>  	block = edid + STD_TIMING_DESCRIPTIONS_START;
>  	for (i = 0; i < STD_TIMING; i++, block += STD_TIMING_DESCRIPTION_SIZE)
> -		num += get_std_timing(block, &mode[num]);
> +		num += get_std_timing(block, &mode[num], ver, rev);
>  
>  	block = edid + DETAILED_TIMING_DESCRIPTIONS_START;
>  	for (i = 0; i < 4; i++, block+= DETAILED_TIMING_DESCRIPTION_SIZE) {
>  		if (block[0] = 0x00 && block[1] = 0x00 && block[3] = 0xfa)
> -			num += get_dst_timing(block + 5, &mode[num]);
> +			num += get_dst_timing(block + 5, &mode[num], ver, rev);
>  	}
>  
>  	/* Yikes, EDID data is totally useless */

Thanks,

Florian Tobias Schandinat


^ permalink raw reply

* Re: [PATCH/RFC v2 3/3] fbdev: sh_mobile_lcdc: Support FOURCC-based
From: Florian Tobias Schandinat @ 2011-08-26 17:24 UTC (permalink / raw)
  To: Laurent Pinchart; +Cc: linux-fbdev, linux-media, magnus.damm
In-Reply-To: <1313746626-23845-4-git-send-email-laurent.pinchart@ideasonboard.com>

Hi Laurent,

On 08/19/2011 09:37 AM, Laurent Pinchart wrote:
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
>  arch/arm/mach-shmobile/board-ag5evm.c   |    2 +-
>  arch/arm/mach-shmobile/board-ap4evb.c   |    4 +-
>  arch/arm/mach-shmobile/board-mackerel.c |    4 +-
>  drivers/video/sh_mobile_lcdcfb.c        |  342 ++++++++++++++++++++-----------
>  include/video/sh_mobile_lcdc.h          |    4 +-
>  5 files changed, 230 insertions(+), 126 deletions(-)
> 
> diff --git a/arch/arm/mach-shmobile/board-ag5evm.c b/arch/arm/mach-shmobile/board-ag5evm.c
> index ce5c251..e6dabaa 100644
> --- a/arch/arm/mach-shmobile/board-ag5evm.c
> +++ b/arch/arm/mach-shmobile/board-ag5evm.c
> @@ -270,7 +270,7 @@ static struct sh_mobile_lcdc_info lcdc0_info = {
>  		.flags = LCDC_FLAGS_DWPOL,
>  		.lcd_size_cfg.width = 44,
>  		.lcd_size_cfg.height = 79,
> -		.bpp = 16,
> +		.fourcc = V4L2_PIX_FMT_RGB565,
>  		.lcd_cfg = lcdc0_modes,
>  		.num_cfg = ARRAY_SIZE(lcdc0_modes),
>  		.board_cfg = {
> diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c
> index 9e0856b..6f5db07 100644
> --- a/arch/arm/mach-shmobile/board-ap4evb.c
> +++ b/arch/arm/mach-shmobile/board-ap4evb.c
> @@ -489,7 +489,7 @@ static struct sh_mobile_lcdc_info lcdc_info = {
>  	.meram_dev = &meram_info,
>  	.ch[0] = {
>  		.chan = LCDC_CHAN_MAINLCD,
> -		.bpp = 16,
> +		.fourcc = V4L2_PIX_FMT_RGB565,
>  		.lcd_cfg = ap4evb_lcdc_modes,
>  		.num_cfg = ARRAY_SIZE(ap4evb_lcdc_modes),
>  		.meram_cfg = &lcd_meram_cfg,
> @@ -783,7 +783,7 @@ static struct sh_mobile_lcdc_info sh_mobile_lcdc1_info = {
>  	.meram_dev = &meram_info,
>  	.ch[0] = {
>  		.chan = LCDC_CHAN_MAINLCD,
> -		.bpp = 16,
> +		.fourcc = V4L2_PIX_FMT_RGB565,
>  		.interface_type = RGB24,
>  		.clock_divider = 1,
>  		.flags = LCDC_FLAGS_DWPOL,
> diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c
> index 6e3c2df..6e36349 100644
> --- a/arch/arm/mach-shmobile/board-mackerel.c
> +++ b/arch/arm/mach-shmobile/board-mackerel.c
> @@ -387,7 +387,7 @@ static struct sh_mobile_lcdc_info lcdc_info = {
>  	.clock_source = LCDC_CLK_BUS,
>  	.ch[0] = {
>  		.chan = LCDC_CHAN_MAINLCD,
> -		.bpp = 16,
> +		.fourcc = V4L2_PIX_FMT_RGB565,
>  		.lcd_cfg = mackerel_lcdc_modes,
>  		.num_cfg = ARRAY_SIZE(mackerel_lcdc_modes),
>  		.interface_type		= RGB24,
> @@ -450,7 +450,7 @@ static struct sh_mobile_lcdc_info hdmi_lcdc_info = {
>  	.clock_source = LCDC_CLK_EXTERNAL,
>  	.ch[0] = {
>  		.chan = LCDC_CHAN_MAINLCD,
> -		.bpp = 16,
> +		.fourcc = V4L2_PIX_FMT_RGB565,
>  		.interface_type = RGB24,
>  		.clock_divider = 1,
>  		.flags = LCDC_FLAGS_DWPOL,
> diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c
> index 97ab8ba..ea3f619 100644
> --- a/drivers/video/sh_mobile_lcdcfb.c
> +++ b/drivers/video/sh_mobile_lcdcfb.c
> @@ -17,6 +17,7 @@
>  #include <linux/platform_device.h>
>  #include <linux/dma-mapping.h>
>  #include <linux/interrupt.h>
> +#include <linux/videodev2.h>
>  #include <linux/vmalloc.h>
>  #include <linux/ioctl.h>
>  #include <linux/slab.h>
> @@ -101,7 +102,7 @@ struct sh_mobile_lcdc_priv {
>  	struct sh_mobile_lcdc_chan ch[2];
>  	struct notifier_block notifier;
>  	int started;
> -	int forced_bpp; /* 2 channel LCDC must share bpp setting */
> +	int forced_fourcc; /* 2 channel LCDC must share fourcc setting */
>  	struct sh_mobile_meram_info *meram_dev;
>  };
>  
> @@ -214,6 +215,42 @@ struct sh_mobile_lcdc_sys_bus_ops sh_mobile_lcdc_sys_bus_ops = {
>  	lcdc_sys_read_data,
>  };
>  
> +static int sh_mobile_format_fourcc(const struct fb_var_screeninfo *var)
> +{
> +	if (var->format.fourcc > 1)
> +		return var->format.fourcc;
> +
> +	switch (var->bits_per_pixel) {
> +	case 16:
> +		return V4L2_PIX_FMT_RGB565;
> +	case 24:
> +		return V4L2_PIX_FMT_BGR24;
> +	case 32:
> +		return V4L2_PIX_FMT_BGR32;
> +	default:
> +		return 0;
> +	}
> +}
> +
> +static bool sh_mobile_format_yuv(const struct fb_var_screeninfo *var)
> +{
> +	if (var->format.fourcc <= 1)
> +		return false;
> +
> +	switch (var->format.fourcc) {
> +	case V4L2_PIX_FMT_NV12:
> +	case V4L2_PIX_FMT_NV21:
> +	case V4L2_PIX_FMT_NV16:
> +	case V4L2_PIX_FMT_NV61:
> +	case V4L2_PIX_FMT_NV24:
> +	case V4L2_PIX_FMT_NV42:
> +		return true;
> +
> +	default:
> +		return false;
> +	}
> +}
> +
>  static void sh_mobile_lcdc_clk_on(struct sh_mobile_lcdc_priv *priv)
>  {
>  	if (atomic_inc_and_test(&priv->hw_usecnt)) {
> @@ -434,7 +471,6 @@ static void __sh_mobile_lcdc_start(struct sh_mobile_lcdc_priv *priv)
>  {
>  	struct sh_mobile_lcdc_chan *ch;
>  	unsigned long tmp;
> -	int bpp = 0;
>  	int k, m;
>  
>  	/* Enable LCDC channels. Read data from external memory, avoid using the
> @@ -453,9 +489,6 @@ static void __sh_mobile_lcdc_start(struct sh_mobile_lcdc_priv *priv)
>  		if (!ch->enabled)
>  			continue;
>  
> -		if (!bpp)
> -			bpp = ch->info->var.bits_per_pixel;
> -
>  		/* Power supply */
>  		lcdc_write_chan(ch, LDPMR, 0);
>  
> @@ -486,31 +519,37 @@ static void __sh_mobile_lcdc_start(struct sh_mobile_lcdc_priv *priv)
>  
>  		sh_mobile_lcdc_geometry(ch);
>  
> -		if (ch->info->var.nonstd) {
> -			tmp = (ch->info->var.nonstd << 16);
> -			switch (ch->info->var.bits_per_pixel) {
> -			case 12:
> -				tmp |= LDDFR_YF_420;
> -				break;
> -			case 16:
> -				tmp |= LDDFR_YF_422;
> -				break;
> -			case 24:
> -			default:
> -				tmp |= LDDFR_YF_444;
> -				break;
> -			}
> -		} else {
> -			switch (ch->info->var.bits_per_pixel) {
> -			case 16:
> -				tmp = LDDFR_PKF_RGB16;
> -				break;
> -			case 24:
> -				tmp = LDDFR_PKF_RGB24;
> +		switch (sh_mobile_format_fourcc(&ch->info->var)) {
> +		case V4L2_PIX_FMT_RGB565:
> +			tmp = LDDFR_PKF_RGB16;
> +			break;
> +		case V4L2_PIX_FMT_BGR24:
> +			tmp = LDDFR_PKF_RGB24;
> +			break;
> +		case V4L2_PIX_FMT_BGR32:
> +			tmp = LDDFR_PKF_ARGB32;
> +			break;
> +		case V4L2_PIX_FMT_NV12:
> +		case V4L2_PIX_FMT_NV21:
> +			tmp = LDDFR_CC | LDDFR_YF_420;
> +			break;
> +		case V4L2_PIX_FMT_NV16:
> +		case V4L2_PIX_FMT_NV61:
> +			tmp = LDDFR_CC | LDDFR_YF_422;
> +			break;
> +		case V4L2_PIX_FMT_NV24:
> +		case V4L2_PIX_FMT_NV42:
> +			tmp = LDDFR_CC | LDDFR_YF_444;
> +			break;
> +		}
> +
> +		if (sh_mobile_format_yuv(&ch->info->var)) {
> +			switch (ch->info->var.format.colorspace) {
> +			case V4L2_COLORSPACE_REC709:
> +				tmp |= LDDFR_CF1;
>  				break;
> -			case 32:
> -			default:
> -				tmp = LDDFR_PKF_ARGB32;
> +			case V4L2_COLORSPACE_JPEG:
> +				tmp |= LDDFR_CF0;
>  				break;
>  			}
>  		}
> @@ -518,7 +557,7 @@ static void __sh_mobile_lcdc_start(struct sh_mobile_lcdc_priv *priv)
>  		lcdc_write_chan(ch, LDDFR, tmp);
>  		lcdc_write_chan(ch, LDMLSR, ch->pitch);
>  		lcdc_write_chan(ch, LDSA1R, ch->base_addr_y);
> -		if (ch->info->var.nonstd)
> +		if (sh_mobile_format_yuv(&ch->info->var))
>  			lcdc_write_chan(ch, LDSA2R, ch->base_addr_c);
>  
>  		/* When using deferred I/O mode, configure the LCDC for one-shot
> @@ -535,21 +574,23 @@ static void __sh_mobile_lcdc_start(struct sh_mobile_lcdc_priv *priv)
>  	}
>  
>  	/* Word and long word swap. */
> -	if  (priv->ch[0].info->var.nonstd)
> +	switch (sh_mobile_format_fourcc(&priv->ch[0].info->var)) {
> +	case V4L2_PIX_FMT_RGB565:
> +	case V4L2_PIX_FMT_NV21:
> +	case V4L2_PIX_FMT_NV61:
> +	case V4L2_PIX_FMT_NV42:
> +		tmp = LDDDSR_LS | LDDDSR_WS;
> +		break;
> +	case V4L2_PIX_FMT_BGR24:
> +	case V4L2_PIX_FMT_NV12:
> +	case V4L2_PIX_FMT_NV16:
> +	case V4L2_PIX_FMT_NV24:
>  		tmp = LDDDSR_LS | LDDDSR_WS | LDDDSR_BS;
> -	else {
> -		switch (bpp) {
> -		case 16:
> -			tmp = LDDDSR_LS | LDDDSR_WS;
> -			break;
> -		case 24:
> -			tmp = LDDDSR_LS | LDDDSR_WS | LDDDSR_BS;
> -			break;
> -		case 32:
> -		default:
> -			tmp = LDDDSR_LS;
> -			break;
> -		}
> +		break;
> +	case V4L2_PIX_FMT_BGR32:
> +	default:
> +		tmp = LDDDSR_LS;
> +		break;
>  	}
>  	lcdc_write(priv, _LDDDSR, tmp);
>  
> @@ -621,12 +662,24 @@ static int sh_mobile_lcdc_start(struct sh_mobile_lcdc_priv *priv)
>  			ch->meram_enabled = 0;
>  		}
>  
> -		if (!ch->info->var.nonstd)
> -			pixelformat = SH_MOBILE_MERAM_PF_RGB;
> -		else if (ch->info->var.bits_per_pixel = 24)
> -			pixelformat = SH_MOBILE_MERAM_PF_NV24;
> -		else
> +		switch (sh_mobile_format_fourcc(&ch->info->var)) {
> +		case V4L2_PIX_FMT_NV12:
> +		case V4L2_PIX_FMT_NV21:
> +		case V4L2_PIX_FMT_NV16:
> +		case V4L2_PIX_FMT_NV61:
>  			pixelformat = SH_MOBILE_MERAM_PF_NV;
> +			break;
> +		case V4L2_PIX_FMT_NV24:
> +		case V4L2_PIX_FMT_NV42:
> +			pixelformat = SH_MOBILE_MERAM_PF_NV24;
> +			break;
> +		case V4L2_PIX_FMT_RGB565:
> +		case V4L2_PIX_FMT_BGR24:
> +		case V4L2_PIX_FMT_BGR32:
> +		default:
> +			pixelformat = SH_MOBILE_MERAM_PF_RGB;
> +			break;
> +		}
>  
>  		ret = mdev->ops->meram_register(mdev, cfg, ch->pitch,
>  					ch->info->var.yres, pixelformat,
> @@ -844,6 +897,7 @@ static struct fb_fix_screeninfo sh_mobile_lcdc_fix  = {
>  	.xpanstep =	0,
>  	.ypanstep =	1,
>  	.ywrapstep =	0,
> +	.capabilities =	FB_CAP_FOURCC,
>  };
>  
>  static void sh_mobile_lcdc_fillrect(struct fb_info *info,
> @@ -876,8 +930,9 @@ static int sh_mobile_fb_pan_display(struct fb_var_screeninfo *var,
>  	unsigned long new_pan_offset;
>  	unsigned long base_addr_y, base_addr_c;
>  	unsigned long c_offset;
> +	bool yuv = sh_mobile_format_yuv(&info->var);
>  
> -	if (!info->var.nonstd)
> +	if (!yuv)
>  		new_pan_offset = var->yoffset * info->fix.line_length
>  			       + var->xoffset * (info->var.bits_per_pixel / 8);
>  	else
> @@ -891,7 +946,7 @@ static int sh_mobile_fb_pan_display(struct fb_var_screeninfo *var,
>  
>  	/* Set the source address for the next refresh */
>  	base_addr_y = ch->dma_handle + new_pan_offset;
> -	if (info->var.nonstd) {
> +	if (yuv) {
>  		/* Set y offset */
>  		c_offset = var->yoffset * info->fix.line_length
>  			 * (info->var.bits_per_pixel - 8) / 8;
> @@ -899,7 +954,7 @@ static int sh_mobile_fb_pan_display(struct fb_var_screeninfo *var,
>  			    + info->var.xres * info->var.yres_virtual
>  			    + c_offset;
>  		/* Set x offset */
> -		if (info->var.bits_per_pixel = 24)
> +		if (sh_mobile_format_fourcc(&info->var) = V4L2_PIX_FMT_NV24)
>  			base_addr_c += 2 * var->xoffset;
>  		else
>  			base_addr_c += var->xoffset;
> @@ -923,7 +978,7 @@ static int sh_mobile_fb_pan_display(struct fb_var_screeninfo *var,
>  	ch->base_addr_c = base_addr_c;
>  
>  	lcdc_write_chan_mirror(ch, LDSA1R, base_addr_y);
> -	if (info->var.nonstd)
> +	if (yuv)
>  		lcdc_write_chan_mirror(ch, LDSA2R, base_addr_c);
>  
>  	if (lcdc_chan_is_sublcd(ch))
> @@ -1099,51 +1154,78 @@ static int sh_mobile_check_var(struct fb_var_screeninfo *var, struct fb_info *in
>  	if (var->yres_virtual < var->yres)
>  		var->yres_virtual = var->yres;
>  
> -	if (var->bits_per_pixel <= 16) {		/* RGB 565 */
> -		var->bits_per_pixel = 16;
> -		var->red.offset = 11;
> -		var->red.length = 5;
> -		var->green.offset = 5;
> -		var->green.length = 6;
> -		var->blue.offset = 0;
> -		var->blue.length = 5;
> -		var->transp.offset = 0;
> -		var->transp.length = 0;
> -	} else if (var->bits_per_pixel <= 24) {		/* RGB 888 */
> -		var->bits_per_pixel = 24;
> -		var->red.offset = 16;
> -		var->red.length = 8;
> -		var->green.offset = 8;
> -		var->green.length = 8;
> -		var->blue.offset = 0;
> -		var->blue.length = 8;
> -		var->transp.offset = 0;
> -		var->transp.length = 0;
> -	} else if (var->bits_per_pixel <= 32) {		/* RGBA 888 */
> -		var->bits_per_pixel = 32;
> -		var->red.offset = 16;
> -		var->red.length = 8;
> -		var->green.offset = 8;
> -		var->green.length = 8;
> -		var->blue.offset = 0;
> -		var->blue.length = 8;
> -		var->transp.offset = 24;
> -		var->transp.length = 8;
> -	} else
> -		return -EINVAL;
> +	if (var->format.fourcc > 1) {
> +		switch (var->format.fourcc) {
> +		case V4L2_PIX_FMT_NV12:
> +		case V4L2_PIX_FMT_NV21:
> +			var->bits_per_pixel = 12;
> +			break;
> +		case V4L2_PIX_FMT_RGB565:
> +		case V4L2_PIX_FMT_NV16:
> +		case V4L2_PIX_FMT_NV61:
> +			var->bits_per_pixel = 16;
> +			break;
> +		case V4L2_PIX_FMT_BGR24:
> +		case V4L2_PIX_FMT_NV24:
> +		case V4L2_PIX_FMT_NV42:
> +			var->bits_per_pixel = 24;
> +			break;
> +		case V4L2_PIX_FMT_BGR32:
> +			var->bits_per_pixel = 32;
> +			break;
> +		default:
> +			return -EINVAL;
> +		}
> +
> +		memset(var->format.reserved, 0, sizeof(var->format.reserved));

If we decide to use another of the reserved area this won't have the desired
behavior as the behavior of this driver will change even if it does not support
the new field. Probably the best thing is to get the desired behavior is zeroing
the whole struct and setting the supported fields to the actual values.
You should check and adjust colorspace here as well.

> +	} else {
> +		if (var->bits_per_pixel <= 16) {		/* RGB 565 */
> +			var->bits_per_pixel = 16;
> +			var->red.offset = 11;
> +			var->red.length = 5;
> +			var->green.offset = 5;
> +			var->green.length = 6;
> +			var->blue.offset = 0;
> +			var->blue.length = 5;
> +			var->transp.offset = 0;
> +			var->transp.length = 0;
> +		} else if (var->bits_per_pixel <= 24) {		/* RGB 888 */
> +			var->bits_per_pixel = 24;
> +			var->red.offset = 16;
> +			var->red.length = 8;
> +			var->green.offset = 8;
> +			var->green.length = 8;
> +			var->blue.offset = 0;
> +			var->blue.length = 8;
> +			var->transp.offset = 0;
> +			var->transp.length = 0;
> +		} else if (var->bits_per_pixel <= 32) {		/* RGBA 888 */
> +			var->bits_per_pixel = 32;
> +			var->red.offset = 16;
> +			var->red.length = 8;
> +			var->green.offset = 8;
> +			var->green.length = 8;
> +			var->blue.offset = 0;
> +			var->blue.length = 8;
> +			var->transp.offset = 24;
> +			var->transp.length = 8;
> +		} else
> +			return -EINVAL;
>  
> -	var->red.msb_right = 0;
> -	var->green.msb_right = 0;
> -	var->blue.msb_right = 0;
> -	var->transp.msb_right = 0;
> +		var->red.msb_right = 0;
> +		var->green.msb_right = 0;
> +		var->blue.msb_right = 0;
> +		var->transp.msb_right = 0;
> +	}
>  
>  	/* Make sure we don't exceed our allocated memory. */
>  	if (var->xres_virtual * var->yres_virtual * var->bits_per_pixel / 8 >
>  	    info->fix.smem_len)
>  		return -EINVAL;
>  
> -	/* only accept the forced_bpp for dual channel configurations */
> -	if (p->forced_bpp && p->forced_bpp != var->bits_per_pixel)
> +	/* only accept the forced_fourcc for dual channel configurations */
> +	if (p->forced_fourcc &&
> +	    p->forced_fourcc != sh_mobile_format_fourcc(var))
>  		return -EINVAL;
>  
>  	return 0;
> @@ -1157,7 +1239,7 @@ static int sh_mobile_set_par(struct fb_info *info)
>  
>  	sh_mobile_lcdc_stop(ch->lcdc);
>  
> -	if (info->var.nonstd)
> +	if (sh_mobile_format_yuv(&info->var))
>  		info->fix.line_length = info->var.xres;
>  	else
>  		info->fix.line_length = info->var.xres
> @@ -1169,6 +1251,11 @@ static int sh_mobile_set_par(struct fb_info *info)
>  		info->fix.line_length = line_length;
>  	}
>  
> +	if (info->var.format.fourcc > 1)
> +		info->fix.visual = FB_VISUAL_FOURCC;
> +	else
> +		info->fix.visual = FB_VISUAL_TRUECOLOR;
> +
>  	return ret;
>  }
>  
> @@ -1463,9 +1550,9 @@ static int __devinit sh_mobile_lcdc_channel_init(struct sh_mobile_lcdc_chan *ch,
>  	for (i = 0, mode = cfg->lcd_cfg; i < cfg->num_cfg; i++, mode++) {
>  		unsigned int size = mode->yres * mode->xres;
>  
> -		/* NV12 buffers must have even number of lines */
> -		if ((cfg->nonstd) && cfg->bpp = 12 &&
> -				(mode->yres & 0x1)) {
> +		/* NV12/NV21 buffers must have even number of lines */
> +		if ((cfg->fourcc = V4L2_PIX_FMT_NV12 ||
> +		     cfg->fourcc = V4L2_PIX_FMT_NV21) && (mode->yres & 0x1)) {
>  			dev_err(dev, "yres must be multiple of 2 for YCbCr420 "
>  				"mode.\n");
>  			return -EINVAL;
> @@ -1483,14 +1570,6 @@ static int __devinit sh_mobile_lcdc_channel_init(struct sh_mobile_lcdc_chan *ch,
>  		dev_dbg(dev, "Found largest videomode %ux%u\n",
>  			max_mode->xres, max_mode->yres);
>  
> -	/* Initialize fixed screen information. Restrict pan to 2 lines steps
> -	 * for NV12.
> -	 */
> -	info->fix = sh_mobile_lcdc_fix;
> -	info->fix.smem_len = max_size * 2 * cfg->bpp / 8;
> -	if (cfg->nonstd && cfg->bpp = 12)
> -		info->fix.ypanstep = 2;
> -
>  	/* Create the mode list. */
>  	if (cfg->lcd_cfg = NULL) {
>  		mode = &default_720p;
> @@ -1508,19 +1587,38 @@ static int __devinit sh_mobile_lcdc_channel_init(struct sh_mobile_lcdc_chan *ch,
>  	 */
>  	var = &info->var;
>  	fb_videomode_to_var(var, mode);
> -	var->bits_per_pixel = cfg->bpp;
>  	var->width = cfg->lcd_size_cfg.width;
>  	var->height = cfg->lcd_size_cfg.height;
>  	var->yres_virtual = var->yres * 2;
>  	var->activate = FB_ACTIVATE_NOW;
>  
> +	switch (cfg->fourcc) {
> +	case V4L2_PIX_FMT_RGB565:
> +		var->bits_per_pixel = 16;
> +		break;
> +	case V4L2_PIX_FMT_BGR24:
> +		var->bits_per_pixel = 24;
> +		break;
> +	case V4L2_PIX_FMT_BGR32:
> +		var->bits_per_pixel = 32;
> +		break;
> +	default:
> +		var->format.fourcc = cfg->fourcc;
> +		break;
> +	}
> +
> +	/* Make sure the memory size check won't fail. smem_len is initialized
> +	 * later based on var.
> +	 */
> +	info->fix.smem_len = UINT_MAX;
>  	ret = sh_mobile_check_var(var, info);
>  	if (ret)
>  		return ret;
>  
> +	max_size *= var->bits_per_pixel / 8 * 2;
> +
>  	/* Allocate frame buffer memory and color map. */
> -	buf = dma_alloc_coherent(dev, info->fix.smem_len, &ch->dma_handle,
> -				 GFP_KERNEL);
> +	buf = dma_alloc_coherent(dev, max_size, &ch->dma_handle, GFP_KERNEL);
>  	if (!buf) {
>  		dev_err(dev, "unable to allocate buffer\n");
>  		return -ENOMEM;
> @@ -1529,16 +1627,25 @@ static int __devinit sh_mobile_lcdc_channel_init(struct sh_mobile_lcdc_chan *ch,
>  	ret = fb_alloc_cmap(&info->cmap, PALETTE_NR, 0);
>  	if (ret < 0) {
>  		dev_err(dev, "unable to allocate cmap\n");
> -		dma_free_coherent(dev, info->fix.smem_len,
> -				  buf, ch->dma_handle);
> +		dma_free_coherent(dev, max_size, buf, ch->dma_handle);
>  		return ret;
>  	}
>  
> +	/* Initialize fixed screen information. Restrict pan to 2 lines steps
> +	 * for NV12 and NV21.
> +	 */
> +	info->fix = sh_mobile_lcdc_fix;
>  	info->fix.smem_start = ch->dma_handle;
> -	if (var->nonstd)
> +	info->fix.smem_len = max_size * var->bits_per_pixel / 8 * 2;
> +	if (cfg->fourcc = V4L2_PIX_FMT_NV12 ||
> +	    cfg->fourcc = V4L2_PIX_FMT_NV21)
> +		info->fix.ypanstep = 2;
> +
> +	if (sh_mobile_format_yuv(var))
>  		info->fix.line_length = var->xres;
>  	else
> -		info->fix.line_length = var->xres * (cfg->bpp / 8);
> +		info->fix.line_length = var->xres * var->bits_per_pixel
> +				      / 8;
>  
>  	info->screen_base = buf;
>  	info->device = dev;
> @@ -1625,9 +1732,9 @@ static int __devinit sh_mobile_lcdc_probe(struct platform_device *pdev)
>  		goto err1;
>  	}
>  
> -	/* for dual channel LCDC (MAIN + SUB) force shared bpp setting */
> +	/* for dual channel LCDC (MAIN + SUB) force shared format setting */
>  	if (num_channels = 2)
> -		priv->forced_bpp = pdata->ch[0].bpp;
> +		priv->forced_fourcc = pdata->ch[0].fourcc;
>  
>  	priv->base = ioremap_nocache(res->start, resource_size(res));
>  	if (!priv->base)
> @@ -1674,13 +1781,10 @@ static int __devinit sh_mobile_lcdc_probe(struct platform_device *pdev)
>  		if (error < 0)
>  			goto err1;
>  
> -		dev_info(info->dev,
> -			 "registered %s/%s as %dx%d %dbpp.\n",
> -			 pdev->name,
> -			 (ch->cfg.chan = LCDC_CHAN_MAINLCD) ?
> -			 "mainlcd" : "sublcd",
> -			 info->var.xres, info->var.yres,
> -			 ch->cfg.bpp);
> +		dev_info(info->dev, "registered %s/%s as %dx%d %dbpp.\n",
> +			 pdev->name, (ch->cfg.chan = LCDC_CHAN_MAINLCD) ?
> +			 "mainlcd" : "sublcd", info->var.xres, info->var.yres,
> +			 info->var.bits_per_pixel);
>  
>  		/* deferred io mode: disable clock to save power */
>  		if (info->fbdefio || info->state = FBINFO_STATE_SUSPENDED)
> diff --git a/include/video/sh_mobile_lcdc.h b/include/video/sh_mobile_lcdc.h
> index 8101b72..fe30b75 100644
> --- a/include/video/sh_mobile_lcdc.h
> +++ b/include/video/sh_mobile_lcdc.h
> @@ -174,7 +174,8 @@ struct sh_mobile_lcdc_bl_info {
>  
>  struct sh_mobile_lcdc_chan_cfg {
>  	int chan;
> -	int bpp;
> +	int fourcc;
> +	int colorspace;
>  	int interface_type; /* selects RGBn or SYSn I/F, see above */
>  	int clock_divider;
>  	unsigned long flags; /* LCDC_FLAGS_... */
> @@ -184,7 +185,6 @@ struct sh_mobile_lcdc_chan_cfg {
>  	struct sh_mobile_lcdc_board_cfg board_cfg;
>  	struct sh_mobile_lcdc_bl_info bl_info;
>  	struct sh_mobile_lcdc_sys_bus_cfg sys_bus_cfg; /* only for SYSn I/F */
> -	int nonstd;
>  	struct sh_mobile_meram_cfg *meram_cfg;
>  };
>  


Thanks,

Florian Tobias Schandinat

^ permalink raw reply

* Re: [PATCH/RFC v2 1/3] fbdev: Add FOURCC-based format configuration
From: Florian Tobias Schandinat @ 2011-08-26 17:07 UTC (permalink / raw)
  To: Laurent Pinchart; +Cc: linux-fbdev, linux-media, magnus.damm
In-Reply-To: <1313746626-23845-2-git-send-email-laurent.pinchart@ideasonboard.com>

Hi Laurent,

hope we're close to the final thing now. Just a few minor issues.

On 08/19/2011 09:37 AM, Laurent Pinchart wrote:
> This API will be used to support YUV frame buffer formats in a standard
> way.
> 
> Last but not least, create a much needed fbdev API documentation and
> document the format setting APIs.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
>  Documentation/fb/api.txt |  299 ++++++++++++++++++++++++++++++++++++++++++++++
>  include/linux/fb.h       |   27 ++++-
>  2 files changed, 320 insertions(+), 6 deletions(-)
>  create mode 100644 Documentation/fb/api.txt
> 

> diff --git a/include/linux/fb.h b/include/linux/fb.h
> index 1d6836c..c6baf28 100644
> --- a/include/linux/fb.h
> +++ b/include/linux/fb.h
> @@ -69,6 +69,7 @@
>  #define FB_VISUAL_PSEUDOCOLOR		3	/* Pseudo color (like atari) */
>  #define FB_VISUAL_DIRECTCOLOR		4	/* Direct color */
>  #define FB_VISUAL_STATIC_PSEUDOCOLOR	5	/* Pseudo color readonly */
> +#define FB_VISUAL_FOURCC		6	/* Visual identified by a V4L2 FOURCC */
>  
>  #define FB_ACCEL_NONE		0	/* no hardware accelerator	*/
>  #define FB_ACCEL_ATARIBLITT	1	/* Atari Blitter		*/
> @@ -154,6 +155,8 @@
>  
>  #define FB_ACCEL_PUV3_UNIGFX	0xa0	/* PKUnity-v3 Unigfx		*/
>  
> +#define FB_CAP_FOURCC		1	/* Device supports FOURCC-based formats */
> +
>  struct fb_fix_screeninfo {
>  	char id[16];			/* identification string eg "TT Builtin" */
>  	unsigned long smem_start;	/* Start of frame buffer mem */
> @@ -171,7 +174,8 @@ struct fb_fix_screeninfo {
>  	__u32 mmio_len;			/* Length of Memory Mapped I/O  */
>  	__u32 accel;			/* Indicate to driver which	*/
>  					/*  specific chip/card we have	*/
> -	__u16 reserved[3];		/* Reserved for future compatibility */
> +	__u16 capabilities;		/* see FB_CAP_*			*/
> +	__u16 reserved[2];		/* Reserved for future compatibility */
>  };
>  
>  /* Interpretation of offset for color fields: All offsets are from the right,
> @@ -246,12 +250,23 @@ struct fb_var_screeninfo {
>  	__u32 yoffset;			/* resolution			*/
>  
>  	__u32 bits_per_pixel;		/* guess what			*/
> -	__u32 grayscale;		/* != 0 Graylevels instead of colors */
>  
> -	struct fb_bitfield red;		/* bitfield in fb mem if true color, */
> -	struct fb_bitfield green;	/* else only length is significant */
> -	struct fb_bitfield blue;
> -	struct fb_bitfield transp;	/* transparency			*/	
> +	union {
> +		struct {		/* Legacy format API		*/
> +			__u32 grayscale; /* != 0 Graylevels instead of colors */

You should adjust the comment as well, to avoid misleading crazy people ;)
Needs also be fixed in the documentation at some places.

> +			/* bitfields in fb mem if true color, else only */
> +			/* length is significant			*/
> +			struct fb_bitfield red;
> +			struct fb_bitfield green;
> +			struct fb_bitfield blue;
> +			struct fb_bitfield transp;	/* transparency	*/
> +		};
> +		struct {		/* FOURCC-based format API	*/
> +			__u32 fourcc;		/* FOURCC format	*/
> +			__u32 colorspace;

So we have again fields that are not always used. Okay, as we still have 11 left
that shouldn't be a big problem, I think.

> +			__u32 reserved[11];
> +		} format;

Ugh, if you want this union to have a name I suggest 'fourcc' and not 'format'
as the other struct contains format information as well and who knows, maybe in
10 or 20 years we'll have yet another format description that can do things none
of the existing can do.

> +	};
>  
>  	__u32 nonstd;			/* != 0 Non standard pixel format */
>  


Thanks,

Florian Tobias Schandinat

^ permalink raw reply

* [PATCH] fbdev: fix parsing of standard timings
From: Tomi Valkeinen @ 2011-08-26 12:38 UTC (permalink / raw)
  To: linux-fbdev

The standard timings parses uses 1:1 dimensions when the ratio in the
EDID data is 0. However, for EDID 1.3 and later the dimensions are 16:10
when the ratio is 0.

Pass the version and revision numbers to get_std_timing() which can then
make the right decision about dimensions.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
 drivers/video/fbmon.c |   20 ++++++++++++++------
 1 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/drivers/video/fbmon.c b/drivers/video/fbmon.c
index 4f57485..6a6f92e 100644
--- a/drivers/video/fbmon.c
+++ b/drivers/video/fbmon.c
@@ -493,7 +493,8 @@ static int get_est_timing(unsigned char *block, struct fb_videomode *mode)
 	return num;
 }
 
-static int get_std_timing(unsigned char *block, struct fb_videomode *mode)
+static int get_std_timing(unsigned char *block, struct fb_videomode *mode,
+		int ver, int rev)
 {
 	int xres, yres = 0, refresh, ratio, i;
 
@@ -504,7 +505,10 @@ static int get_std_timing(unsigned char *block, struct fb_videomode *mode)
 	ratio = (block[1] & 0xc0) >> 6;
 	switch (ratio) {
 	case 0:
-		yres = xres;
+		if (ver < 1 || (ver = 1 && rev < 3))
+			yres = xres;
+		else
+			yres = (xres * 10)/16;
 		break;
 	case 1:
 		yres = (xres * 3)/4;
@@ -533,12 +537,12 @@ static int get_std_timing(unsigned char *block, struct fb_videomode *mode)
 }
 
 static int get_dst_timing(unsigned char *block,
-			  struct fb_videomode *mode)
+			  struct fb_videomode *mode, int ver, int rev)
 {
 	int j, num = 0;
 
 	for (j = 0; j < 6; j++, block += STD_TIMING_DESCRIPTION_SIZE)
-		num += get_std_timing(block, &mode[num]);
+		num += get_std_timing(block, &mode[num], ver, rev);
 
 	return num;
 }
@@ -599,6 +603,10 @@ static struct fb_videomode *fb_create_modedb(unsigned char *edid, int *dbsize)
 	struct fb_videomode *mode, *m;
 	unsigned char *block;
 	int num = 0, i, first = 1;
+	int ver, rev;
+
+	ver = edid[EDID_STRUCT_VERSION];
+	rev = edid[EDID_STRUCT_REVISION];
 
 	mode = kzalloc(50 * sizeof(struct fb_videomode), GFP_KERNEL);
 	if (mode = NULL)
@@ -632,12 +640,12 @@ static struct fb_videomode *fb_create_modedb(unsigned char *edid, int *dbsize)
 	DPRINTK("   Standard Timings\n");
 	block = edid + STD_TIMING_DESCRIPTIONS_START;
 	for (i = 0; i < STD_TIMING; i++, block += STD_TIMING_DESCRIPTION_SIZE)
-		num += get_std_timing(block, &mode[num]);
+		num += get_std_timing(block, &mode[num], ver, rev);
 
 	block = edid + DETAILED_TIMING_DESCRIPTIONS_START;
 	for (i = 0; i < 4; i++, block+= DETAILED_TIMING_DESCRIPTION_SIZE) {
 		if (block[0] = 0x00 && block[1] = 0x00 && block[3] = 0xfa)
-			num += get_dst_timing(block + 5, &mode[num]);
+			num += get_dst_timing(block + 5, &mode[num], ver, rev);
 	}
 
 	/* Yikes, EDID data is totally useless */
-- 
1.7.4.1


^ permalink raw reply related

* Re: [RFC PATCH v2] Resurrect Intel740 driver: i740fb
From: Ondrej Zary @ 2011-08-26  6:24 UTC (permalink / raw)
  To: Dave Airlie
  Cc: linux-fbdev, Kernel development list, Paul Mundt,
	Florian Tobias Schandinat
In-Reply-To: <CAPM=9tzF7C_gW44csqYwK+wdT9mwWBrA3O_9JQNfg=6aip4kag@mail.gmail.com>

On Tuesday 23 August 2011, Dave Airlie wrote:
> On Sun, Aug 21, 2011 at 9:42 PM, Ondrej Zary <linux@rainbow-software.org> 
wrote:
> > Hello,
> > this is an v2 attempt to resurrect an old (like 2.4.19) out-of-tree
> > driver for Intel740 graphics cards and modify it for recent kernels. The
> > old driver is located at:
> > http://sourceforge.net/projects/i740fbdev/files/
> >
> > It was easier to create a new driver based on skeletonfb, using most of
> > the low level HW code from the old driver. The DDC code is completely
> > new.
> >
> > The driver was tested on two 8MB cards: ManLi and Diamond Stealth II G460
> >
> > The i740_calc_fifo() function formatting is nice but does not pass
> > checkpatch. Making it checkpatch-compliant makes the code look ugly. How
> > to make it both nice and compatible with Linux coding style?
> > (the remaining // comments mark things that need attention - missing xpan
> > and suspend/resume)
> >
> > Changes in v2:
> > - fixed 15bpp (16bpp 555) mode
> > - not working 1280x1024-32 is not a bug but card's feature, it's now
> > handled correctly by the driver
> > - 24bpp modes still don't work in fbtest but it looks like fbtest bug!
> >
> > Is there any better way to test fb drivers than fbtest?
> >
> > no signed-off-by yet
> >
> > --- linux-2.6.39-rc2-orig/drivers/video/Kconfig 2011-04-06
> > 03:30:43.000000000 +0200 +++ linux-2.6.39-rc2/drivers/video/Kconfig    
> >  2011-07-30 11:34:10.000000000 +0200 @@ -1117,6 +1117,17 @@ config
> > FB_RIVA_BACKLIGHT
> >        help
> >          Say Y here if you want to control the backlight of your display.
> >
> > +config FB_I740
> > +       tristate "Intel740 support (EXPERIMENTAL)"
> > +       depends on EXPERIMENTAL && FB && PCI && X86_32 && AGP_INTEL
> > +       select FB_MODE_HELPERS
> > +       select FB_CFB_FILLRECT
> > +       select FB_CFB_COPYAREA
> > +       select FB_CFB_IMAGEBLIT
> > +       select VGASTATE
> > +       help
> > +         This driver supports graphics cards based on Intel740 chip.
> > +
>
> It shouldn't need AGP_INTEL, as its an AGP card not an integrated
> chipset, it might need just AGP.

Oops, I copied that from I810 and then forgot about it...will fix that to 
really match the driver requirements.

BTW. i740 cards are really picky, they don't even POST with most boards that 
don't have i440LX/EX or i440BX/ZX chipsets.


-- 
Ondrej Zary

^ permalink raw reply

* RE: [PATCH 1/2] ARM: SAMSUNG: Add Window Positioning Support for
From: Jingoo Han @ 2011-08-26  5:56 UTC (permalink / raw)
  To: AJAY KUMAR RAMAKRISHNA SHYMALAMMA
  Cc: linux-samsung-soc@vger.kernel.org, linux-fbdev@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, FlorianSchandinat@gmx.de,
	lethal@linux-sh.org, Jingoo Han, Marek Szyprowski,
	ben-linux@fluff.org, BANAJIT GOSWAMI
In-Reply-To: <1314301917-9938-2-git-send-email-ajaykumar.rs@samsung.com>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="windows-1254", Size: 2118 bytes --]


Hi, Ajay.
> -----Original Message-----
> From: Ajay Kumar [mailto:ajaykumar.rs@samsung.com]
> Sent: Friday, August 26, 2011 4:52 AM
> To: linux-samsung-soc@vger.kernel.org; linux-fbdev@vger.kernel.org; linux-
> arm-kernel@lists.infradead.org
> Cc: FlorianSchandinat@gmx.de; lethal@linux-sh.org; jg1.han@samsung.com;
> m.szyprowski@samsung.com; ben-linux@fluff.org; banajit.g@samsung.com
> Subject: [PATCH 1/2] ARM: SAMSUNG: Add Window Positioning Support for s3c-
> fb driver
> 
> This patch:
> 	--adds a data-structure to hold the current position of windows.
> 	--adds an ioctl number to support dynamic positioning the windows.
> 
> Signed-off-by: Ajay Kumar <ajaykumar.rs@samsung.com>
> Signed-off-by: Banajit Goswami <banajit.g@samsung.com>
> ---
>  arch/arm/plat-samsung/include/plat/fb.h |   14 ++++++++++++++
>  1 files changed, 14 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/plat-samsung/include/plat/fb.h b/arch/arm/plat-
> samsung/include/plat/fb.h
> index bd79c0a..77ed75c 100644
> --- a/arch/arm/plat-samsung/include/plat/fb.h
> +++ b/arch/arm/plat-samsung/include/plat/fb.h
> @@ -22,6 +22,18 @@
>   */
>  #define S3C_FB_MAX_WIN	(5)
> 
> +/* struct s3cfb_window_pos
> + * @win_pos_x: X-coordinate of window from the left.
> + * @win_pos_y: Y-coordinate of window from the top.
> + */
> +struct s3cfb_window_pos {
> +	int	win_pos_x;
> +	int	win_pos_y;
> +};
> +
> +/* Custom ioctl */
> +#define S3CFB_WIN_POSITION	_IOW('F', 1, struct s3cfb_window_pos)
Can you change the number from 1 to 203 as follows?
+#define S3CFB_WIN_POSITION	_IOW('F', 203, struct s3cfb_window_pos)
We already use this number as S3CFB_WIN_POSITION.
> +
>  /**
>   * struct s3c_fb_pd_win - per window setup data
>   * @win_mode: The display parameters to initialise (not for window 0)
> @@ -35,6 +47,8 @@ struct s3c_fb_pd_win {
>  	unsigned short		max_bpp;
>  	unsigned short		virtual_x;
>  	unsigned short		virtual_y;
> +
> +	struct s3cfb_window_pos		winpos;
>  };
> 
>  /**
> --
> 1.7.0.4


ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±ýöÝzÿâžØ^n‡r¡ö¦zË\x1aëh™¨è­Ú&£ûàz¿äz¹Þ—ú+€Ê+zf£¢·hšˆ§~†­†Ûiÿÿïêÿ‘êçz_è®\x0fæj:+v‰¨þ)ߣøm

^ permalink raw reply

* Re: [PATCH 2/2] video: s3c-fb: Modify s3c-fb driver to support window positioning
From: Ajay kumar @ 2011-08-26  5:33 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <14401983.184721314319448396.JavaMail.weblogic@epv6ml01>

Hi Jingoo,

2011/8/26 JinGoo Han <jg1.han@samsung.com>:
> Hi, Ajay.
>> -----Original Message-----
>> From: Ajay Kumar [mailto:ajaykumar.rs@samsung.com]
>> Sent: Friday, August 26, 2011 4:52 AM
>> To: linux-samsung-soc@vger.kernel.org; linux-fbdev@vger.kernel.org; linux-
>> arm-kernel@lists.infradead.org
>> Cc: FlorianSchandinat@gmx.de; lethal@linux-sh.org; jg1.han@samsung.com;
>> m.szyprowski@samsung.com; ben-linux@fluff.org; banajit.g@samsung.com
>> Subject: [PATCH 2/2] video: s3c-fb: Modify s3c-fb driver to support window
>> positioning
>>
>> This patch modifies the existing s3c-fb driver to provide
>> flexibility to the user to reposition the framebuffer windows.
>>
>> Signed-off-by: Ajay Kumar <ajaykumar.rs@samsung.com>
>> Signed-off-by: Banajit Goswami <banajit.g@samsung.com>
>> ---
>>  drivers/video/s3c-fb.c |   37 ++++++++++++++++++++++++++++++++-----
>>  1 files changed, 32 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/video/s3c-fb.c b/drivers/video/s3c-fb.c
>> index 0fda252..41179d7 100644
>> --- a/drivers/video/s3c-fb.c
>> +++ b/drivers/video/s3c-fb.c
>> @@ -442,6 +442,7 @@ static int s3c_fb_set_par(struct fb_info *info)
>>       struct fb_var_screeninfo *var = &info->var;
>>       struct s3c_fb_win *win = info->par;
>>       struct s3c_fb *sfb = win->parent;
>> +     struct s3cfb_window_pos *winpos = &win->windata->winpos;
>>       void __iomem *regs = sfb->regs;
>>       void __iomem *buf = regs;
>>       int win_no = win->index;
>> @@ -539,12 +540,13 @@ static int s3c_fb_set_par(struct fb_info *info)
>>
>>       /* write 'OSD' registers to control position of framebuffer */
>>
>> -     data = VIDOSDxA_TOPLEFT_X(0) | VIDOSDxA_TOPLEFT_Y(0);
>> +     data = VIDOSDxA_TOPLEFT_X(winpos->win_pos_x) |
>> +            VIDOSDxA_TOPLEFT_Y(winpos->win_pos_y);
>>       writel(data, regs + VIDOSD_A(win_no, sfb->variant));
>>
>> -     data = VIDOSDxB_BOTRIGHT_X(s3c_fb_align_word(var->bits_per_pixel,
>> -                                                  var->xres - 1)) |
>> -            VIDOSDxB_BOTRIGHT_Y(var->yres - 1);
>> +     data = VIDOSDxB_BOTRIGHT_X((s3c_fb_align_word(var->bits_per_pixel,
>> +            (winpos->win_pos_x + var->xres - 1)))) |
>> +            VIDOSDxB_BOTRIGHT_Y((winpos->win_pos_y + var->yres - 1));
>>
>>       writel(data, regs + VIDOSD_B(win_no, sfb->variant));
>>
>> @@ -999,8 +1001,10 @@ static int s3c_fb_ioctl(struct fb_info *info,
>> unsigned int cmd,
>>  {
>>       struct s3c_fb_win *win = info->par;
>>       struct s3c_fb *sfb = win->parent;
>> -     int ret;
>> +     struct s3cfb_window_pos *winpos = &win->windata->winpos;
>> +     int ret = 0;
>>       u32 crtc;
>> +     u32 data;
>>
>>       switch (cmd) {
>>       case FBIO_WAITFORVSYNC:
>> @@ -1011,6 +1015,29 @@ static int s3c_fb_ioctl(struct fb_info *info,
>> unsigned int cmd,
>>
>>               ret = s3c_fb_wait_for_vsync(sfb, crtc);
>>               break;
>> +     case S3CFB_WIN_POSITION:
>> +             if (copy_from_user(winpos, (u32 __user *)arg,
>> +                                     sizeof(struct s3cfb_window_pos))) {
>> +                     ret = -EFAULT;
>> +                     break;
>> +             }
>> +
>> +             shadow_protect_win(win, 1);
>> +
>> +             /* write 'OSD' registers to set position of the window */
>> +             data = VIDOSDxA_TOPLEFT_X(winpos->win_pos_x) |
>> +                    VIDOSDxA_TOPLEFT_Y(winpos->win_pos_y);
>> +             writel(data, sfb->regs + VIDOSD_A(win->index, sfb->variant));
>> +
>> +             data = VIDOSDxB_BOTRIGHT_X(
>> +                             s3c_fb_align_word(info->var.bits_per_pixel,
>> +                             (winpos->win_pos_x + info->var.xres - 1)));
>> +             data |= VIDOSDxB_BOTRIGHT_Y(winpos->win_pos_y +
>> +                             info->var.yres - 1);
>> +             writel(data, sfb->regs + VIDOSD_B(win->index, sfb->variant));
>> +
>> +             shadow_protect_win(win, 0);
>> +             break;
> Can you move this to separate function?
> In my opinion, it would be better for readability and consistency.
> Also, FBIO_WAITFORVSYNC has been implemented in this way.
>                ret = s3c_fb_wait_for_vsync(sfb, crtc);
> How about adding a function 's3c_fb_set_window_position' for this as belows?
> +int s3c_fb_set_window_position(struct fb_info *info,
> +                               struct s3cfb_window_pos winpos)

Thanks for your suggestion.
I have considered it, and now I have written a separate function for this.
I will be sending it in V2 version.
>                ........
> +       case S3CFB_WIN_POSITION:
> +               if (copy_from_user(winpos, (u32 __user *)arg,
> +                                       sizeof(struct s3cfb_window_pos))) {
> +                       ret = -EFAULT;
> +                       break;
> +               }
> +               ret = s3c_fb_set_window_position(info, winpos);
> +               break;
>>       default:
>>               ret = -ENOTTY;
>>       }
>> --
>> 1.7.0.4
>
>
>

^ permalink raw reply

* RE: [PATCH 2/2] video: s3c-fb: Modify s3c-fb driver to support window
From: JinGoo Han @ 2011-08-26  0:44 UTC (permalink / raw)
  To: AJAY KUMAR RAMAKRISHNA SHYMALAMMA,
	linux-samsung-soc@vger.kernel.org, linux-fbdev@vger.kernel.org
  Cc: FlorianSchandinat@gmx.de, lethal@linux-sh.org, Marek Szyprowski,
	ben-linux@fluff.org, BANAJIT GOSWAMI
In-Reply-To: <1314301917-9938-3-git-send-email-ajaykumar.rs@samsung.com>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="windows-1254", Size: 4182 bytes --]

Hi, Ajay.
> -----Original Message-----
> From: Ajay Kumar [mailto:ajaykumar.rs@samsung.com]
> Sent: Friday, August 26, 2011 4:52 AM
> To: linux-samsung-soc@vger.kernel.org; linux-fbdev@vger.kernel.org; linux-
> arm-kernel@lists.infradead.org
> Cc: FlorianSchandinat@gmx.de; lethal@linux-sh.org; jg1.han@samsung.com;
> m.szyprowski@samsung.com; ben-linux@fluff.org; banajit.g@samsung.com
> Subject: [PATCH 2/2] video: s3c-fb: Modify s3c-fb driver to support window
> positioning
> 
> This patch modifies the existing s3c-fb driver to provide
> flexibility to the user to reposition the framebuffer windows.
> 
> Signed-off-by: Ajay Kumar <ajaykumar.rs@samsung.com>
> Signed-off-by: Banajit Goswami <banajit.g@samsung.com>
> ---
>  drivers/video/s3c-fb.c |   37 ++++++++++++++++++++++++++++++++-----
>  1 files changed, 32 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/video/s3c-fb.c b/drivers/video/s3c-fb.c
> index 0fda252..41179d7 100644
> --- a/drivers/video/s3c-fb.c
> +++ b/drivers/video/s3c-fb.c
> @@ -442,6 +442,7 @@ static int s3c_fb_set_par(struct fb_info *info)
>  	struct fb_var_screeninfo *var = &info->var;
>  	struct s3c_fb_win *win = info->par;
>  	struct s3c_fb *sfb = win->parent;
> +	struct s3cfb_window_pos *winpos = &win->windata->winpos;
>  	void __iomem *regs = sfb->regs;
>  	void __iomem *buf = regs;
>  	int win_no = win->index;
> @@ -539,12 +540,13 @@ static int s3c_fb_set_par(struct fb_info *info)
> 
>  	/* write 'OSD' registers to control position of framebuffer */
> 
> -	data = VIDOSDxA_TOPLEFT_X(0) | VIDOSDxA_TOPLEFT_Y(0);
> +	data = VIDOSDxA_TOPLEFT_X(winpos->win_pos_x) |
> +	       VIDOSDxA_TOPLEFT_Y(winpos->win_pos_y);
>  	writel(data, regs + VIDOSD_A(win_no, sfb->variant));
> 
> -	data = VIDOSDxB_BOTRIGHT_X(s3c_fb_align_word(var->bits_per_pixel,
> -						     var->xres - 1)) |
> -	       VIDOSDxB_BOTRIGHT_Y(var->yres - 1);
> +	data = VIDOSDxB_BOTRIGHT_X((s3c_fb_align_word(var->bits_per_pixel,
> +	       (winpos->win_pos_x + var->xres - 1)))) |
> +	       VIDOSDxB_BOTRIGHT_Y((winpos->win_pos_y + var->yres - 1));
> 
>  	writel(data, regs + VIDOSD_B(win_no, sfb->variant));
> 
> @@ -999,8 +1001,10 @@ static int s3c_fb_ioctl(struct fb_info *info,
> unsigned int cmd,
>  {
>  	struct s3c_fb_win *win = info->par;
>  	struct s3c_fb *sfb = win->parent;
> -	int ret;
> +	struct s3cfb_window_pos *winpos = &win->windata->winpos;
> +	int ret = 0;
>  	u32 crtc;
> +	u32 data;
> 
>  	switch (cmd) {
>  	case FBIO_WAITFORVSYNC:
> @@ -1011,6 +1015,29 @@ static int s3c_fb_ioctl(struct fb_info *info,
> unsigned int cmd,
> 
>  		ret = s3c_fb_wait_for_vsync(sfb, crtc);
>  		break;
> +	case S3CFB_WIN_POSITION:
> +		if (copy_from_user(winpos, (u32 __user *)arg,
> +					sizeof(struct s3cfb_window_pos))) {
> +			ret = -EFAULT;
> +			break;
> +		}
> +
> +		shadow_protect_win(win, 1);
> +
> +		/* write 'OSD' registers to set position of the window */
> +		data = VIDOSDxA_TOPLEFT_X(winpos->win_pos_x) |
> +		       VIDOSDxA_TOPLEFT_Y(winpos->win_pos_y);
> +		writel(data, sfb->regs + VIDOSD_A(win->index, sfb->variant));
> +
> +		data = VIDOSDxB_BOTRIGHT_X(
> +				s3c_fb_align_word(info->var.bits_per_pixel,
> +				(winpos->win_pos_x + info->var.xres - 1)));
> +		data |=	VIDOSDxB_BOTRIGHT_Y(winpos->win_pos_y +
> +				info->var.yres - 1);
> +		writel(data, sfb->regs + VIDOSD_B(win->index, sfb->variant));
> +
> +		shadow_protect_win(win, 0);
> +		break;
Can you move this to separate function?
In my opinion, it would be better for readability and consistency.
Also, FBIO_WAITFORVSYNC has been implemented in this way.
		ret = s3c_fb_wait_for_vsync(sfb, crtc);
How about adding a function 's3c_fb_set_window_position' for this as belows?
+int s3c_fb_set_window_position(struct fb_info *info,
+				struct s3cfb_window_pos winpos)
		........
+	case S3CFB_WIN_POSITION:
+		if (copy_from_user(winpos, (u32 __user *)arg,
+					sizeof(struct s3cfb_window_pos))) {
+			ret = -EFAULT;
+			break;
+		}
+		ret = s3c_fb_set_window_position(info, winpos);
+		break;
>  	default:
>  		ret = -ENOTTY;
>  	}
> --
> 1.7.0.4


ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±ýöÝzÿâžØ^n‡r¡ö¦zË\x1aëh™¨è­Ú&£ûàz¿äz¹Þ—ú+€Ê+zf£¢·hšˆ§~†­†Ûiÿÿïêÿ‘êçz_è®\x0fæj:+v‰¨þ)ߣøm

^ permalink raw reply

* [PATCH 2/2] video: s3c-fb: Modify s3c-fb driver to support window
From: Ajay Kumar @ 2011-08-25 13:54 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1314301917-9938-1-git-send-email-ajaykumar.rs@samsung.com>

This patch modifies the existing s3c-fb driver to provide
flexibility to the user to reposition the framebuffer windows.

Signed-off-by: Ajay Kumar <ajaykumar.rs@samsung.com>
Signed-off-by: Banajit Goswami <banajit.g@samsung.com>
---
 drivers/video/s3c-fb.c |   37 ++++++++++++++++++++++++++++++++-----
 1 files changed, 32 insertions(+), 5 deletions(-)

diff --git a/drivers/video/s3c-fb.c b/drivers/video/s3c-fb.c
index 0fda252..41179d7 100644
--- a/drivers/video/s3c-fb.c
+++ b/drivers/video/s3c-fb.c
@@ -442,6 +442,7 @@ static int s3c_fb_set_par(struct fb_info *info)
 	struct fb_var_screeninfo *var = &info->var;
 	struct s3c_fb_win *win = info->par;
 	struct s3c_fb *sfb = win->parent;
+	struct s3cfb_window_pos *winpos = &win->windata->winpos;
 	void __iomem *regs = sfb->regs;
 	void __iomem *buf = regs;
 	int win_no = win->index;
@@ -539,12 +540,13 @@ static int s3c_fb_set_par(struct fb_info *info)
 
 	/* write 'OSD' registers to control position of framebuffer */
 
-	data = VIDOSDxA_TOPLEFT_X(0) | VIDOSDxA_TOPLEFT_Y(0);
+	data = VIDOSDxA_TOPLEFT_X(winpos->win_pos_x) |
+	       VIDOSDxA_TOPLEFT_Y(winpos->win_pos_y);
 	writel(data, regs + VIDOSD_A(win_no, sfb->variant));
 
-	data = VIDOSDxB_BOTRIGHT_X(s3c_fb_align_word(var->bits_per_pixel,
-						     var->xres - 1)) |
-	       VIDOSDxB_BOTRIGHT_Y(var->yres - 1);
+	data = VIDOSDxB_BOTRIGHT_X((s3c_fb_align_word(var->bits_per_pixel,
+	       (winpos->win_pos_x + var->xres - 1)))) |
+	       VIDOSDxB_BOTRIGHT_Y((winpos->win_pos_y + var->yres - 1));
 
 	writel(data, regs + VIDOSD_B(win_no, sfb->variant));
 
@@ -999,8 +1001,10 @@ static int s3c_fb_ioctl(struct fb_info *info, unsigned int cmd,
 {
 	struct s3c_fb_win *win = info->par;
 	struct s3c_fb *sfb = win->parent;
-	int ret;
+	struct s3cfb_window_pos *winpos = &win->windata->winpos;
+	int ret = 0;
 	u32 crtc;
+	u32 data;
 
 	switch (cmd) {
 	case FBIO_WAITFORVSYNC:
@@ -1011,6 +1015,29 @@ static int s3c_fb_ioctl(struct fb_info *info, unsigned int cmd,
 
 		ret = s3c_fb_wait_for_vsync(sfb, crtc);
 		break;
+	case S3CFB_WIN_POSITION:
+		if (copy_from_user(winpos, (u32 __user *)arg,
+					sizeof(struct s3cfb_window_pos))) {
+			ret = -EFAULT;
+			break;
+		}
+
+		shadow_protect_win(win, 1);
+
+		/* write 'OSD' registers to set position of the window */
+		data = VIDOSDxA_TOPLEFT_X(winpos->win_pos_x) |
+		       VIDOSDxA_TOPLEFT_Y(winpos->win_pos_y);
+		writel(data, sfb->regs + VIDOSD_A(win->index, sfb->variant));
+
+		data = VIDOSDxB_BOTRIGHT_X(
+				s3c_fb_align_word(info->var.bits_per_pixel,
+				(winpos->win_pos_x + info->var.xres - 1)));
+		data |=	VIDOSDxB_BOTRIGHT_Y(winpos->win_pos_y +
+				info->var.yres - 1);
+		writel(data, sfb->regs + VIDOSD_B(win->index, sfb->variant));
+
+		shadow_protect_win(win, 0);
+		break;
 	default:
 		ret = -ENOTTY;
 	}
-- 
1.7.0.4


^ permalink raw reply related

* [PATCH 1/2] ARM: SAMSUNG: Add Window Positioning Support for s3c-fb
From: Ajay Kumar @ 2011-08-25 13:54 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1314301917-9938-1-git-send-email-ajaykumar.rs@samsung.com>

This patch:
	--adds a data-structure to hold the current position of windows.
	--adds an ioctl number to support dynamic positioning the windows.

Signed-off-by: Ajay Kumar <ajaykumar.rs@samsung.com>
Signed-off-by: Banajit Goswami <banajit.g@samsung.com>
---
 arch/arm/plat-samsung/include/plat/fb.h |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/arch/arm/plat-samsung/include/plat/fb.h b/arch/arm/plat-samsung/include/plat/fb.h
index bd79c0a..77ed75c 100644
--- a/arch/arm/plat-samsung/include/plat/fb.h
+++ b/arch/arm/plat-samsung/include/plat/fb.h
@@ -22,6 +22,18 @@
  */
 #define S3C_FB_MAX_WIN	(5)
 
+/* struct s3cfb_window_pos
+ * @win_pos_x: X-coordinate of window from the left.
+ * @win_pos_y: Y-coordinate of window from the top.
+ */
+struct s3cfb_window_pos {
+	int	win_pos_x;
+	int	win_pos_y;
+};
+
+/* Custom ioctl */
+#define S3CFB_WIN_POSITION	_IOW('F', 1, struct s3cfb_window_pos)
+
 /**
  * struct s3c_fb_pd_win - per window setup data
  * @win_mode: The display parameters to initialise (not for window 0)
@@ -35,6 +47,8 @@ struct s3c_fb_pd_win {
 	unsigned short		max_bpp;
 	unsigned short		virtual_x;
 	unsigned short		virtual_y;
+
+	struct s3cfb_window_pos		winpos;
 };
 
 /**
-- 
1.7.0.4


^ permalink raw reply related

* [PATCH 0/2] video: s3c-fb: Add window positioning support
From: Ajay Kumar @ 2011-08-25 13:54 UTC (permalink / raw)
  To: linux-arm-kernel

These patches are created against "for-next" branch of Kukjin Kim's tree at:
git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung.git

This patch adds support for positioning of the FB windows on the LCD screen.

This patchset creates an ioctl and defines a data structure which are
specific to samsung SOCs, to hold the window position.

Just as a note, there are many drivers like mx3fb.c, au1200fb.c and OMAP
seem to be doing window/plane positioning in their driver code.
Is it possible to have this window positioning support at a common place?

For instance, we can have a common struture and ioctl number in 
include/linux/fb.h as below:

	#define FBIOPOS_OVERLAY_WIN    _IOW('F', 0x21, struct fb_overlay_win_pos)

	struct fb_overlay_win_pos {
		__u32 win_pos_x;  /* x-offset of window from LCD(0,0) */
		__u32 win_pos_y;  /* y-offset of window from LCD(0,0) */
	};

where LCD(0,0) means the first pixel of the LCD screen.
Individual drivers can have implementation for this ioctl.

To Kukjin Kim,
  [PATCH 1/2] ARM: SAMSUNG: Add Window Positioning Support for s3c-fb driver

To Paul Mundt, Florian Tobias Schandinat
  [PATCH 2/2] video: s3c-fb: Modify s3c-fb driver to support window positioning

 arch/arm/plat-samsung/include/plat/fb.h |   14 +++++++++++
 drivers/video/s3c-fb.c                  |   37 ++++++++++++++++++++++++++----
 2 files changed, 46 insertions(+), 5 deletions(-)


^ permalink raw reply

* [PATCH] video/backlight: Remove obsolete cleanup for clientdata
From: Wolfram Sang @ 2011-08-25 10:54 UTC (permalink / raw)
  To: linux-i2c-u79uwXL29TY76Z2rM5mHXA
  Cc: Wolfram Sang, Richard Purdie, Paul Mundt, Andrew Morton,
	linux-fbdev-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

A few new i2c-drivers came into the kernel which clear the clientdata-pointer
on exit or error. This is obsolete meanwhile, the core will do it.

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Cc: Richard Purdie <rpurdie@rpsys.net>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
---
 drivers/video/backlight/adp8870_bl.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/drivers/video/backlight/adp8870_bl.c b/drivers/video/backlight/adp8870_bl.c
index 05a8832..71d90f4 100644
--- a/drivers/video/backlight/adp8870_bl.c
+++ b/drivers/video/backlight/adp8870_bl.c
@@ -932,7 +932,6 @@ out:
 out1:
 	backlight_device_unregister(bl);
 out2:
-	i2c_set_clientdata(client, NULL);
 	kfree(data);
 
 	return ret;
@@ -952,7 +951,6 @@ static int __devexit adp8870_remove(struct i2c_client *client)
 			&adp8870_bl_attr_group);
 
 	backlight_device_unregister(data->bl);
-	i2c_set_clientdata(client, NULL);
 	kfree(data);
 
 	return 0;
-- 
1.7.5.4


^ permalink raw reply related

* [PATCH] video: mxsfb: add missing include of linux/module.h
From: Axel Lin @ 2011-08-25  7:54 UTC (permalink / raw)
  To: linux-kernel; +Cc: Sascha Hauer, Paul Mundt, linux-fbdev

Include linux/module.h to fix below build error:

                 from drivers/video/mxsfb.c:42:
arch/arm/mach-mxs/include/mach/memory.h:22:1: warning: this is the location of the previous definition
drivers/video/mxsfb.c:574: error: 'THIS_MODULE' undeclared here (not in a function)
drivers/video/mxsfb.c:893: warning: data definition has no type or storage class
drivers/video/mxsfb.c:893: warning: type defaults to 'int' in declaration of 'MODULE_DEVICE_TABLE'
drivers/video/mxsfb.c:893: warning: parameter names (without types) in function declaration
drivers/video/mxsfb.c:917: error: expected declaration specifiers or '...' before string constant
drivers/video/mxsfb.c:917: warning: data definition has no type or storage class
drivers/video/mxsfb.c:917: warning: type defaults to 'int' in declaration of 'MODULE_DESCRIPTION'
drivers/video/mxsfb.c:917: warning: function declaration isn't a prototype
drivers/video/mxsfb.c:918: error: expected declaration specifiers or '...' before string constant
drivers/video/mxsfb.c:918: warning: data definition has no type or storage class
drivers/video/mxsfb.c:918: warning: type defaults to 'int' in declaration of 'MODULE_AUTHOR'
drivers/video/mxsfb.c:918: warning: function declaration isn't a prototype
drivers/video/mxsfb.c:919: error: expected declaration specifiers or '...' before string constant
drivers/video/mxsfb.c:919: warning: data definition has no type or storage class
drivers/video/mxsfb.c:919: warning: type defaults to 'int' in declaration of 'MODULE_LICENSE'
drivers/video/mxsfb.c:919: warning: function declaration isn't a prototype
make[2]: *** [drivers/video/mxsfb.o] Error 1
make[1]: *** [drivers/video] Error 2
make: *** [drivers] Error 2

Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
 drivers/video/mxsfb.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/video/mxsfb.c b/drivers/video/mxsfb.c
index 0b2f2dd..d837d63 100644
--- a/drivers/video/mxsfb.c
+++ b/drivers/video/mxsfb.c
@@ -39,6 +39,7 @@
  * the required value in the imx_fb_videomode structure.
  */
 
+#include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/platform_device.h>
 #include <linux/clk.h>
-- 
1.7.4.1




^ permalink raw reply related

* Re: linux-next tree addition request (fbdev)
From: Stephen Rothwell @ 2011-08-24 14:33 UTC (permalink / raw)
  To: Florian Tobias Schandinat
  Cc: linux-next, linux-fbdev@vger.kernel.org, Paul Mundt
In-Reply-To: <4E54FF5E.5050308@gmx.de>

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

Hi Florian,

On Wed, 24 Aug 2011 13:40:46 +0000 Florian Tobias Schandinat <FlorianSchandinat@gmx.de> wrote:
>
> can you please add
> 
>     git://github.com/schandinat/linux-2.6.git fbdev-next
> 
> to linux-next. It collects patches for the frame buffer subsystem.
> Can you please add the linux-fbdev@vger.kernel.org mailing list as additional
> contact for warnings/errors/problems?
> 
> You probably want to drop Paul's fbdev branches as they contain some outdated
> patches that will conflict with the newer versions.

OK, Paul is still listed as the frame buffer subsystem maintainer, so I
will need an Ack from him.  When I get that, I will replace his tree with
yours.  I assume someone will update the MAINTAINERS file.

I also have another tree from Paul (called fbdev-current) that contained
fixes for Linus' current release.  I also assume that that tree will be
dropped (unless you have a new version of that as well).

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

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

^ permalink raw reply

* Re: [PULL] Use display information in info not in var for panning
From: Laurent Pinchart @ 2011-08-24 14:24 UTC (permalink / raw)
  To: linux-fbdev
In-Reply-To: <201108191038.43286.laurent.pinchart@ideasonboard.com>

Hi Florian,

On Wednesday 24 August 2011 16:15:46 Florian Tobias Schandinat wrote:
> On 08/19/2011 08:38 AM, Laurent Pinchart wrote:
> > Hi Florian (or should I call you Florian Tobias ?),
> 
> Florian is good. I just use my full name as an indication of authenticity.
> 
> > Here is the latest version of the pan patches based on top of v3.1-rc2.
> > Apart from being rebased, they're identical to the v3 version posted to
> > the linux- fbdev mailing list.
> 
> Pulled this one.

Thank you.

> JFYI: I want to have a deeper look at the other pull request you sent and
> therefore I will need some time for it.

No worries. Review is always appreciated :-)

-- 
Regards,

Laurent Pinchart

^ permalink raw reply

* Re: [PATCH RESEND] video: s3c-fb: Add support EXYNOS4 FIMD
From: Florian Tobias Schandinat @ 2011-08-24 14:23 UTC (permalink / raw)
  To: linux-fbdev
In-Reply-To: <1311673687-1522-1-git-send-email-jg1.han@samsung.com>

On 08/22/2011 03:16 AM, Jingoo Han wrote:
> This patch adds struct s3c_fb_driverdata s3c_fb_data_exynos4 for EXYNOS4
> and adds lcd clock gating support.
> 
> FIMD driver needs two clocks for FIMD IP and LCD pixel clock. Previously,
> both clocks are provided by using bus clock such as HCLK. However, EXYNOS4
> can not select HCLK for LCD pixel clock because the EXYNOS4 FIMD IP does not
> have the CLKSEL bit of VIDCON0. So, FIMD driver should provide the lcd clock
> using SCLK_FIMD as LCD pixel clock for EXYNOS4.
> 
> The driver selects enabling lcd clock according to has_clksel which means
> the CLKSEL bit of VIDCON0. If there is has_clksel, the driver will not
> enable the lcd clock using SCLK_FIMD because bus clock using HCLK is used
> a LCD pixel clock.
> 
> Signed-off-by: Jingoo Han <jg1.han@samsung.com>

Looks good to me, I've applied it.


Thanks,

Florian Tobias Schandinat


> ---
>  drivers/video/Kconfig  |    2 +-
>  drivers/video/s3c-fb.c |   88 +++++++++++++++++++++++++++++++++++++++++++++--
>  2 files changed, 85 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
> index 549b960..963b8b7 100644
> --- a/drivers/video/Kconfig
> +++ b/drivers/video/Kconfig
> @@ -2027,7 +2027,7 @@ config FB_TMIO_ACCELL
>  
>  config FB_S3C
>  	tristate "Samsung S3C framebuffer support"
> -	depends on FB && S3C_DEV_FB
> +	depends on FB && (S3C_DEV_FB || S5P_DEV_FIMD0)
>  	select FB_CFB_FILLRECT
>  	select FB_CFB_COPYAREA
>  	select FB_CFB_IMAGEBLIT
> diff --git a/drivers/video/s3c-fb.c b/drivers/video/s3c-fb.c
> index 4aecf21..cb0d3ea 100644
> --- a/drivers/video/s3c-fb.c
> +++ b/drivers/video/s3c-fb.c
> @@ -81,6 +81,7 @@ struct s3c_fb;
>   * @palette: Address of palette memory, or 0 if none.
>   * @has_prtcon: Set if has PRTCON register.
>   * @has_shadowcon: Set if has SHADOWCON register.
> + * @has_clksel: Set if VIDCON0 register has CLKSEL bit.
>   */
>  struct s3c_fb_variant {
>  	unsigned int	is_2443:1;
> @@ -98,6 +99,7 @@ struct s3c_fb_variant {
>  
>  	unsigned int	has_prtcon:1;
>  	unsigned int	has_shadowcon:1;
> +	unsigned int	has_clksel:1;
>  };
>  
>  /**
> @@ -186,6 +188,7 @@ struct s3c_fb_vsync {
>   * @dev: The device that we bound to, for printing, etc.
>   * @regs_res: The resource we claimed for the IO registers.
>   * @bus_clk: The clk (hclk) feeding our interface and possibly pixclk.
> + * @lcd_clk: The clk (sclk) feeding pixclk.
>   * @regs: The mapped hardware registers.
>   * @variant: Variant information for this hardware.
>   * @enabled: A bitmask of enabled hardware windows.
> @@ -200,6 +203,7 @@ struct s3c_fb {
>  	struct device		*dev;
>  	struct resource		*regs_res;
>  	struct clk		*bus_clk;
> +	struct clk		*lcd_clk;
>  	void __iomem		*regs;
>  	struct s3c_fb_variant	 variant;
>  
> @@ -336,10 +340,15 @@ static int s3c_fb_check_var(struct fb_var_screeninfo *var,
>   */
>  static int s3c_fb_calc_pixclk(struct s3c_fb *sfb, unsigned int pixclk)
>  {
> -	unsigned long clk = clk_get_rate(sfb->bus_clk);
> +	unsigned long clk;
>  	unsigned long long tmp;
>  	unsigned int result;
>  
> +	if (sfb->variant.has_clksel)
> +		clk = clk_get_rate(sfb->bus_clk);
> +	else
> +		clk = clk_get_rate(sfb->lcd_clk);
> +
>  	tmp = (unsigned long long)clk;
>  	tmp *= pixclk;
>  
> @@ -1354,13 +1363,24 @@ static int __devinit s3c_fb_probe(struct platform_device *pdev)
>  
>  	clk_enable(sfb->bus_clk);
>  
> +	if (!sfb->variant.has_clksel) {
> +		sfb->lcd_clk = clk_get(dev, "sclk_fimd");
> +		if (IS_ERR(sfb->lcd_clk)) {
> +			dev_err(dev, "failed to get lcd clock\n");
> +			ret = PTR_ERR(sfb->lcd_clk);
> +			goto err_bus_clk;
> +		}
> +
> +		clk_enable(sfb->lcd_clk);
> +	}
> +
>  	pm_runtime_enable(sfb->dev);
>  
>  	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>  	if (!res) {
>  		dev_err(dev, "failed to find registers\n");
>  		ret = -ENOENT;
> -		goto err_clk;
> +		goto err_lcd_clk;
>  	}
>  
>  	sfb->regs_res = request_mem_region(res->start, resource_size(res),
> @@ -1368,7 +1388,7 @@ static int __devinit s3c_fb_probe(struct platform_device *pdev)
>  	if (!sfb->regs_res) {
>  		dev_err(dev, "failed to claim register region\n");
>  		ret = -ENOENT;
> -		goto err_clk;
> +		goto err_lcd_clk;
>  	}
>  
>  	sfb->regs = ioremap(res->start, resource_size(res));
> @@ -1450,7 +1470,13 @@ err_ioremap:
>  err_req_region:
>  	release_mem_region(sfb->regs_res->start, resource_size(sfb->regs_res));
>  
> -err_clk:
> +err_lcd_clk:
> +	if (!sfb->variant.has_clksel) {
> +		clk_disable(sfb->lcd_clk);
> +		clk_put(sfb->lcd_clk);
> +	}
> +
> +err_bus_clk:
>  	clk_disable(sfb->bus_clk);
>  	clk_put(sfb->bus_clk);
>  
> @@ -1481,6 +1507,11 @@ static int __devexit s3c_fb_remove(struct platform_device *pdev)
>  
>  	iounmap(sfb->regs);
>  
> +	if (!sfb->variant.has_clksel) {
> +		clk_disable(sfb->lcd_clk);
> +		clk_put(sfb->lcd_clk);
> +	}
> +
>  	clk_disable(sfb->bus_clk);
>  	clk_put(sfb->bus_clk);
>  
> @@ -1510,6 +1541,9 @@ static int s3c_fb_suspend(struct device *dev)
>  		s3c_fb_blank(FB_BLANK_POWERDOWN, win->fbinfo);
>  	}
>  
> +	if (!sfb->variant.has_clksel)
> +		clk_disable(sfb->lcd_clk);
> +
>  	clk_disable(sfb->bus_clk);
>  	return 0;
>  }
> @@ -1524,6 +1558,9 @@ static int s3c_fb_resume(struct device *dev)
>  
>  	clk_enable(sfb->bus_clk);
>  
> +	if (!sfb->variant.has_clksel)
> +		clk_enable(sfb->lcd_clk);
> +
>  	/* setup gpio and output polarity controls */
>  	pd->setup_gpio();
>  	writel(pd->vidcon1, sfb->regs + VIDCON1);
> @@ -1569,6 +1606,9 @@ static int s3c_fb_runtime_suspend(struct device *dev)
>  		s3c_fb_blank(FB_BLANK_POWERDOWN, win->fbinfo);
>  	}
>  
> +	if (!sfb->variant.has_clksel)
> +		clk_disable(sfb->lcd_clk);
> +
>  	clk_disable(sfb->bus_clk);
>  	return 0;
>  }
> @@ -1583,6 +1623,9 @@ static int s3c_fb_runtime_resume(struct device *dev)
>  
>  	clk_enable(sfb->bus_clk);
>  
> +	if (!sfb->variant.has_clksel)
> +		clk_enable(sfb->lcd_clk);
> +
>  	/* setup gpio and output polarity controls */
>  	pd->setup_gpio();
>  	writel(pd->vidcon1, sfb->regs + VIDCON1);
> @@ -1755,6 +1798,7 @@ static struct s3c_fb_driverdata s3c_fb_data_64xx = {
>  		},
>  
>  		.has_prtcon	= 1,
> +		.has_clksel	= 1,
>  	},
>  	.win[0]	= &s3c_fb_data_64xx_wins[0],
>  	.win[1]	= &s3c_fb_data_64xx_wins[1],
> @@ -1785,6 +1829,7 @@ static struct s3c_fb_driverdata s3c_fb_data_s5pc100 = {
>  		},
>  
>  		.has_prtcon	= 1,
> +		.has_clksel	= 1,
>  	},
>  	.win[0]	= &s3c_fb_data_s5p_wins[0],
>  	.win[1]	= &s3c_fb_data_s5p_wins[1],
> @@ -1815,6 +1860,37 @@ static struct s3c_fb_driverdata s3c_fb_data_s5pv210 = {
>  		},
>  
>  		.has_shadowcon	= 1,
> +		.has_clksel	= 1,
> +	},
> +	.win[0]	= &s3c_fb_data_s5p_wins[0],
> +	.win[1]	= &s3c_fb_data_s5p_wins[1],
> +	.win[2]	= &s3c_fb_data_s5p_wins[2],
> +	.win[3]	= &s3c_fb_data_s5p_wins[3],
> +	.win[4]	= &s3c_fb_data_s5p_wins[4],
> +};
> +
> +static struct s3c_fb_driverdata s3c_fb_data_exynos4 = {
> +	.variant = {
> +		.nr_windows	= 5,
> +		.vidtcon	= VIDTCON0,
> +		.wincon		= WINCON(0),
> +		.winmap		= WINxMAP(0),
> +		.keycon		= WKEYCON,
> +		.osd		= VIDOSD_BASE,
> +		.osd_stride	= 16,
> +		.buf_start	= VIDW_BUF_START(0),
> +		.buf_size	= VIDW_BUF_SIZE(0),
> +		.buf_end	= VIDW_BUF_END(0),
> +
> +		.palette = {
> +			[0] = 0x2400,
> +			[1] = 0x2800,
> +			[2] = 0x2c00,
> +			[3] = 0x3000,
> +			[4] = 0x3400,
> +		},
> +
> +		.has_shadowcon	= 1,
>  	},
>  	.win[0]	= &s3c_fb_data_s5p_wins[0],
>  	.win[1]	= &s3c_fb_data_s5p_wins[1],
> @@ -1843,6 +1919,7 @@ static struct s3c_fb_driverdata s3c_fb_data_s3c2443 = {
>  			[0] = 0x400,
>  			[1] = 0x800,
>  		},
> +		.has_clksel	= 1,
>  	},
>  	.win[0] = &(struct s3c_fb_win_variant) {
>  		.palette_sz	= 256,
> @@ -1870,6 +1947,9 @@ static struct platform_device_id s3c_fb_driver_ids[] = {
>  		.name		= "s5pv210-fb",
>  		.driver_data	= (unsigned long)&s3c_fb_data_s5pv210,
>  	}, {
> +		.name		= "exynos4-fb",
> +		.driver_data	= (unsigned long)&s3c_fb_data_exynos4,
> +	}, {
>  		.name		= "s3c2443-fb",
>  		.driver_data	= (unsigned long)&s3c_fb_data_s3c2443,
>  	},


^ permalink raw reply

* Re: [PULL] Use display information in info not in var for panning
From: Florian Tobias Schandinat @ 2011-08-24 14:15 UTC (permalink / raw)
  To: linux-fbdev
In-Reply-To: <201108191038.43286.laurent.pinchart@ideasonboard.com>

Hi Laurent,

On 08/19/2011 08:38 AM, Laurent Pinchart wrote:
> Hi Florian (or should I call you Florian Tobias ?),

Florian is good. I just use my full name as an indication of authenticity.

> Here is the latest version of the pan patches based on top of v3.1-rc2. Apart 
> from being rebased, they're identical to the v3 version posted to the linux-
> fbdev mailing list.

Pulled this one.

JFYI: I want to have a deeper look at the other pull request you sent and
therefore I will need some time for it.


Thanks,

Florian Tobias Schandinat


> The following changes since commit 93ee7a9340d64f20295aacc3fb6a22b759323280:
> 
>   Linux 3.1-rc2 (2011-08-14 15:09:08 -0700)
> 
> are available in the git repository at:
>   git://linuxtv.org/pinchartl/fbdev.git pan-fixes
> 
> Laurent Pinchart (29):
>       68328fb: use display information in info not in var for panning
>       acornfb: Dont BUG() on invalid pan parameters
>       acornfb: use display information in info not in var for panning
>       arkfb: use display information in info not in var for panning
>       atmel_lcdfb: use display information in info not in var for panning
>       radeonfb: use display information in info not in var for panning
>       fbdev: da8xx: use display information in info not in var for panning
>       fbdev: unicore32: use display information in info not in var for panning
>       g364fb: use display information in info not in var for panning
>       gxt4500: use display information in info not in var for panning
>       hgafb: use display information in info not in var for panning
>       imsttfb: use display information in info not in var for panning
>       intelfb: use display information in info not in var for panning
>       mb862xxfb: use display information in info not in var for panning
>       mx3fb: use display information in info not in var for panning
>       neofb: use display information in info not in var for panning
>       pm2fb: use display information in info not in var for panning
>       pm3fb: use display information in info not in var for panning
>       s3c-fb: use display information in info not in var for panning
>       s3fb: use display information in info not in var for panning
>       savagefb: use display information in info not in var for panning
>       sisfb: use display information in info not in var for panning
>       sm501fb: use display information in info not in var for panning
>       tridentfb: use display information in info not in var for panning
>       vfb: use display information in info not in var for panning
>       vga16fb: use display information in info not in var for panning
>       vt8500lcdfb: use display information in info not in var for panning
>       vt8623fb: use display information in info not in var for panning
>       staging: xgifb: use display information in info not in var for panning
> 
>  drivers/staging/xgifb/XGI_main_26.c    |   22 ++++++----------------
>  drivers/video/68328fb.c                |    4 ++--
>  drivers/video/acornfb.c                |    5 +++--
>  drivers/video/arkfb.c                  |    9 +++++----
>  drivers/video/atmel_lcdfb.c            |   15 +++++++++------
>  drivers/video/aty/radeon_base.c        |   10 +++++-----
>  drivers/video/da8xx-fb.c               |    4 ++--
>  drivers/video/fb-puv3.c                |    4 ++--
>  drivers/video/g364fb.c                 |    5 +++--
>  drivers/video/gxt4500.c                |    4 ++--
>  drivers/video/hgafb.c                  |    4 ++--
>  drivers/video/imsttfb.c                |    2 +-
>  drivers/video/intelfb/intelfbhw.c      |    6 +++---
>  drivers/video/mb862xx/mb862xxfbdrv.c   |    2 +-
>  drivers/video/mx3fb.c                  |    6 +++---
>  drivers/video/neofb.c                  |    4 ++--
>  drivers/video/pm2fb.c                  |    4 ++--
>  drivers/video/pm3fb.c                  |    4 ++--
>  drivers/video/s3c-fb.c                 |    2 +-
>  drivers/video/s3fb.c                   |    7 ++++---
>  drivers/video/savage/savagefb_driver.c |   16 +++++++---------
>  drivers/video/sis/sis_main.c           |   30 ++++++++++--------------------
>  drivers/video/sm501fb.c                |    6 +++---
>  drivers/video/tridentfb.c              |    4 ++--
>  drivers/video/vfb.c                    |    4 ++--
>  drivers/video/vga16fb.c                |    2 +-
>  drivers/video/vt8500lcdfb.c            |    4 ++--
>  drivers/video/vt8623fb.c               |    9 +++++----
>  28 files changed, 92 insertions(+), 106 deletions(-)
> 


^ permalink raw reply

* Re: [PATCH 4/6] udlfb: Add module option to do without shadow framebuffer
From: Florian Tobias Schandinat @ 2011-08-24 13:59 UTC (permalink / raw)
  To: linux-fbdev
In-Reply-To: <1313958862-5640-7-git-send-email-bernie@plugable.com>

On 08/21/2011 08:34 PM, bernie@plugable.com wrote:
> From: Stuart Hopkins <stuart@linux-depot.com>
> 
> By default, udlfb allocates a 2nd buffer to shadow what's across
> the bus on the USB device.  It can operate without this shadow,
> but then it cannot tell which pixels have changed, and must send all.
> 
> Saves host memory, but worsens the USB 2.0 bus bottleneck.
> 
> This option allows users in very low memory situations (e.g.
> bifferboard) to optionally turn off this shadow framebuffer.
> 
> Signed-off-by: Bernie Thompson <bernie@plugable.com>
> Signed-off-by: Stuart Hopkins <stuart@linux-depot.com>

The order of the Signed-offs looks a bit strange here so I reordered them.

I applied the ?/6 series.


Thanks,

Florian Tobias Schandinat

^ permalink raw reply

* linux-next tree addition request (fbdev)
From: Florian Tobias Schandinat @ 2011-08-24 13:40 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: linux-next, linux-fbdev@vger.kernel.org, Paul Mundt

Hi Stephen,

can you please add

    git://github.com/schandinat/linux-2.6.git fbdev-next

to linux-next. It collects patches for the frame buffer subsystem.
Can you please add the linux-fbdev@vger.kernel.org mailing list as additional
contact for warnings/errors/problems?

You probably want to drop Paul's fbdev branches as they contain some outdated
patches that will conflict with the newer versions.


Thanks,

Florian Tobias Schandinat

^ permalink raw reply


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