linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Support for RGB/YUV 10, 12 BPC(bits per color/component) image data formats in kernel
@ 2017-06-02 13:08 Ajay kumar
  2017-06-03  8:18 ` Sakari Ailus
  0 siblings, 1 reply; 4+ messages in thread
From: Ajay kumar @ 2017-06-02 13:08 UTC (permalink / raw)
  To: LKML, linux-media

Hi all,

I have tried searching for RGB/YUV 10, 12 BPC formats in videodev2.h,
media-bus-format.h and drm_fourcc.h
I could only find RGB 10BPC support in drm_fourcc.h.
I guess not much support is present for formats with (BPC > 8) in the kernel.

Are there any plans to add fourcc defines for such formats?
Also, I wanted to how to define fourcc code for those formats?

Thanks,
Ajay Kumar

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Support for RGB/YUV 10, 12 BPC(bits per color/component) image data formats in kernel
  2017-06-02 13:08 Support for RGB/YUV 10, 12 BPC(bits per color/component) image data formats in kernel Ajay kumar
@ 2017-06-03  8:18 ` Sakari Ailus
  2017-06-06  6:35   ` Ajay kumar
  0 siblings, 1 reply; 4+ messages in thread
From: Sakari Ailus @ 2017-06-03  8:18 UTC (permalink / raw)
  To: Ajay kumar; +Cc: LKML, linux-media

Hi Ajay,

On Fri, Jun 02, 2017 at 06:38:53PM +0530, Ajay kumar wrote:
> Hi all,
> 
> I have tried searching for RGB/YUV 10, 12 BPC formats in videodev2.h,
> media-bus-format.h and drm_fourcc.h
> I could only find RGB 10BPC support in drm_fourcc.h.
> I guess not much support is present for formats with (BPC > 8) in the kernel.

What's "BPC"? Most YUV and RGB formats have only 8 bits per sample. More
format definitions may be added if there's a driver that makes use of them.

> 
> Are there any plans to add fourcc defines for such formats?
> Also, I wanted to how to define fourcc code for those formats?

-- 
Regards,

Sakari Ailus
e-mail: sakari.ailus@iki.fi	XMPP: sailus@retiisi.org.uk

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Support for RGB/YUV 10, 12 BPC(bits per color/component) image data formats in kernel
  2017-06-03  8:18 ` Sakari Ailus
@ 2017-06-06  6:35   ` Ajay kumar
  2017-06-06  9:33     ` Hans Verkuil
  0 siblings, 1 reply; 4+ messages in thread
From: Ajay kumar @ 2017-06-06  6:35 UTC (permalink / raw)
  To: Sakari Ailus; +Cc: LKML, linux-media

Hi Sakari,

On Sat, Jun 3, 2017 at 1:48 PM, Sakari Ailus <sakari.ailus@iki.fi> wrote:
> Hi Ajay,
>
> On Fri, Jun 02, 2017 at 06:38:53PM +0530, Ajay kumar wrote:
>> Hi all,
>>
>> I have tried searching for RGB/YUV 10, 12 BPC formats in videodev2.h,
>> media-bus-format.h and drm_fourcc.h
>> I could only find RGB 10BPC support in drm_fourcc.h.
>> I guess not much support is present for formats with (BPC > 8) in the kernel.
>
> What's "BPC"? Most YUV and RGB formats have only 8 bits per sample. More
> format definitions may be added if there's a driver that makes use of them.
BPC : Bits Per Color/Component
In my project, we have an image capture device which can capture 10 or
12 bits for each of R, G, B colors, i.e:
R[0:9] G[0:9] B[0:9] and
R[0:11] G[0:11] B[0:11]

I want to define macros for the above formats in videodev2.h.
But, I am not getting the logic behind the naming convention used to
define v4l2_fourcc macros.
ex:
V4L2_PIX_FMT_ARGB32      v4l2_fourcc('A', 'R', '2', '4');

How did they choose the characters 'A', 'R', '2', '4' in the above case?

I want to know the logic/naming convention behind that, so that I can create
new v4l2_fourcc defines for 10, 12 BPC formats and use in my driver.

Thanks,
Ajay Kumar
>>
>> Are there any plans to add fourcc defines for such formats?
>> Also, I wanted to how to define fourcc code for those formats?
>
> --
> Regards,
>
> Sakari Ailus
> e-mail: sakari.ailus@iki.fi     XMPP: sailus@retiisi.org.uk

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Support for RGB/YUV 10, 12 BPC(bits per color/component) image data formats in kernel
  2017-06-06  6:35   ` Ajay kumar
@ 2017-06-06  9:33     ` Hans Verkuil
  0 siblings, 0 replies; 4+ messages in thread
From: Hans Verkuil @ 2017-06-06  9:33 UTC (permalink / raw)
  To: Ajay kumar, Sakari Ailus; +Cc: LKML, linux-media

On 06/06/17 08:35, Ajay kumar wrote:
> Hi Sakari,
> 
> On Sat, Jun 3, 2017 at 1:48 PM, Sakari Ailus <sakari.ailus@iki.fi> wrote:
>> Hi Ajay,
>>
>> On Fri, Jun 02, 2017 at 06:38:53PM +0530, Ajay kumar wrote:
>>> Hi all,
>>>
>>> I have tried searching for RGB/YUV 10, 12 BPC formats in videodev2.h,
>>> media-bus-format.h and drm_fourcc.h
>>> I could only find RGB 10BPC support in drm_fourcc.h.
>>> I guess not much support is present for formats with (BPC > 8) in the kernel.
>>
>> What's "BPC"? Most YUV and RGB formats have only 8 bits per sample. More
>> format definitions may be added if there's a driver that makes use of them.
> BPC : Bits Per Color/Component
> In my project, we have an image capture device which can capture 10 or
> 12 bits for each of R, G, B colors, i.e:
> R[0:9] G[0:9] B[0:9] and
> R[0:11] G[0:11] B[0:11]
> 
> I want to define macros for the above formats in videodev2.h.
> But, I am not getting the logic behind the naming convention used to
> define v4l2_fourcc macros.
> ex:
> V4L2_PIX_FMT_ARGB32      v4l2_fourcc('A', 'R', '2', '4');
> 
> How did they choose the characters 'A', 'R', '2', '4' in the above case?
> 
> I want to know the logic/naming convention behind that, so that I can create
> new v4l2_fourcc defines for 10, 12 BPC formats and use in my driver.

A = has Alpha channel, R = uses RGB, 24 = uses 24 bits for the RGB part.

So for 10 bit you'd get AR30 and for 12 bit per component it's AR36.
If there is no alpha channel, then use XR30/XR36.

In practice there isn't much of a system behind these formats.

Regards,

	Hans

> 
> Thanks,
> Ajay Kumar
>>>
>>> Are there any plans to add fourcc defines for such formats?
>>> Also, I wanted to how to define fourcc code for those formats?
>>
>> --
>> Regards,
>>
>> Sakari Ailus
>> e-mail: sakari.ailus@iki.fi     XMPP: sailus@retiisi.org.uk

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-06-06  9:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-02 13:08 Support for RGB/YUV 10, 12 BPC(bits per color/component) image data formats in kernel Ajay kumar
2017-06-03  8:18 ` Sakari Ailus
2017-06-06  6:35   ` Ajay kumar
2017-06-06  9:33     ` Hans Verkuil

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).