[PATCH RFC 3/6] drm: Plane YCbCr to RGB conversion related properties

Sharma, Shashank shashank.sharma at intel.com
Wed Apr 26 13:28:30 UTC 2017


Regards

Shashank


On 4/26/2017 6:26 PM, Jyri Sarha wrote:
> On 04/24/17 19:55, Ville Syrjälä wrote:
>>> In fact we have plane specific YCbCr to RGB CSC (only preoffset
>>> possible), then (per crtc) gamma table, and finally a (per crtc) RGB to
>>> YCbCr CSC with optional post offset (so it can be used either as CSC or
>>> CTM).
>> So with that plane hw you could perhaps do:
>> - YCbCr->RGB if you input is not linear, but then you must
>>    blend using non-linear data
>> - colorspace conversion if your input is alredy linear
>>
>> And with your crtc hw you could do:
>> - degamma + CTM
>> - gamma + RGB->YCbCr
>
> Just a generic question. Shouldn't - in an ideal HW - the degamma phase
> and the CTM be a plane specific property?
>
> I mean, isn't the purpose of normalizing the non linear RGB to linear
> (and possibly converting the color space) to have same format for all
> plane data before blending and composing them together?
I think Ville's point is something else.
There are two types of color operations possible:
- color space matching so that you can blend the plane data accurately.
- color correction or transformation to enhance display, or change 
output from one format to other format.

Now, when you want to blend, you have to make sure that, you blend among 
the same, that means:
- all the framebuffers should be in one state, either linear or non-linear
- all the framebuffers should be in one color space (REC 709 or 601 or 
2020), else you have to do gamut mapping
- Gamut mapping is possible on Linear data only.

Else, if we try to blend one REC2020 buffer and one REC709 buffer, its 
like adding 2CM + 3MM and making = 5CM

So, we can use the plane level properties in such a way that, you should 
have similar data to the input of the blender (linear Or non-linear)
And then, once blending is done, you can use CRTC level operations for 
color correction and transformation
(Like RGB->YCBCR conversion using CRTC level CSC, for YCBCR420 kind of 
outputs)

Does it helps in explanation ?

- Shashank
>
> Of course it does not matter if all the planes use the same color space,
> which then should be converted to something else for the output.
>
> ... or have I misunderstood something?
>
> Cheers,
> Jyri



More information about the dri-devel mailing list