All of lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: linux-fbdev@vger.kernel.org, linux-media@vger.kernel.org,
	dri-devel@lists.freedesktop.org
Subject: Re: [RFC] Standardize YUV support in the fbdev API
Date: Fri, 20 May 2011 22:33:02 +0000	[thread overview]
Message-ID: <4DD6EC1E.4090702@gmx.de> (raw)
In-Reply-To: <201105180007.21173.laurent.pinchart@ideasonboard.com>

Hi Laurent,

On 05/17/2011 10:07 PM, Laurent Pinchart wrote:
> Hi everybody,
>
> I need to implement support for a YUV frame buffer in an fbdev driver. As the
> fbdev API doesn't support this out of the box, I've spent a couple of days
> reading fbdev (and KMS) code and thinking about how we could cleanly add YUV
> support to the API. I'd like to share my findings and thoughts, and hopefully
> receive some comments back.

Thanks. I think you did already a good job, hope we can get it done this time.

> Given the overlap between the KMS, V4L2 and fbdev APIs, the need to share data
> and buffers between those subsystems, and the planned use of V4L2 FCCs in the
> KMS overlay API, I believe using V4L2 FCCs to identify fbdev formats would be
> a wise decision.

I agree.

> To select a frame buffer YUV format, the fb_var_screeninfo structure will need
> to be extended with a format field. The fbdev API and ABI must not be broken,
> which prevents us from changing the current structure layout and replacing the
> existing format selection mechanism (through the red, green, blue and alpha
> bitfields) completely.

I agree.

> - Other solutions are possible, such as adding new ioctls. Those solutions are
> more intrusive, and require larger changes to both userspace and kernelspace
> code.

I'm against (ab)using the nonstd field (probably the only sane thing we can do 
with it is declare it non-standard which interpretation is completely dependent 
on the specific driver) or requiring previously unused fields to have a special 
value so I'd like to suggest a different method:

I remembered an earlier discussion:
[ http://marc.info/?l=linux-fbdev&m\x129896686208130&w=2 ]

On 03/01/2011 08:07 AM, Geert Uytterhoeven wrote:
 > On Tue, Mar 1, 2011 at 04:13, Damian<dhobsong@igel.co.jp>  wrote:
 >> On 2011/02/24 15:05, Geert Uytterhoeven wrote:
 >>> For YUV (do you mean YCbCr?), I'm inclined to suggest adding a new
 >>> FB_VISUAL_*
 >>> type instead, which indicates the fb_var_screeninfo.{red,green,blue}
 >>> fields are
 >>> YCbCr instead of RGB.
 >>> Depending on the frame buffer organization, you also need new
 >>> FB_TYPE_*/FB_AUX_*
 >>> types.
 >>
 >> I just wanted to clarify here.  Is your comment about these new flags in
 >> specific reference to this patch or to Magnus' "going forward" comment?  It
 >
 > About new flags.
 >
 >> seems like the beginnings of a method to standardize YCbCr support in fbdev
 >> across all platforms.
 >> Also, do I understand correctly that FB_VISUAL_ would specify the colorspace
 >
 > FB_VISUAL_* specifies how pixel values (which may be tuples) are mapped to
 > colors on the screen, so to me it looks like the sensible way to set up YCbCr.
 >
 >> (RGB, YCbCr), FB_TYPE_* would be a format specifier (i.e. planar,
 >> semiplanar, interleaved, etc)?  I'm not really sure what you are referring
 >> to with the FB_AUX_* however.
 >
 > Yep, FB_TYPE_* specifies how pixel values/tuples are laid out in frame buffer
 > memory.
 >
 > FB_AUX_* is only used if a specific value of FB_TYPE_* needs an additional
 > parameter (e.g. the interleave value for interleaved bitplanes).

Adding new standard values for these fb_fix_screeninfo fields would solve the 
issue for framebuffers which only support a single format. If you have the need 
to switch I guess it would be a good idea to add a new flag to the vmode 
bitfield in fb_var_screeninfo which looks like a general purpose modifier for 
the videomode. You could than reuse any RGB-specific field you like to pass more 
information.
Maybe we should also use this chance to declare one of the fix_screeninfo 
reserved fields to be used for capability flags or an API version as we can 
assume that those are 0 (at least in sane drivers).


Good luck,

Florian Tobias Schandinat

WARNING: multiple messages have this Message-ID (diff)
From: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: linux-fbdev@vger.kernel.org, linux-media@vger.kernel.org,
	dri-devel@lists.freedesktop.org
Subject: Re: [RFC] Standardize YUV support in the fbdev API
Date: Fri, 20 May 2011 22:33:02 +0000	[thread overview]
Message-ID: <4DD6EC1E.4090702@gmx.de> (raw)
In-Reply-To: <201105180007.21173.laurent.pinchart@ideasonboard.com>

Hi Laurent,

On 05/17/2011 10:07 PM, Laurent Pinchart wrote:
> Hi everybody,
>
> I need to implement support for a YUV frame buffer in an fbdev driver. As the
> fbdev API doesn't support this out of the box, I've spent a couple of days
> reading fbdev (and KMS) code and thinking about how we could cleanly add YUV
> support to the API. I'd like to share my findings and thoughts, and hopefully
> receive some comments back.

Thanks. I think you did already a good job, hope we can get it done this time.

> Given the overlap between the KMS, V4L2 and fbdev APIs, the need to share data
> and buffers between those subsystems, and the planned use of V4L2 FCCs in the
> KMS overlay API, I believe using V4L2 FCCs to identify fbdev formats would be
> a wise decision.

I agree.

> To select a frame buffer YUV format, the fb_var_screeninfo structure will need
> to be extended with a format field. The fbdev API and ABI must not be broken,
> which prevents us from changing the current structure layout and replacing the
> existing format selection mechanism (through the red, green, blue and alpha
> bitfields) completely.

I agree.

> - Other solutions are possible, such as adding new ioctls. Those solutions are
> more intrusive, and require larger changes to both userspace and kernelspace
> code.

I'm against (ab)using the nonstd field (probably the only sane thing we can do 
with it is declare it non-standard which interpretation is completely dependent 
on the specific driver) or requiring previously unused fields to have a special 
value so I'd like to suggest a different method:

