[PATCH 1/3] drm/mediatek: Refactor pixel format logic

Justin Green greenjustin at chromium.org
Thu Feb 2 10:59:21 PST 2023


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.

> 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?

Regards,
Justin



More information about the Linux-mediatek mailing list