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
From: Magnus Damm @ 2011-08-29  0:39 UTC (permalink / raw)
  To: Laurent Pinchart; +Cc: linux-fbdev, linux-media
In-Reply-To: <1313746626-23845-4-git-send-email-laurent.pinchart@ideasonboard.com>

On Fri, Aug 19, 2011 at 6:37 PM, Laurent Pinchart
<laurent.pinchart@ideasonboard.com> 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(-)

Hi Laurent, thanks for the patch!

Since you're changing the LCDC platform data please make sure you also
update the 5 boards using the LCDC under arch/sh.

Thanks,

/ magnus

^ permalink raw reply

* Re: [PATCH] MAINTAINERS: change framebuffer maintainer
From: Paul Mundt @ 2011-08-29  6:01 UTC (permalink / raw)
  To: Florian Tobias Schandinat; +Cc: Linus Torvalds, linux-fbdev, linux-kernel
In-Reply-To: <1314473554-3317-1-git-send-email-FlorianSchandinat@gmx.de>

On Sat, Aug 27, 2011 at 07:32:34PM +0000, Florian Tobias Schandinat wrote:
> As Paul has not much time for it I take over maintaining the
> framebuffer subsystem.
> 
> Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>

Acked-by: Paul Mundt <lethal@linux-sh.org>

^ permalink raw reply

* Re: linux-next tree addition request (fbdev)
From: Paul Mundt @ 2011-08-29  6:02 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Florian Tobias Schandinat, linux-next,
	linux-fbdev@vger.kernel.org
In-Reply-To: <20110829021930.0112cf98fbafd7380e09e164@canb.auug.org.au>

On Mon, Aug 29, 2011 at 02:19:30AM +1000, Stephen Rothwell wrote:
> 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?
> 
As long as Florian is taking care of the backlog of the stuff that is
already sitting in that branch, I have no problems with it being dropped.
I'm not planning on pushing any updates to it anyways.

^ permalink raw reply

* Re: [PATCH/RFC v2 1/3] fbdev: Add FOURCC-based format configuration API
From: Geert Uytterhoeven @ 2011-08-29  8:13 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,

My comments are mainly about the documentation of the "legacy" bits.

On Fri, Aug 19, 2011 at 11:37, Laurent Pinchart
<laurent.pinchart@ideasonboard.com> wrote:
> diff --git a/Documentation/fb/api.txt b/Documentation/fb/api.txt
> new file mode 100644
> index 0000000..6808492
> --- /dev/null
> +++ b/Documentation/fb/api.txt

> +2. Types and visuals
> +--------------------
> +
> +Pixels are stored in memory in hardware-dependent formats. Applications need
> +to be aware of the pixel storage format in order to write image data to the
> +frame buffer memory in the format expected by the hardware.
> +
> +Formats are described by frame buffer types and visuals. Some visuals require
> +additional information, which are stored in the variable screen information
> +bits_per_pixel, grayscale, fourcc, red, green, blue and transp fields.
> +
> +The following types and visuals are supported.
> +
> +- FB_TYPE_PACKED_PIXELS
> +
> +Color components (usually RGB or YUV) are packed together into macropixels
> +that are stored in a single plane. The exact color components layout is
> +described in a visual-dependent way.
> +
> +Frame buffer visuals that don't use multiple color components per pixel
> +(such as monochrome and pseudo-color visuals) are reported as packed frame
> +buffer types, even though they don't stricly speaking pack color components
> +into macropixels.

That's because the "packing" is not about the color components, but about the
bits that represent a single pixel.

I.e. the bits that make up the pixel (the macropixel) are stored next
to each other
in memory.

> +- FB_TYPE_PLANES
> +
> +Color components are stored in separate planes. Planes are located
> +contiguously in memory.

The bits that make up a pixel are stored in separate planes. Planes are located
contiguously in memory.

- FB_TYPE_INTERLEAVED_PLANES

The bits that make up a pixel are stored in separate planes. Planes
are interleaved.
The interleave factor (the distance in bytes between the planes in
memory) is stored
in the type_aux field.

> +- FB_VISUAL_MONO01
> +
> +Pixels are black or white and stored on one bit. A bit set to 1 represents a
> +black pixel and a bit set to 0 a white pixel. Pixels are packed together in
> +bytes with 8 pixels per byte.

Actually we do have drivers that use 8 bits per pixel for a monochrome visual.
Hence:

"Pixels are black or white. A black pixel is represented by all
(typically one) bits
set to ones, a white pixel by all bits set to zeroes."

> +FB_VISUAL_MONO01 is used with FB_TYPE_PACKED_PIXELS only.

... so this may also not be true (but it is for all current drivers, IIRC).
There's a strict orthogonality between type (how is a pixel stored in memory)
and visual (how the bits that represent the pixel are interpreted and converted
to a color value).

Same comments for FB_VISUAL_MONO10

> +- FB_VISUAL_TRUECOLOR
> +
> +Pixels are broken into red, green and blue components, and each component
> +indexes a read-only lookup table for the corresponding value. Lookup tables
> +are device-dependent, and provide linear or non-linear ramps.
> +
> +Each component is stored in memory according to the variable screen
> +information red, green, blue and transp fields.

"Each component is stored in a macropixel according to the variable screen
information red, green, blue and transp fields."

Storage format in memory is determined by the FB_TYPE_* value.

> +- FB_VISUAL_PSEUDOCOLOR and FB_VISUAL_STATIC_PSEUDOCOLOR
> +
> +Pixel values are encoded as indices into a colormap that stores red, green and
> +blue components. The colormap is read-only for FB_VISUAL_STATIC_PSEUDOCOLOR
> +and read-write for FB_VISUAL_PSEUDOCOLOR.
> +
> +Each pixel value is stored in the number of bits reported by the variable
> +screen information bits_per_pixel field. Pixels are contiguous in memory.

Whether pixels are contiguous in memory or not is determined by the
FB_TYPE_* value.

> +FB_VISUAL_PSEUDOCOLOR and FB_VISUAL_STATIC_PSEUDOCOLOR are used with
> +FB_TYPE_PACKED_PIXELS only.

Not true. Several drivers use bit planes or interleaved bitplanes.

> +- FB_VISUAL_DIRECTCOLOR
> +
> +Pixels are broken into red, green and blue components, and each component
> +indexes a programmable lookup table for the corresponding value.
> +
> +Each component is stored in memory according to the variable screen
> +information red, green, blue and transp fields.

"Each component is stored in a macropixel according to the variable screen
information red, green, blue and transp fields."

> +- FB_VISUAL_FOURCC
> +
> +Pixels are stored in memory as described by the format FOURCC identifier
> +stored in the variable screen information fourcc field.

... stored in memory and interpreted ...

