[PATCH 1/3] drm/mediatek: Refactor pixel format logic
Matthias Brugger
matthias.bgg at gmail.com
Thu Feb 2 20:16:32 UTC 2023
On 02/02/2023 19:59, Justin Green wrote:
> Hi Matthias,
>
>> mt8173_formats are the same as the old struct formats. Maybe we should use that
>> and only overwrite where we actually use a different array.
> I think this was sort of how the original patch worked, but we wanted
> to add some flexibility to allow different components to support
> different formats. In patch 3 of the series, we actually overwrite
> this field with mt8195_formats.
>
Yes, I had a comment on the naming in that patch. Never the less, I think if we
don't need to "overwrite" the value, we should use just one struct for the
values instead of copying them to the different .c files and give them SoC
specific names.
>> Why can't we use ARRAY_SIZE(formats) here like we did before?
> I think ARRAY_SIZE is just a macro for getting the length of
> statically allocated arrays. Because we won't know until runtime which
> list of pixel formats we will be using, I'm not sure we can use that
> in this circumstance?
>
You are probably right.
Regards,
Matthias
More information about the dri-devel
mailing list