I remembered an earlier discussion:
[ http://marc.info/?l=linux-fbdev&m=129896686208130&w=2 ]

On 03/01/2011 08:07 AM, Geert Uytterhoeven wrote:
 > On Tue, Mar 1, 2011 at 04:13, Damian<dhobsong@igel.co.jp>  wrote:
 >> On 2011/02/24 15:05, Geert Uytterhoeven wrote:
 >>> For YUV (do you mean YCbCr?), I'm inclined to suggest adding a new
 >>> FB_VISUAL_*
 >>> type instead, which indicates the fb_var_screeninfo.{red,green,blue}
 >>> fields are
 >>> YCbCr instead of RGB.
 >>> Depending on the frame buffer organization, you also need new
 >>> FB_TYPE_*/FB_AUX_*
 >>> types.
 >>
 >> I just wanted to clarify here.  Is your comment about these new flags in
 >> specific reference to this patch or to Magnus' "going forward" comment?  It
 >
 > About new flags.
 >
 >> seems like the beginnings of a method to standardize YCbCr support in fbdev
 >> across all platforms.
 >> Also, do I understand correctly that FB_VISUAL_ would specify the colorspace
 >
 > FB_VISUAL_* specifies how pixel values (which may be tuples) are mapped to
 > colors on the screen, so to me it looks like the sensible way to set up YCbCr.
 >
 >> (RGB, YCbCr), FB_TYPE_* would be a format specifier (i.e. planar,
 >> semiplanar, interleaved, etc)?  I'm not really sure what you are referring
 >> to with the FB_AUX_* however.
 >
 > Yep, FB_TYPE_* specifies how pixel values/tuples are laid out in frame buffer
 > memory.
 >
 > FB_AUX_* is only used if a specific value of FB_TYPE_* needs an additional
 > parameter (e.g. the interleave value for interleaved bitplanes).

Adding new standard values for these fb_fix_screeninfo fields would solve the 
issue for framebuffers which only support a single format. If you have the need 
to switch I guess it would be a good idea to add a new flag to the vmode 
bitfield in fb_var_screeninfo which looks like a general purpose modifier for 
the videomode. You could than reuse any RGB-specific field you like to pass more 
information.
Maybe we should also use this chance to declare one of the fix_screeninfo 
reserved fields to be used for capability flags or an API version as we can 
assume that those are 0 (at least in sane drivers).


Good luck,

Florian Tobias Schandinat

  parent reply	other threads:[~2011-05-20 22:33 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-17 22:07 [RFC] Standardize YUV support in the fbdev API Laurent Pinchart
2011-05-17 22:07 ` Laurent Pinchart
2011-05-17 22:44 ` Felipe Contreras
2011-05-17 22:44   ` Felipe Contreras
2011-05-18  6:53   ` Hans Verkuil
2011-05-18  6:53     ` Hans Verkuil
2011-05-23 11:55     ` Marek Szyprowski
2011-05-23 11:55       ` Marek Szyprowski
2011-05-23 12:09       ` Hans Verkuil
2011-05-23 12:09         ` Hans Verkuil
2011-05-18  0:21 ` Andy Walls
2011-05-18  0:21   ` Andy Walls
2011-05-18  1:09   ` Andy Walls
2011-05-18  1:09     ` Andy Walls
2011-05-18  1:09     ` Andy Walls
2011-05-20 22:33 ` Florian Tobias Schandinat [this message]
2011-05-20 22:33   ` Florian Tobias Schandinat
2011-05-23 21:00   ` Laurent Pinchart
2011-05-23 21:00     ` Laurent Pinchart
2011-05-23 21:00     ` Laurent Pinchart
2011-05-23 22:56     ` Florian Tobias Schandinat
2011-05-23 22:56       ` Florian Tobias Schandinat
2011-06-21 15:36       ` [PATCH/RFC] fbdev: Add FOURCC-based format configuration API Laurent Pinchart
2011-06-21 15:36         ` Laurent Pinchart
2011-06-21 20:49         ` Geert Uytterhoeven
2011-06-21 20:49           ` Geert Uytterhoeven
2011-06-21 22:31           ` Laurent Pinchart
2011-06-21 22:31             ` Laurent Pinchart
2011-06-22  5:45             ` Florian Tobias Schandinat
2011-06-22  8:50               ` Laurent Pinchart
2011-06-22  8:50                 ` Laurent Pinchart
2011-06-23 16:08               ` Geert Uytterhoeven
2011-06-23 16:08                 ` Geert Uytterhoeven
2011-06-24  6:19                 ` Paul Mundt
2011-06-24  6:19                   ` Paul Mundt
2011-06-24 18:55                   ` Geert Uytterhoeven
2011-06-24 18:55                     ` Geert Uytterhoeven
2011-06-24 19:45                     ` Florian Tobias Schandinat
2011-07-11 15:32                       ` Laurent Pinchart
2011-07-11 15:32                         ` Laurent Pinchart
2011-07-25 10:30                         ` Laurent Pinchart
2011-07-25 10:30                           ` Laurent Pinchart
2011-07-28  8:31                         ` Guennadi Liakhovetski
2011-07-28  8:31                           ` Guennadi Liakhovetski
2011-07-28 10:51                           ` Laurent Pinchart
2011-07-28 10:51                             ` Laurent Pinchart
2011-07-31 20:32                             ` Geert Uytterhoeven
2011-07-31 20:32                               ` Geert Uytterhoeven
2011-07-31 22:54                               ` Florian Tobias Schandinat
2011-07-31 23:28                                 ` Laurent Pinchart
2011-07-31 23:28                                   ` Laurent Pinchart
2011-07-31 23:58                                   ` Florian Tobias Schandinat
2011-07-31 23:58                                     ` Florian Tobias Schandinat
2011-08-01 14:11                                     ` Laurent Pinchart
2011-08-01 14:11                                       ` Laurent Pinchart
2011-08-01  9:49                                 ` Geert Uytterhoeven
2011-08-01  9:49                                   ` Geert Uytterhoeven
2011-08-11 17:19                                   ` Laurent Pinchart
2011-08-11 17:19                                     ` Laurent Pinchart
2011-08-13  9:42                                     ` Geert Uytterhoeven
2011-08-13  9:42                                       ` Geert Uytterhoeven
2011-07-31 23:30                               ` Laurent Pinchart
2011-07-31 23:30                                 ` Laurent Pinchart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4DD6EC1E.4090702@gmx.de \
    --to=florianschandinat@gmx.de \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.