> +struct fb_var_screeninfo {
> +       __u32 xres;                     /* visible resolution           */
> +       __u32 yres;
> +       __u32 xres_virtual;             /* virtual resolution           */
> +       __u32 yres_virtual;
> +       __u32 xoffset;                  /* offset from virtual to visible */
> +       __u32 yoffset;                  /* resolution                   */
> +
> +       __u32 bits_per_pixel;           /* guess what                   */
> +       union {
> +               struct {                /* Legacy format API            */
> +                       __u32 grayscale; /* != 0 Graylevels instead of colors */
> +                       /* 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;
> +                       __u32 reserved[11];
> +               } format;
> +       };
> +
> +       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                 */

These four are duplicated, cfr. the union above.

> +  Pixel values are bits_per_pixel wide and are split in non-overlapping red,
> +  green, blue and alpha (transparency) components. Location and size of each
> +  component in the pixel value are described by the fb_bitfield offset and
> +  length fields. Offset are computed from the right.

                   Offsets

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/RFC v2 3/3] fbdev: sh_mobile_lcdc: Support FOURCC-based format API
From: Laurent Pinchart @ 2011-08-29  8:30 UTC (permalink / raw)
  To: Magnus Damm; +Cc: linux-fbdev, linux-media
In-Reply-To: <CANqRtoSozX5cPs1c2eqy=mcNi_qzVaVYb9Xmmgv8OOJRdUwWqg@mail.gmail.com>

Hi Magnus,

On Monday 29 August 2011 02:39:06 Magnus Damm wrote:
> On Fri, Aug 19, 2011 at 6:37 PM, 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(-)
> 
> Hi Laurent, thanks for the patch!
> 
> Since you're changing the LCDC platform data please make sure you also
> update the 5 boards using the LCDC under arch/sh.

Sure. Sorry for forgetting about that.

-- 
Regards,

Laurent Pinchart

^ permalink raw reply

* Re: [PATCH/RFC v2 1/3] fbdev: Add FOURCC-based format configuration API
From: Laurent Pinchart @ 2011-08-29  8:50 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: linux-fbdev, linux-media, magnus.damm
In-Reply-To: <CAMuHMdV-JxK1Pp1aHmEG7N8G8u_un-G7zGZa+KNzGx2D37EbKQ@mail.gmail.com>

Hi Geert,

Thanks for the review.

On Monday 29 August 2011 10:13:07 Geert Uytterhoeven wrote:
> On Fri, Aug 19, 2011 at 11:37, Laurent Pinchart wrote:

[snip]

> > +- FB_TYPE_PACKED_PIXELS
> > +
> > +Color components (usually RGB or YUV) are packed together into
> > macropixels +that are stored in a single plane. The exact color
> > components layout is +described in a visual-dependent way.
> > +
> > +Frame buffer visuals that don't use multiple color components per pixel
> > +(such as monochrome and pseudo-color visuals) are reported as packed
> > frame +buffer types, even though they don't stricly speaking pack color
> > components +into macropixels.
> 
> That's because the "packing" is not about the color components, but about
> the bits that represent a single pixel.
> 
> I.e. the bits that make up the pixel (the macropixel) are stored next
> to each other
> in memory.

OK, I've modified that last sentence to read

"Frame buffer visuals that don't use multiple color components per pixel (such 
as monochrome and pseudo-color visuals) are also reported as packed frame
buffer types, as the bits that make up individual pixels are packed next to
each other in memory."

> > +- FB_TYPE_PLANES
> > +
> > +Color components are stored in separate planes. Planes are located
> > +contiguously in memory.
> 
> The bits that make up a pixel are stored in separate planes. Planes are
> located contiguously in memory.

I'm not sure to agree with this. You make it sounds like FB_TYPE_PLANES stores 
each bit in a different plane. Is that really the case ?

> - FB_TYPE_INTERLEAVED_PLANES
> 
> The bits that make up a pixel are stored in separate planes. Planes
> are interleaved.
> The interleave factor (the distance in bytes between the planes in
> memory) is stored in the type_aux field.

That's a bit unclear to me. How are they interleaved ?

> > +- FB_VISUAL_MONO01
> > +
> > +Pixels are black or white and stored on one bit. A bit set to 1
> > represents a +black pixel and a bit set to 0 a white pixel. Pixels are
> > packed together in +bytes with 8 pixels per byte.
> 
> Actually we do have drivers that use 8 bits per pixel for a monochrome
> visual. Hence:
> 
> "Pixels are black or white. A black pixel is represented by all
> (typically one) bits set to ones, a white pixel by all bits set to zeroes."

OK. I've rephrased it as

"Pixels are black or white and stored on a number of bits (typically one)
specified by the variable screen information bpp field. 

Black pixels are represented by all bits set to 1 and white pixels by all bits
set to 0. When the number of bits per pixel is smaller than 8, several pixels 
are packed together in a byte."

> > +FB_VISUAL_MONO01 is used with FB_TYPE_PACKED_PIXELS only.
> 
> ... so this may also not be true (but it is for all current drivers, IIRC).
> There's a strict orthogonality between type (how is a pixel stored in
> memory) and visual (how the bits that represent the pixel are interpreted
> and converted to a color value).

What about

"FB_VISUAL_MONO01 is currently used with FB_TYPE_PACKED_PIXELS only." ?

> Same comments for FB_VISUAL_MONO10

Fixed the same way.

> > +- FB_VISUAL_TRUECOLOR
> > +
> > +Pixels are broken into red, green and blue components, and each
> > component +indexes a read-only lookup table for the corresponding value.
> > Lookup tables +are device-dependent, and provide linear or non-linear
> > ramps.
> > +
> > +Each component is stored in memory according to the variable screen
> > +information red, green, blue and transp fields.
> 
> "Each component is stored in a macropixel according to the variable screen
> information red, green, blue and transp fields."
> 
> Storage format in memory is determined by the FB_TYPE_* value.

How so ? With FB_TYPE_PLANES and FB_VISUAL_TRUECOLOR for an RGB format, how 
are the R, G and B planes ordered ? Are color components packed or padded 
inside a plane ? I understand that the design goal was to have orthogonal 
FB_TYPE_* and FB_VISUAL_* values, but we're missing too much information for 
that to be truly generic.

> > +- FB_VISUAL_PSEUDOCOLOR and FB_VISUAL_STATIC_PSEUDOCOLOR
> > +
> > +Pixel values are encoded as indices into a colormap that stores red,
> > green and +blue components. The colormap is read-only for
> > FB_VISUAL_STATIC_PSEUDOCOLOR +and read-write for FB_VISUAL_PSEUDOCOLOR.
> > +
> > +Each pixel value is stored in the number of bits reported by the
> > variable +screen information bits_per_pixel field. Pixels are contiguous
> > in memory.
> 
> Whether pixels are contiguous in memory or not is determined by the
> FB_TYPE_* value.

How can they not be contiguous in memory ? Can you please give an example ?

> > +FB_VISUAL_PSEUDOCOLOR and FB_VISUAL_STATIC_PSEUDOCOLOR are used with
> > +FB_TYPE_PACKED_PIXELS only.
> 
> Not true. Several drivers use bit planes or interleaved bitplanes.

How does that work ?

