Re: [PATCH v2 04/10] drm: Add Gamma correction structure

Emil Velikov
2015-06-12T17:17:47Z

Hi Kausal Malladi,

On 5 June 2015 at 13:00, Jindal, Sonika <sonika.jindal@intel.com> wrote:
> On 6/4/2015 7:12 PM, Kausal Malladi wrote:
>>
>> From: Kausal Malladi <Kausal.Malladi@intel.com>
>>
...
>> v2: Addressing Daniel Stone's comment, added a variable sized array to
>> carry Gamma correction values as blob property.
>>
>> Signed-off-by: Shashank Sharma <shashank.sharma@intel.com>
>> Signed-off-by: Kausal Malladi <Kausal.Malladi@intel.com>
>> ---
>> include/drm/drm_crtc.h | 3 +++
>> include/uapi/drm/drm.h | 10 ++++++++++
>> 2 files changed, 13 insertions(+)
>>
...
>> diff --git a/include/uapi/drm/drm.h b/include/uapi/drm/drm.h
>> index 3801584..fc2661c 100644
>> --- a/include/uapi/drm/drm.h
>> +++ b/include/uapi/drm/drm.h
>> @@ -829,6 +829,16 @@ struct drm_event_vblank {
>> __u32 reserved;
>> };
>>
>> +/* Color Management structure for Gamma */
>> +struct drm_gamma {
>> + __u32 flags;
>> + __u32 gamma_level;
>> + __u32 gamma_precision;
>> + __u32 num_samples;
>> + __u32 reserved;
>> + __u16 values[0];
Silly question:
Why use zero sized array ? Afaik it's a construct not covered in
C90/C99, which makes sizeof(struct drm_gamma) act funny. There seems
to be no other instance of a zero-sized array in drm uapi, plus based
of Daniel Vettel's "Botching up IOCTLS" I think that using it here
might be a bad idea.

The commit message mentions that Daniel Stone suggested it, but that
email never made it to the dri-devel mailiing list (and many other
emails, as mentioned previously) :'-(

Thanks
Emil
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org