> > +- FB_VISUAL_DIRECTCOLOR
> > +
> > +Pixels are broken into red, green and blue components, and each
> > component +indexes a programmable lookup table for the corresponding
> > value. +
> > +Each component is stored in memory according to the variable screen
> > +information red, green, blue and transp fields.
> 
> "Each component is stored in a macropixel according to the variable screen
> information red, green, blue and transp fields."
> 
> > +- FB_VISUAL_FOURCC
> > +
> > +Pixels are stored in memory as described by the format FOURCC identifier
> > +stored in the variable screen information fourcc field.
> 
> ... stored in memory and interpreted ...
> 
> > +struct fb_var_screeninfo {
> > +       __u32 xres;                     /* visible resolution          
> > */ +       __u32 yres;
> > +       __u32 xres_virtual;             /* virtual resolution          
> > */ +       __u32 yres_virtual;
> > +       __u32 xoffset;                  /* offset from virtual to visible
> > */ +       __u32 yoffset;                  /* resolution                
> >   */ +
> > +       __u32 bits_per_pixel;           /* guess what                  
> > */ +       union {
> > +               struct {                /* Legacy format API          
> >  */ +                       __u32 grayscale; /* != 0 Graylevels instead
> > of colors */ +                       /* 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;
> > +                       __u32 reserved[11];
> > +               } format;
> > +       };
> > +
> > +       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                
> > */
> 
> These four are duplicated, cfr. the union above.

Oops :-)

-- 
Regards,

Laurent Pinchart

^ permalink raw reply

* Re: [PATCH/RFC v2 1/3] fbdev: Add FOURCC-based format configuration API
From: Geert Uytterhoeven @ 2011-08-29  9:36 UTC (permalink / raw)
  To: Laurent Pinchart; +Cc: linux-fbdev, linux-media, magnus.damm
In-Reply-To: <201108291050.59109.laurent.pinchart@ideasonboard.com>

Hi Laurent,

On Mon, Aug 29, 2011 at 10:50, Laurent Pinchart
<laurent.pinchart@ideasonboard.com> wrote:
> On Monday 29 August 2011 10:13:07 Geert Uytterhoeven wrote:
>> On Fri, Aug 19, 2011 at 11:37, Laurent Pinchart wrote:
>
> [snip]
>
>> > +- FB_TYPE_PACKED_PIXELS
>> > +
>> > +Color components (usually RGB or YUV) are packed together into
>> > macropixels +that are stored in a single plane. The exact color
>> > components layout is +described in a visual-dependent way.
>> > +
>> > +Frame buffer visuals that don't use multiple color components per pixel
>> > +(such as monochrome and pseudo-color visuals) are reported as packed
>> > frame +buffer types, even though they don't stricly speaking pack color
>> > components +into macropixels.
>>
>> That's because the "packing" is not about the color components, but about
>> the bits that represent a single pixel.
>>
>> I.e. the bits that make up the pixel (the macropixel) are stored next
>> to each other
>> in memory.
>
> OK, I've modified that last sentence to read
>
> "Frame buffer visuals that don't use multiple color components per pixel (such
> as monochrome and pseudo-color visuals) are also reported as packed frame
> buffer types, as the bits that make up individual pixels are packed next to
> each other in memory."

Still not correct, as you don't grasp the concept of e.g. bitplanes
yet (see below).
The visual doesn't have anything to do with how the macropixels are stored in
memory.

>> > +- FB_TYPE_PLANES
>> > +
>> > +Color components are stored in separate planes. Planes are located
>> > +contiguously in memory.
>>
>> The bits that make up a pixel are stored in separate planes. Planes are
>> located contiguously in memory.
>
> I'm not sure to agree with this. You make it sounds like FB_TYPE_PLANES stores
> each bit in a different plane. Is that really the case ?

Yes.

First you store all "first" (fbdev does lack a way to specify little
or big endian here)
bits of each pixel in memory, contiguously. Then the second bit of
each pixel, and so on.

For 8 pixels (A - H) with 4 bits per pixel (0 - 3) (i.e. the first pixel is
[A0 A1 A2 A3]), that would be like:

A0 B0 C0 D0 E0 F0 G0 H0 A1 B1 C1 D1 E1 F1 G1 H1 A2 B2 C2 D2 E2 F2 G2 H2
A3 B3 C3 D3 E3 F3 G3 H3

http://en.wikipedia.org/wiki/Bit_plane
http://en.wikipedia.org/wiki/Planar_(computer_graphics)
http://en.wikipedia.org/wiki/Color_depth

>> - FB_TYPE_INTERLEAVED_PLANES
>>
>> The bits that make up a pixel are stored in separate planes. Planes
>> are interleaved.
>> The interleave factor (the distance in bytes between the planes in
>> memory) is stored in the type_aux field.
>
> That's a bit unclear to me. How are they interleaved ?

Instead of storing the same bits of all pixels contiguously into memory, they
are interleaved. Typically this is done per line (type_aux is the
length of a line in bytes),
or per word (Atari uses 2 bytes interleaving.

E.g. for a 320 x 200 display, with FB_TYPE_PLANES, you would store 320 x 200 64000 first bits, followed 64000 second bits, and so on.

With FB_TYPE_INTERLEAVED_PLANES and type_aux = 320 / 8 = 40,
you store the first line of the screen as 320 first bits, followed by
320 second bits, and so on.
Then the next line, as 320 first bits, followed by 320 second bits, and so on...

Hence the bits that make up a pixel are spread across memory. It was
useful in the days
computers couldn't show many colors, and allows things like 5 or 6
bits per pixels.

>> > +- FB_VISUAL_MONO01
>> > +
>> > +Pixels are black or white and stored on one bit. A bit set to 1
>> > represents a +black pixel and a bit set to 0 a white pixel. Pixels are
>> > packed together in +bytes with 8 pixels per byte.
>>
>> Actually we do have drivers that use 8 bits per pixel for a monochrome
>> visual. Hence:
>>
>> "Pixels are black or white. A black pixel is represented by all
>> (typically one) bits set to ones, a white pixel by all bits set to zeroes."
>
> OK. I've rephrased it as
>
> "Pixels are black or white and stored on a number of bits (typically one)
> specified by the variable screen information bpp field.
>
> Black pixels are represented by all bits set to 1 and white pixels by all bits
> set to 0. When the number of bits per pixel is smaller than 8, several pixels
> are packed together in a byte."

OK.

>> > +FB_VISUAL_MONO01 is used with FB_TYPE_PACKED_PIXELS only.
>>
>> ... so this may also not be true (but it is for all current drivers, IIRC).
>> There's a strict orthogonality between type (how is a pixel stored in
>> memory) and visual (how the bits that represent the pixel are interpreted
>> and converted to a color value).
>
> What about
>
> "FB_VISUAL_MONO01 is currently used with FB_TYPE_PACKED_PIXELS only." ?

stifb.c seems to use FB_TYPE_PLANES, but it uses bits_per_pixel is 1, so
FB_TYPE_PACKED_PIXELS, FB_TYPE_PLANES, and FB_TYPE_INTERLEAVED_PLANES
all degenerate to the same case anyway.

>> > +- FB_VISUAL_TRUECOLOR
>> > +
>> > +Pixels are broken into red, green and blue components, and each
>> > component +indexes a read-only lookup table for the corresponding value.
>> > Lookup tables +are device-dependent, and provide linear or non-linear
>> > ramps.
>> > +
>> > +Each component is stored in memory according to the variable screen
>> > +information red, green, blue and transp fields.
>>
>> "Each component is stored in a macropixel according to the variable screen
>> information red, green, blue and transp fields."
>>
>> Storage format in memory is determined by the FB_TYPE_* value.
>
> How so ? With FB_TYPE_PLANES and FB_VISUAL_TRUECOLOR for an RGB format, how
> are the R, G and B planes ordered ? Are color components packed or padded

That's specified by the fb_bitfield structs.

> inside a plane ? I understand that the design goal was to have orthogonal
> FB_TYPE_* and FB_VISUAL_* values, but we're missing too much information for
> that to be truly generic.

The visual specifies how to interprete the fields that make up a pixel (as color
components, indices, ...).
The fb_bitfield structs specify how the fields are laid out in a pixel of size
bits_per_pixel.
The frame buffer type specifies how pixels are laid out in memory.

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/RFC v2 1/3] fbdev: Add FOURCC-based format configuration API
From: Laurent Pinchart @ 2011-08-29 10:09 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: linux-fbdev, linux-media, magnus.damm
In-Reply-To: <CAMuHMdW9KPBJpTPYmCTmFG=G_7_tiFti-b3wzTM9Q5J7U9+JWg@mail.gmail.com>

Hi Geert,

On Monday 29 August 2011 11:36:07 Geert Uytterhoeven wrote:
> On Mon, Aug 29, 2011 at 10:50, Laurent Pinchart wrote:
> > On Monday 29 August 2011 10:13:07 Geert Uytterhoeven wrote:
> >> On Fri, Aug 19, 2011 at 11:37, Laurent Pinchart wrote:
> > [snip]
> > 
> >> > +- FB_TYPE_PACKED_PIXELS
> >> > +
> >> > +Color components (usually RGB or YUV) are packed together into
> >> > macropixels +that are stored in a single plane. The exact color
> >> > components layout is +described in a visual-dependent way.
> >> > +
> >> > +Frame buffer visuals that don't use multiple color components per
> >> > pixel +(such as monochrome and pseudo-color visuals) are reported as
> >> > packed frame +buffer types, even though they don't stricly speaking
> >> > pack color components +into macropixels.
> >> 
> >> That's because the "packing" is not about the color components, but
> >> about the bits that represent a single pixel.
> >> 
> >> I.e. the bits that make up the pixel (the macropixel) are stored next
> >> to each other
> >> in memory.
> > 
> > OK, I've modified that last sentence to read
> > 
> > "Frame buffer visuals that don't use multiple color components per pixel
> > (such as monochrome and pseudo-color visuals) are also reported as
> > packed frame buffer types, as the bits that make up individual pixels
> > are packed next to each other in memory."
> 
> Still not correct, as you don't grasp the concept of e.g. bitplanes
> yet (see below).
> The visual doesn't have anything to do with how the macropixels are stored
> in memory.
> 
> >> > +- FB_TYPE_PLANES
> >> > +
> >> > +Color components are stored in separate planes. Planes are located
> >> > +contiguously in memory.
> >> 
> >> The bits that make up a pixel are stored in separate planes. Planes are
> >> located contiguously in memory.
> > 
> > I'm not sure to agree with this. You make it sounds like FB_TYPE_PLANES
> > stores each bit in a different plane. Is that really the case ?
> 
> Yes.
>
> First you store all "first" (fbdev does lack a way to specify little
> or big endian here)
> bits of each pixel in memory, contiguously. Then the second bit of
> each pixel, and so on.
> 
> For 8 pixels (A - H) with 4 bits per pixel (0 - 3) (i.e. the first pixel is
> [A0 A1 A2 A3]), that would be like:
> 
> A0 B0 C0 D0 E0 F0 G0 H0 A1 B1 C1 D1 E1 F1 G1 H1 A2 B2 C2 D2 E2 F2 G2 H2
> A3 B3 C3 D3 E3 F3 G3 H3
> 
> http://en.wikipedia.org/wiki/Bit_plane
> http://en.wikipedia.org/wiki/Planar_(computer_graphics)
> http://en.wikipedia.org/wiki/Color_depth

Thank you. That's clearer now. Planar formats in V4L2 are different, hence my 
initial confusion.

If my understanding is now correct, a V4L2 planar YUV type where Y, U and V 
components are stored in separate byte-oriented planes, with each plane 
storing Y, U or V components packed (such as http://linuxtv.org/downloads/v4l-
dvb-apis/V4L2-PIX-FMT-YUV422P.html), would be of neither FB_TYPE_PLANES nor 
FB_TYPE_PACKED. The same would be true for an RGB format where each component 
is stored in a separate plane with each plane sotring R, G or B packed.

If the above is correct, what FB_TYPE_* should a driver report when using 
FB_VISUAL_FOURCC with V4L2_PIX_FMT_YUV422P (http://linuxtv.org/downloads/v4l-
dvb-apis/V4L2-PIX-FMT-YUV422P.html) or V4L2_PIX_FMT_NV12 
(http://linuxtv.org/downloads/v4l-dvb-apis/re25.html) for instance ?

> >> - FB_TYPE_INTERLEAVED_PLANES
> >> 
> >> The bits that make up a pixel are stored in separate planes. Planes
> >> are interleaved.
> >> The interleave factor (the distance in bytes between the planes in
> >> memory) is stored in the type_aux field.
> > 
> > That's a bit unclear to me. How are they interleaved ?
> 
> Instead of storing the same bits of all pixels contiguously into memory,
> they are interleaved. Typically this is done per line (type_aux is the
> length of a line in bytes),
> or per word (Atari uses 2 bytes interleaving.
> 
> E.g. for a 320 x 200 display, with FB_TYPE_PLANES, you would store 320 x
> 200 = 64000 first bits, followed 64000 second bits, and so on.
> 
> With FB_TYPE_INTERLEAVED_PLANES and type_aux = 320 / 8 = 40,
> you store the first line of the screen as 320 first bits, followed by
> 320 second bits, and so on.
> Then the next line, as 320 first bits, followed by 320 second bits, and so
> on...
> 
> Hence the bits that make up a pixel are spread across memory. It was
> useful in the days
> computers couldn't show many colors, and allows things like 5 or 6
> bits per pixels.
> 
> >> > +- FB_VISUAL_MONO01
> >> > +
> >> > +Pixels are black or white and stored on one bit. A bit set to 1
> >> > represents a +black pixel and a bit set to 0 a white pixel. Pixels are
> >> > packed together in +bytes with 8 pixels per byte.
> >> 
> >> Actually we do have drivers that use 8 bits per pixel for a monochrome
> >> visual. Hence:
> >> 
> >> "Pixels are black or white. A black pixel is represented by all
> >> (typically one) bits set to ones, a white pixel by all bits set to
> >> zeroes."
> > 
> > OK. I've rephrased it as
> > 
> > "Pixels are black or white and stored on a number of bits (typically one)
> > specified by the variable screen information bpp field.
> > 
> > Black pixels are represented by all bits set to 1 and white pixels by all
> > bits set to 0. When the number of bits per pixel is smaller than 8,
> > several pixels are packed together in a byte."
> 
> OK.
> 
> >> > +FB_VISUAL_MONO01 is used with FB_TYPE_PACKED_PIXELS only.
> >> 
> >> ... so this may also not be true (but it is for all current drivers,
> >> IIRC). There's a strict orthogonality between type (how is a pixel
> >> stored in memory) and visual (how the bits that represent the pixel are
> >> interpreted and converted to a color value).
> > 
> > What about
> > 
> > "FB_VISUAL_MONO01 is currently used with FB_TYPE_PACKED_PIXELS only." ?
> 
> stifb.c seems to use FB_TYPE_PLANES, but it uses bits_per_pixel is 1, so
> FB_TYPE_PACKED_PIXELS, FB_TYPE_PLANES, and FB_TYPE_INTERLEAVED_PLANES
> all degenerate to the same case anyway.
> 
> >> > +- FB_VISUAL_TRUECOLOR
> >> > +
> >> > +Pixels are broken into red, green and blue components, and each
> >> > component +indexes a read-only lookup table for the corresponding
> >> > value. Lookup tables +are device-dependent, and provide linear or
> >> > non-linear ramps.
> >> > +
> >> > +Each component is stored in memory according to the variable screen
> >> > +information red, green, blue and transp fields.
> >> 
> >> "Each component is stored in a macropixel according to the variable
> >> screen information red, green, blue and transp fields."
> >> 
> >> Storage format in memory is determined by the FB_TYPE_* value.
> > 
> > How so ? With FB_TYPE_PLANES and FB_VISUAL_TRUECOLOR for an RGB format,
> > how are the R, G and B planes ordered ? Are color components packed or
> > padded
> 
> That's specified by the fb_bitfield structs.
> 
> > inside a plane ? I understand that the design goal was to have orthogonal
> > FB_TYPE_* and FB_VISUAL_* values, but we're missing too much information
> > for that to be truly generic.
> 
> The visual specifies how to interprete the fields that make up a pixel (as
> color components, indices, ...).
> The fb_bitfield structs specify how the fields are laid out in a pixel of
> size bits_per_pixel.
> The frame buffer type specifies how pixels are laid out in memory.

That's fine if the FB device uses bitplanes, but not if it uses a format such 
as the ones described above.

-- 
Regards,

Laurent Pinchart

^ permalink raw reply

* Re: linux-next tree addition request (fbdev)
From: Florian Tobias Schandinat @ 2011-08-29 10:47 UTC (permalink / raw)
  To: Paul Mundt; +Cc: Stephen Rothwell, linux-next, linux-fbdev@vger.kernel.org
In-Reply-To: <20110829060238.GB31809@linux-sh.org>

Hi Paul,

On 08/29/2011 06:02 AM, Paul Mundt wrote:
> On Mon, Aug 29, 2011 at 02:19:30AM +1000, Stephen Rothwell wrote:
>> 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?
>>
> As long as Florian is taking care of the backlog of the stuff that is
> already sitting in that branch, I have no problems with it being dropped.
> I'm not planning on pushing any updates to it anyways.

Merged the remaining patches of your branch.


Thanks,

Florian Tobias Schandinat

^ permalink raw reply

* Re: [PATCH/RFC v2 1/3] fbdev: Add FOURCC-based format configuration API
From: Geert Uytterhoeven @ 2011-08-29 11:04 UTC (permalink / raw)
  To: Laurent Pinchart; +Cc: linux-fbdev, linux-media, magnus.damm
In-Reply-To: <201108291209.08349.laurent.pinchart@ideasonboard.com>

Hi Laurent,

On Mon, Aug 29, 2011 at 12:09, Laurent Pinchart
<laurent.pinchart@ideasonboard.com> wrote:
> On Monday 29 August 2011 11:36:07 Geert Uytterhoeven wrote:
>> On Mon, Aug 29, 2011 at 10:50, Laurent Pinchart wrote:

[...]

> If my understanding is now correct, a V4L2 planar YUV type where Y, U and V
> components are stored in separate byte-oriented planes, with each plane
> storing Y, U or V components packed (such as http://linuxtv.org/downloads/v4l-
> dvb-apis/V4L2-PIX-FMT-YUV422P.html), would be of neither FB_TYPE_PLANES nor
> FB_TYPE_PACKED. The same would be true for an RGB format where each component
> is stored in a separate plane with each plane sotring R, G or B packed.

Indeed. Currently this cannot be represented.
For ideas from the past, see e.g.
http://comments.gmane.org/gmane.linux.fbdev.devel/10951.

> If the above is correct, what FB_TYPE_* should a driver report when using
> FB_VISUAL_FOURCC with V4L2_PIX_FMT_YUV422P (http://linuxtv.org/downloads/v4l-
> dvb-apis/V4L2-PIX-FMT-YUV422P.html) or V4L2_PIX_FMT_NV12
> (http://linuxtv.org/downloads/v4l-dvb-apis/re25.html) for instance ?

We need new types for those. Or always use FOURCC for them.

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/RFC v2 1/3] fbdev: Add FOURCC-based format configuration API
From: Laurent Pinchart @ 2011-08-29 11:08 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: linux-fbdev, linux-media, magnus.damm
In-Reply-To: <CAMuHMdU3eO34zmGVejUj4B7Z5JWiwM_pieoycfinSspSiL1reQ@mail.gmail.com>

Hi Geert,

On Monday 29 August 2011 13:04:15 Geert Uytterhoeven wrote:
> On Mon, Aug 29, 2011 at 12:09, Laurent Pinchart wrote:
> > On Monday 29 August 2011 11:36:07 Geert Uytterhoeven wrote:
> >> On Mon, Aug 29, 2011 at 10:50, Laurent Pinchart wrote:
> [...]
> 
> > If my understanding is now correct, a V4L2 planar YUV type where Y, U and
> > V components are stored in separate byte-oriented planes, with each
> > plane storing Y, U or V components packed (such as
> > http://linuxtv.org/downloads/v4l- dvb-apis/V4L2-PIX-FMT-YUV422P.html),
> > would be of neither FB_TYPE_PLANES nor FB_TYPE_PACKED. The same would be
> > true for an RGB format where each component is stored in a separate
> > plane with each plane sotring R, G or B packed.
> 
> Indeed. Currently this cannot be represented.

Good, at least I now understand the situation :-)

> For ideas from the past, see e.g.
> http://comments.gmane.org/gmane.linux.fbdev.devel/10951.
> 
> > If the above is correct, what FB_TYPE_* should a driver report when using
> > FB_VISUAL_FOURCC with V4L2_PIX_FMT_YUV422P
> > (http://linuxtv.org/downloads/v4l- dvb-apis/V4L2-PIX-FMT-YUV422P.html)
> > or V4L2_PIX_FMT_NV12
> > (http://linuxtv.org/downloads/v4l-dvb-apis/re25.html) for instance ?
> 
> We need new types for those. Or always use FOURCC for them.

My proposal currently defined FB_VISUAL_FOURCC. What about adding 
FB_TYPE_FOURCC as well ?

-- 
Regards,

Laurent Pinchart

^ permalink raw reply

* Re: [PATCH/RFC v2 1/3] fbdev: Add FOURCC-based format configuration API
From: Geert Uytterhoeven @ 2011-08-29 11:20 UTC (permalink / raw)
  To: Laurent Pinchart; +Cc: linux-fbdev, linux-media, magnus.damm
In-Reply-To: <201108291308.50244.laurent.pinchart@ideasonboard.com>

On Mon, Aug 29, 2011 at 13:08, Laurent Pinchart
<laurent.pinchart@ideasonboard.com> wrote:
> On Monday 29 August 2011 13:04:15 Geert Uytterhoeven wrote:
>> On Mon, Aug 29, 2011 at 12:09, Laurent Pinchart wrote:
>> > On Monday 29 August 2011 11:36:07 Geert Uytterhoeven wrote:
>> >> On Mon, Aug 29, 2011 at 10:50, Laurent Pinchart wrote:
>> [...]
>>
>> > If my understanding is now correct, a V4L2 planar YUV type where Y, U and
>> > V components are stored in separate byte-oriented planes, with each
>> > plane storing Y, U or V components packed (such as
>> > http://linuxtv.org/downloads/v4l- dvb-apis/V4L2-PIX-FMT-YUV422P.html),
>> > would be of neither FB_TYPE_PLANES nor FB_TYPE_PACKED. The same would be
>> > true for an RGB format where each component is stored in a separate
>> > plane with each plane sotring R, G or B packed.
>>
>> Indeed. Currently this cannot be represented.
>
> Good, at least I now understand the situation :-)
>
>> For ideas from the past, see e.g.
>> http://comments.gmane.org/gmane.linux.fbdev.devel/10951.
>>
>> > If the above is correct, what FB_TYPE_* should a driver report when using
>> > FB_VISUAL_FOURCC with V4L2_PIX_FMT_YUV422P
>> > (http://linuxtv.org/downloads/v4l- dvb-apis/V4L2-PIX-FMT-YUV422P.html)
>> > or V4L2_PIX_FMT_NV12
>> > (http://linuxtv.org/downloads/v4l-dvb-apis/re25.html) for instance ?
>>
>> We need new types for those. Or always use FOURCC for them.
>
> My proposal currently defined FB_VISUAL_FOURCC. What about adding
> FB_TYPE_FOURCC as well ?

That may make sense.
When will the driver report FB_{TYPE,VISUAL}_FOURCC?
  - When using a mode that cannot be represented in the legacy way,
  - But what with modes that can be represented? Legacy software cannot
    handle FB_{TYPE,VISUAL}_FOURCC.

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/RFC v2 1/3] fbdev: Add FOURCC-based format configuration API
From: Laurent Pinchart @ 2011-08-29 12:55 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: linux-fbdev, linux-media, magnus.damm
In-Reply-To: <CAMuHMdUheemZVb7cPAsyPrC9LLowr+XV_5A+H1EfWWbWHeCVFw@mail.gmail.com>

Hi Geert,

On Monday 29 August 2011 13:20:44 Geert Uytterhoeven wrote:
> On Mon, Aug 29, 2011 at 13:08, Laurent Pinchart wrote:
> > On Monday 29 August 2011 13:04:15 Geert Uytterhoeven wrote:
> >> On Mon, Aug 29, 2011 at 12:09, Laurent Pinchart wrote:
> >> > On Monday 29 August 2011 11:36:07 Geert Uytterhoeven wrote:
> >> >> On Mon, Aug 29, 2011 at 10:50, Laurent Pinchart wrote:
> >> [...]
> >> 
> >> > If my understanding is now correct, a V4L2 planar YUV type where Y, U
> >> > and V components are stored in separate byte-oriented planes, with
> >> > each plane storing Y, U or V components packed (such as
> >> > http://linuxtv.org/downloads/v4l- dvb-apis/V4L2-PIX-FMT-YUV422P.html),
> >> > would be of neither FB_TYPE_PLANES nor FB_TYPE_PACKED. The same would
> >> > be true for an RGB format where each component is stored in a
> >> > separate plane with each plane sotring R, G or B packed.
> >> 
> >> Indeed. Currently this cannot be represented.
> > 
> > Good, at least I now understand the situation :-)
> > 
> >> For ideas from the past, see e.g.
> >> http://comments.gmane.org/gmane.linux.fbdev.devel/10951.
> >> 
> >> > If the above is correct, what FB_TYPE_* should a driver report when
> >> > using FB_VISUAL_FOURCC with V4L2_PIX_FMT_YUV422P
> >> > (http://linuxtv.org/downloads/v4l- dvb-apis/V4L2-PIX-FMT-YUV422P.html)
> >> > or V4L2_PIX_FMT_NV12
> >> > (http://linuxtv.org/downloads/v4l-dvb-apis/re25.html) for instance ?
> >> 
> >> We need new types for those. Or always use FOURCC for them.
> > 
> > My proposal currently defined FB_VISUAL_FOURCC. What about adding
> > FB_TYPE_FOURCC as well ?
> 
> That may make sense.
> When will the driver report FB_{TYPE,VISUAL}_FOURCC?
>   - When using a mode that cannot be represented in the legacy way,

Definitely.

>   - But what with modes that can be represented? Legacy software cannot
>     handle FB_{TYPE,VISUAL}_FOURCC.

My idea was to use FB_{TYPE,VISUAL}_FOURCC only when the mode is configured 
using the FOURCC API. If FBIOPUT_VSCREENINFO is called with a non-FOURCC 
format, the driver will report non-FOURCC types and visuals.

-- 
Regards,

Laurent Pinchart

^ permalink raw reply

* Re: [PATCH/RFC v2 1/3] fbdev: Add FOURCC-based format configuration API
From: Geert Uytterhoeven @ 2011-08-29 13:09 UTC (permalink / raw)
  To: Laurent Pinchart; +Cc: linux-fbdev, linux-media, magnus.damm
In-Reply-To: <201108291455.36145.laurent.pinchart@ideasonboard.com>

Hi Laurent,

On Mon, Aug 29, 2011 at 14:55, Laurent Pinchart
<laurent.pinchart@ideasonboard.com> wrote:
>> When will the driver report FB_{TYPE,VISUAL}_FOURCC?
>>   - When using a mode that cannot be represented in the legacy way,
>
> Definitely.
>
>>   - But what with modes that can be represented? Legacy software cannot
>>     handle FB_{TYPE,VISUAL}_FOURCC.
>
> My idea was to use FB_{TYPE,VISUAL}_FOURCC only when the mode is configured
> using the FOURCC API. If FBIOPUT_VSCREENINFO is called with a non-FOURCC
> format, the driver will report non-FOURCC types and visuals.

Hmm, two use cases:
  - The video mode is configured using a FOURCC-aware tool ("fbset on
steroids").
    Later the user runs a legacy application.
      => Do not retain FOURCC across opening of /dev/fb*.
  - Is there an easy way to force FOURCC reporting, so new apps don't have to
    support parsing the legacy formats? This is useful for new apps that want to
    support (a subset of) FOURCC modes only.

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/RFC v2 1/3] fbdev: Add FOURCC-based format configuration API
From: Laurent Pinchart @ 2011-08-29 13:34 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: linux-fbdev, linux-media, magnus.damm
In-Reply-To: <CAMuHMdVGV6dYW+szHyD30=HvAnSh92rRp=PMauwZZLw6H7DhYw@mail.gmail.com>

Hi Geert,

On Monday 29 August 2011 15:09:04 Geert Uytterhoeven wrote:
> On Mon, Aug 29, 2011 at 14:55, Laurent Pinchart wrote:
> >> When will the driver report FB_{TYPE,VISUAL}_FOURCC?
> >>   - When using a mode that cannot be represented in the legacy way,
> > 
> > Definitely.
> > 
> >>   - But what with modes that can be represented? Legacy software cannot
> >>     handle FB_{TYPE,VISUAL}_FOURCC.
> > 
> > My idea was to use FB_{TYPE,VISUAL}_FOURCC only when the mode is
> > configured using the FOURCC API. If FBIOPUT_VSCREENINFO is called with a
> > non-FOURCC format, the driver will report non-FOURCC types and visuals.
> 
> Hmm, two use cases:
>   - The video mode is configured using a FOURCC-aware tool ("fbset on
> steroids").

Such as http://git.ideasonboard.org/?pûdev-test.git;a=summary :-)

>     Later the user runs a legacy application.
>       => Do not retain FOURCC across opening of /dev/fb*.

I know about that problem, but it's not that easy to work around. We have no 
per-open fixed and variable screen info, and FB devices can be opened by 
multiple applications at the same time.

>   - Is there an easy way to force FOURCC reporting, so new apps don't have
> to support parsing the legacy formats? This is useful for new apps that
> want to support (a subset of) FOURCC modes only.

Not at the moment.

-- 
Regards,

Laurent Pinchart

^ permalink raw reply

* Re: [PATCH/RFC v2 1/3] fbdev: Add FOURCC-based format configuration API
From: Geert Uytterhoeven @ 2011-08-29 14:14 UTC (permalink / raw)
  To: Laurent Pinchart; +Cc: linux-fbdev, linux-media, magnus.damm
In-Reply-To: <201108291534.35951.laurent.pinchart@ideasonboard.com>

Hi Laurent,

On Mon, Aug 29, 2011 at 15:34, Laurent Pinchart
<laurent.pinchart@ideasonboard.com> wrote:
> On Monday 29 August 2011 15:09:04 Geert Uytterhoeven wrote:
>> On Mon, Aug 29, 2011 at 14:55, Laurent Pinchart wrote:
>> >> When will the driver report FB_{TYPE,VISUAL}_FOURCC?
>> >>   - When using a mode that cannot be represented in the legacy way,
>> >
>> > Definitely.
>> >
>> >>   - But what with modes that can be represented? Legacy software cannot
>> >>     handle FB_{TYPE,VISUAL}_FOURCC.
>> >
>> > My idea was to use FB_{TYPE,VISUAL}_FOURCC only when the mode is
>> > configured using the FOURCC API. If FBIOPUT_VSCREENINFO is called with a
>> > non-FOURCC format, the driver will report non-FOURCC types and visuals.
>>
>> Hmm, two use cases:
>>   - The video mode is configured using a FOURCC-aware tool ("fbset on
>> steroids").
>
> Such as http://git.ideasonboard.org/?pûdev-test.git;a=summary :-)

Yep.

>>     Later the user runs a legacy application.
>>       => Do not retain FOURCC across opening of /dev/fb*.
>
> I know about that problem, but it's not that easy to work around. We have no
> per-open fixed and variable screen info, and FB devices can be opened by
> multiple applications at the same time.
>
>>   - Is there an easy way to force FOURCC reporting, so new apps don't have
>> to support parsing the legacy formats? This is useful for new apps that
>> want to support (a subset of) FOURCC modes only.
>
> Not at the moment.

So perhaps we do need new ioctls instead...
That would also ease an in-kernel translation layer.

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/RFC v2 1/3] fbdev: Add FOURCC-based format configuration API
From: Laurent Pinchart @ 2011-08-29 14:17 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: linux-fbdev, linux-media, magnus.damm
In-Reply-To: <CAMuHMdV=ZWMSJ_-r9fRMs0RCHyDZL=1a0_ZPZCgLBYJf=Ws4=Q@mail.gmail.com>

Hi Geert,

On Monday 29 August 2011 16:14:38 Geert Uytterhoeven wrote:
> On Mon, Aug 29, 2011 at 15:34, Laurent Pinchart wrote:
> > On Monday 29 August 2011 15:09:04 Geert Uytterhoeven wrote:
> >> On Mon, Aug 29, 2011 at 14:55, Laurent Pinchart wrote:
> >> >> When will the driver report FB_{TYPE,VISUAL}_FOURCC?
> >> >>   - When using a mode that cannot be represented in the legacy way,
> >> > 
> >> > Definitely.
> >> > 
> >> >>   - But what with modes that can be represented? Legacy software
> >> >> cannot handle FB_{TYPE,VISUAL}_FOURCC.
> >> > 
> >> > My idea was to use FB_{TYPE,VISUAL}_FOURCC only when the mode is
> >> > configured using the FOURCC API. If FBIOPUT_VSCREENINFO is called with
> >> > a non-FOURCC format, the driver will report non-FOURCC types and
> >> > visuals.
> >> 
> >> Hmm, two use cases:
> >>   - The video mode is configured using a FOURCC-aware tool ("fbset on
> >> steroids").
> > 
> > Such as http://git.ideasonboard.org/?pûdev-test.git;a=summary :-)
> 
> Yep.
> 
> >>     Later the user runs a legacy application.
> >>       => Do not retain FOURCC across opening of /dev/fb*.
> > 
> > I know about that problem, but it's not that easy to work around. We have
> > no per-open fixed and variable screen info, and FB devices can be opened
> > by multiple applications at the same time.
> > 
> >>   - Is there an easy way to force FOURCC reporting, so new apps don't
> >> have to support parsing the legacy formats? This is useful for new apps
> >> that want to support (a subset of) FOURCC modes only.
> > 
> > Not at the moment.
> 
> So perhaps we do need new ioctls instead...
> That would also ease an in-kernel translation layer.

Do you mean new ioctls to replace the FOURCC API proposal, or new ioctls for 
the above two operations ?

-- 
Regards,

Laurent Pinchart

^ permalink raw reply

* Re: [PATCH/RFC v2 1/3] fbdev: Add FOURCC-based format configuration API
From: Geert Uytterhoeven @ 2011-08-29 14:26 UTC (permalink / raw)
  To: Laurent Pinchart; +Cc: linux-fbdev, linux-media, magnus.damm
In-Reply-To: <201108291617.13236.laurent.pinchart@ideasonboard.com>

Hi Laurent,

On Mon, Aug 29, 2011 at 16:17, Laurent Pinchart
<laurent.pinchart@ideasonboard.com> wrote:
> On Monday 29 August 2011 16:14:38 Geert Uytterhoeven wrote:
>> On Mon, Aug 29, 2011 at 15:34, Laurent Pinchart wrote:
>> > On Monday 29 August 2011 15:09:04 Geert Uytterhoeven wrote:
>> >> On Mon, Aug 29, 2011 at 14:55, Laurent Pinchart wrote:
>> >> >> When will the driver report FB_{TYPE,VISUAL}_FOURCC?
>> >> >>   - When using a mode that cannot be represented in the legacy way,
>> >> >
>> >> > Definitely.
>> >> >
>> >> >>   - But what with modes that can be represented? Legacy software
>> >> >> cannot handle FB_{TYPE,VISUAL}_FOURCC.
>> >> >
>> >> > My idea was to use FB_{TYPE,VISUAL}_FOURCC only when the mode is
>> >> > configured using the FOURCC API. If FBIOPUT_VSCREENINFO is called with
>> >> > a non-FOURCC format, the driver will report non-FOURCC types and
>> >> > visuals.
>> >>
>> >> Hmm, two use cases:
>> >>   - The video mode is configured using a FOURCC-aware tool ("fbset on
>> >> steroids").
>> >
>> > Such as http://git.ideasonboard.org/?pûdev-test.git;a=summary :-)
>>
>> Yep.
>>
>> >>     Later the user runs a legacy application.
>> >>       => Do not retain FOURCC across opening of /dev/fb*.
>> >
>> > I know about that problem, but it's not that easy to work around. We have
>> > no per-open fixed and variable screen info, and FB devices can be opened
>> > by multiple applications at the same time.
>> >
>> >>   - Is there an easy way to force FOURCC reporting, so new apps don't
>> >> have to support parsing the legacy formats? This is useful for new apps
>> >> that want to support (a subset of) FOURCC modes only.
>> >
>> > Not at the moment.
>>
>> So perhaps we do need new ioctls instead...
>> That would also ease an in-kernel translation layer.
>
> Do you mean new ioctls to replace the FOURCC API proposal, or new ioctls for
> the above two operations ?

New ioctls to replace the FOURCC proposal.

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/RFC v2 1/3] fbdev: Add FOURCC-based format configuration API
From: Laurent Pinchart @ 2011-08-29 14:32 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: linux-fbdev, linux-media, magnus.damm, Florian Tobias Schandinat,
	Guennadi Liakhovetski
In-Reply-To: <CAMuHMdV1mPFUWk_=6sB73hFiRXeXwgLGKzSQy=gZA0YuG0Fb3A@mail.gmail.com>

Hi Geert,

On Monday 29 August 2011 16:26:02 Geert Uytterhoeven wrote:
> On Mon, Aug 29, 2011 at 16:17, Laurent Pinchart wrote:
> > On Monday 29 August 2011 16:14:38 Geert Uytterhoeven wrote:
> >> On Mon, Aug 29, 2011 at 15:34, Laurent Pinchart wrote:
> >> > On Monday 29 August 2011 15:09:04 Geert Uytterhoeven wrote:
> >> >> On Mon, Aug 29, 2011 at 14:55, Laurent Pinchart wrote:
> >> >> >> When will the driver report FB_{TYPE,VISUAL}_FOURCC?
> >> >> >>   - When using a mode that cannot be represented in the legacy
> >> >> >> way,
> >> >> > 
> >> >> > Definitely.
> >> >> > 
> >> >> >>   - But what with modes that can be represented? Legacy software
> >> >> >> cannot handle FB_{TYPE,VISUAL}_FOURCC.
> >> >> > 
> >> >> > My idea was to use FB_{TYPE,VISUAL}_FOURCC only when the mode is
> >> >> > configured using the FOURCC API. If FBIOPUT_VSCREENINFO is called
> >> >> > with a non-FOURCC format, the driver will report non-FOURCC types
> >> >> > and visuals.
> >> >> 
> >> >> Hmm, two use cases:
> >> >>   - The video mode is configured using a FOURCC-aware tool ("fbset on
> >> >> steroids").
> >> > 
> >> > Such as http://git.ideasonboard.org/?pûdev-test.git;a=summary :-)
> >> 
> >> Yep.
> >> 
> >> >>     Later the user runs a legacy application.
> >> >>       => Do not retain FOURCC across opening of /dev/fb*.
> >> > 
> >> > I know about that problem, but it's not that easy to work around. We
> >> > have no per-open fixed and variable screen info, and FB devices can
> >> > be opened by multiple applications at the same time.
> >> > 
> >> >>   - Is there an easy way to force FOURCC reporting, so new apps don't
> >> >> have to support parsing the legacy formats? This is useful for new
> >> >> apps that want to support (a subset of) FOURCC modes only.
> >> > 
> >> > Not at the moment.
> >> 
> >> So perhaps we do need new ioctls instead...
> >> That would also ease an in-kernel translation layer.
> > 
> > Do you mean new ioctls to replace the FOURCC API proposal, or new ioctls
> > for the above two operations ?
> 
> New ioctls to replace the FOURCC proposal.

*sigh*...

I'd like other people's opinion on this before throwing everything away. 
Florian, Magnus, Guennadi, others, what do you think ?

-- 
Regards,

Laurent Pinchart

^ permalink raw reply

* Re: [PATCH/RFC v2 1/3] fbdev: Add FOURCC-based format configuration
From: Florian Tobias Schandinat @ 2011-08-29 16:41 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: Geert Uytterhoeven, linux-fbdev, linux-media, magnus.damm,
	Guennadi Liakhovetski
In-Reply-To: <201108291632.06717.laurent.pinchart@ideasonboard.com>

Hi,

On 08/29/2011 02:32 PM, Laurent Pinchart wrote:
> Hi Geert,
> 
> On Monday 29 August 2011 16:26:02 Geert Uytterhoeven wrote:
>> On Mon, Aug 29, 2011 at 16:17, Laurent Pinchart wrote:
>>> On Monday 29 August 2011 16:14:38 Geert Uytterhoeven wrote:
>>>> On Mon, Aug 29, 2011 at 15:34, Laurent Pinchart wrote:
>>>>> On Monday 29 August 2011 15:09:04 Geert Uytterhoeven wrote:
>>>>>> On Mon, Aug 29, 2011 at 14:55, Laurent Pinchart wrote:
>>>>>>>> When will the driver report FB_{TYPE,VISUAL}_FOURCC?
>>>>>>>>   - When using a mode that cannot be represented in the legacy
>>>>>>>> way,
>>>>>>>
>>>>>>> Definitely.
>>>>>>>
>>>>>>>>   - But what with modes that can be represented? Legacy software
>>>>>>>> cannot handle FB_{TYPE,VISUAL}_FOURCC.
>>>>>>>
>>>>>>> My idea was to use FB_{TYPE,VISUAL}_FOURCC only when the mode is
>>>>>>> configured using the FOURCC API. If FBIOPUT_VSCREENINFO is called
>>>>>>> with a non-FOURCC format, the driver will report non-FOURCC types
>>>>>>> and visuals.
>>>>>>
>>>>>> Hmm, two use cases:
>>>>>>   - The video mode is configured using a FOURCC-aware tool ("fbset on
>>>>>> steroids").
>>>>>
>>>>> Such as http://git.ideasonboard.org/?pûdev-test.git;a=summary :-)
>>>>
>>>> Yep.
>>>>
>>>>>>     Later the user runs a legacy application.
>>>>>>       => Do not retain FOURCC across opening of /dev/fb*.
>>>>>
>>>>> I know about that problem, but it's not that easy to work around. We
>>>>> have no per-open fixed and variable screen info, and FB devices can
>>>>> be opened by multiple applications at the same time.
>>>>>
>>>>>>   - Is there an easy way to force FOURCC reporting, so new apps don't
>>>>>> have to support parsing the legacy formats? This is useful for new
>>>>>> apps that want to support (a subset of) FOURCC modes only.
>>>>>
>>>>> Not at the moment.
>>>>
>>>> So perhaps we do need new ioctls instead...
>>>> That would also ease an in-kernel translation layer.
>>>
>>> Do you mean new ioctls to replace the FOURCC API proposal, or new ioctls
>>> for the above two operations ?
>>
>> New ioctls to replace the FOURCC proposal.
> 
> *sigh*...
> 
> I'd like other people's opinion on this before throwing everything away. 
> Florian, Magnus, Guennadi, others, what do you think ?
> 

So, your issue is that some formats can be represented in the new and the old way?
There are 2 simpler solutions I can think of:

(1) ignore it, just do it the way Laurent proposed. I understand that someone
might feel uneasy about applications that are trapped because they don't know
the new format but could work with the old one. But I think this is not a big
issue as many applications will just try to set their own mode. For those that
doesn't and rely on the previous mode that is set by fbset or similar, we could
change fbset to prefer the old format if available. But even if we don't do
this, I don't have a problem with a program failing because it sees an
unsuitable mode even if it supports the legacy mode. It's not a regression and
can be easily fixed in userspace.

(2) forbid it, just allow drivers to implement FOURCC for formats that cannot be
represented in the old scheme. This is my preferred solution if anyone has
problems with (1).

I don't see how IOCTLs would help here. The pixel format just belongs into var
and fix so it has to be represented there anyway and thus set through it. We
could do an IOCTL that always returns the FOURCC active at the moment, if such a
FOURCC exists, and always use the legacy API for representing it in var/fix, if
it exists. But as I see this is not what you thought about so please explain
what your IOCTLS would look like and how they would solve the problem.

And I don't think a in-kernel translation layer is a good idea. Yes, it sounds
interesting, but it's tricky and the result will be that the driver and
userspace will permanently see different var and fix structures. Seriously I
think changing every framebuffer driver out there would be easier and much saner
than trying to implement such a thing.


Best regards,

Florian Tobias Schandinat

^ permalink raw reply

* Re: linux-next tree addition request (fbdev)
From: Stephen Rothwell @ 2011-08-29 23:43 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: 2162 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.

I have replced Paul;s fbdev tree with yours and dropped his fbdev-current tree.

Thanks for adding your subsystem tree as a participant of linux-next.  As
you may know, this is not a judgment of your code.  The purpose of
linux-next is for integration testing and to lower the impact of
conflicts between subsystems in the next merge window. 

You will need to ensure that the patches/commits in your tree/series have
been:
     * submitted under GPL v2 (or later) and include the Contributor's
	Signed-off-by,
     * posted to the relevant mailing list,
     * reviewed by you (or another maintainer of your subsystem tree),
     * successfully unit tested, and 
     * destined for the current or next Linux merge window.

Basically, this should be just what you would send to Linus (or ask him
to fetch).  It is allowed to be rebased if you deem it necessary.

-- 
Cheers,
Stephen Rothwell 
sfr@canb.auug.org.au

Legal Stuff:
By participating in linux-next, your subsystem tree contributions are
public and will be included in the linux-next trees.  You may be sent
e-mail messages indicating errors or other issues when the
patches/commits from your subsystem tree are merged and tested in
linux-next.  These messages may also be cross-posted to the linux-next
mailing list, the linux-kernel mailing list, etc.  The linux-next tree
project and IBM (my employer) make no warranties regarding the linux-next
project, the testing procedures, the results, the e-mails, etc.  If you
don't agree to these ground rules, let me know and I'll remove your tree
from participation in linux-next.

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

^ permalink raw reply

* Re: [PATCH/RFC v2 1/3] fbdev: Add FOURCC-based format configuration API
From: Laurent Pinchart @ 2011-08-30  1:09 UTC (permalink / raw)
  To: Florian Tobias Schandinat
  Cc: Geert Uytterhoeven, linux-fbdev, linux-media, magnus.damm,
	Guennadi Liakhovetski
In-Reply-To: <4E5BC11F.7000704@gmx.de>

Hi Florian,

On Monday 29 August 2011 18:41:03 Florian Tobias Schandinat wrote:
> On 08/29/2011 02:32 PM, Laurent Pinchart wrote:
> > On Monday 29 August 2011 16:26:02 Geert Uytterhoeven wrote:
> >> On Mon, Aug 29, 2011 at 16:17, Laurent Pinchart wrote:
> >>> On Monday 29 August 2011 16:14:38 Geert Uytterhoeven wrote:
> >>>> On Mon, Aug 29, 2011 at 15:34, Laurent Pinchart wrote:
> >>>>> On Monday 29 August 2011 15:09:04 Geert Uytterhoeven wrote:
> >>>>>> On Mon, Aug 29, 2011 at 14:55, Laurent Pinchart wrote:
> >>>>>>>> When will the driver report FB_{TYPE,VISUAL}_FOURCC?
> >>>>>>>> 
> >>>>>>>>   - When using a mode that cannot be represented in the legacy
> >>>>>>>> 
> >>>>>>>> way,
> >>>>>>> 
> >>>>>>> Definitely.
> >>>>>>> 
> >>>>>>>>   - But what with modes that can be represented? Legacy software
> >>>>>>>> 
> >>>>>>>> cannot handle FB_{TYPE,VISUAL}_FOURCC.
> >>>>>>> 
> >>>>>>> My idea was to use FB_{TYPE,VISUAL}_FOURCC only when the mode is
> >>>>>>> configured using the FOURCC API. If FBIOPUT_VSCREENINFO is called
> >>>>>>> with a non-FOURCC format, the driver will report non-FOURCC types
> >>>>>>> and visuals.
> >>>>>> 
> >>>>>> Hmm, two use cases:
> >>>>>>   - The video mode is configured using a FOURCC-aware tool ("fbset
> >>>>>>   on
> >>>>>> 
> >>>>>> steroids").
> >>>>> 
> >>>>> Such as http://git.ideasonboard.org/?pûdev-test.git;a=summary :-)
> >>>> 
> >>>> Yep.
> >>>> 
> >>>>>>     Later the user runs a legacy application.
> >>>>>>     
> >>>>>>       => Do not retain FOURCC across opening of /dev/fb*.
> >>>>> 
> >>>>> I know about that problem, but it's not that easy to work around. We
> >>>>> have no per-open fixed and variable screen info, and FB devices can
> >>>>> be opened by multiple applications at the same time.
> >>>>> 
> >>>>>>   - Is there an easy way to force FOURCC reporting, so new apps
> >>>>>>   don't
> >>>>>> 
> >>>>>> have to support parsing the legacy formats? This is useful for new
> >>>>>> apps that want to support (a subset of) FOURCC modes only.
> >>>>> 
> >>>>> Not at the moment.
> >>>> 
> >>>> So perhaps we do need new ioctls instead...
> >>>> That would also ease an in-kernel translation layer.
> >>> 
> >>> Do you mean new ioctls to replace the FOURCC API proposal, or new
> >>> ioctls for the above two operations ?
> >> 
> >> New ioctls to replace the FOURCC proposal.
> > 
> > *sigh*...
> > 
> > I'd like other people's opinion on this before throwing everything away.
> > Florian, Magnus, Guennadi, others, what do you think ?
> 
> So, your issue is that some formats can be represented in the new and the
> old way? There are 2 simpler solutions I can think of:
> 
> (1) ignore it, just do it the way Laurent proposed. I understand that
> someone might feel uneasy about applications that are trapped because they
> don't know the new format but could work with the old one. But I think
> this is not a big issue as many applications will just try to set their
> own mode. For those that doesn't and rely on the previous mode that is set
> by fbset or similar, we could change fbset to prefer the old format if
> available. But even if we don't do this, I don't have a problem with a
> program failing because it sees an unsuitable mode even if it supports the
> legacy mode. It's not a regression and can be easily fixed in userspace.

I agree with you here. Issues should be fixed in userspace. I don't expect 
many issues in practice, as fbdev is often used on systems where userspace 
components are developed to work with each other (such as embedded systems). 
If such a system is upgraded to use YUV support, all components will likely be 
tested and upgraded.

> (2) forbid it, just allow drivers to implement FOURCC for formats that
> cannot be represented in the old scheme. This is my preferred solution if
> anyone has problems with (1).

I'm tempted by that solution. Not that I have an issue with (1), but I'm 
wondering if we should try to use the FOURCC API for all formats, or just for 
formats that can't be represented by the current API. We currently have no 
bitplane FOURCCs, and I'm not sure if it would be worth adding them.

BTW, do recent hardware still support planar (in the bitplane sense) frame 
buffers ? If so, is that used in practice on recent devices ? If the answer is 
no, (1) might be the best solution, with bit-planar formats supported by the 
current API only, and all other formats supported by the FOURCC API.

> I don't see how IOCTLs would help here. The pixel format just belongs into
> var and fix so it has to be represented there anyway and thus set through
> it. We could do an IOCTL that always returns the FOURCC active at the
> moment, if such a FOURCC exists, and always use the legacy API for
> representing it in var/fix, if it exists. But as I see this is not what
> you thought about so please explain what your IOCTLS would look like and
> how they would solve the problem.
> 
> And I don't think a in-kernel translation layer is a good idea. Yes, it
> sounds interesting, but it's tricky and the result will be that the driver
> and userspace will permanently see different var and fix structures.
> Seriously I think changing every framebuffer driver out there would be
> easier and much saner than trying to implement such a thing.

I agree.

-- 
Regards,

Laurent Pinchart

^ permalink raw reply

* Re: [PATCH] fbdev: fix parsing of standard timings
From: Tomi Valkeinen @ 2011-08-30  5:31 UTC (permalink / raw)
  To: linux-fbdev
In-Reply-To: <1314362328-30456-1-git-send-email-tomi.valkeinen@ti.com>

Hi Florian,

On Fri, 2011-08-26 at 18:02 +0000, Florian Tobias Schandinat wrote:
> 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.

You can see the same thing done in
drivers/gpu/drm/drm_edid.c:drm_mode_std(). Although they seem to check
only revision, which looks a bit risky to me.

The specs seem to be available by just googling them, although I don't
know if it's legal to distribute them or not...

I've added your comment, I agree it's good. Patch below.

 Tomi


From 82c630291ad39d45009352fce1b23b4d0f44f92d Mon Sep 17 00:00:00 2001
From: Tomi Valkeinen <tomi.valkeinen@ti.com>
Date: Thu, 25 Aug 2011 15:36:40 +0300
Subject: [PATCH] fbdev: fix parsing of standard timings

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 |   21 +++++++++++++++------
 1 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/drivers/video/fbmon.c b/drivers/video/fbmon.c
index 4f57485..cef6557 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,11 @@ 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 +538,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 +604,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 +641,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: [PATCH] video/backlight: Remove obsolete cleanup for clientdata
From: Jean Delvare @ 2011-08-30 12:52 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA, Richard Purdie, Paul Mundt,
	Andrew Morton, linux-fbdev-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1314269652-18702-1-git-send-email-w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>

On Thu, 25 Aug 2011 12:54:12 +0200, Wolfram Sang wrote:
> 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;

Acked-by: Jean Delvare <khali@linux-fr.org>

-- 
Jean Delvare

^ 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