Hello,
On Friday, 6 February 2026 15:05:08 Central European Standard Time Maxime
Ripard wrote:
> Hi,
>
> On Wed, Jan 21, 2026 at 03:45:09PM +0100, Nicolas Frattaroli wrote:
> > diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
> > index 7eaec37ae1c7..b5604dca728a 100644
> > --- a/include/drm/drm_connector.h
> > +++ b/include/drm/drm_connector.h
> > @@ -556,6 +556,16 @@ enum drm_colorspace {
> > DRM_MODE_COLORIMETRY_COUNT
> > };
> >
> > +enum drm_color_format {
> > + DRM_COLOR_FORMAT_AUTO = 0,
> > + DRM_COLOR_FORMAT_RGB444 = BIT(0),
> > + DRM_COLOR_FORMAT_YCBCR444 = BIT(1),
> > + DRM_COLOR_FORMAT_YCBCR422 = BIT(2),
> > + DRM_COLOR_FORMAT_YCBCR420 = BIT(3),
> > +};
> > +
> > +#define DRM_COLOR_FORMAT_COUNT 5
> > +
>
> I don't really see a reason to expose an enum, with a bunch of values
> that are all mutually exclusive, as a bitmask. It's pretty inconsistent
> with most (all?) the other similar properties we have.
>
> I appreciate you did that to avoid fixing up every driver using those
> values, but then maybe we don't have to? We could create a userspace
> facing enum, and convert to DRM_COLOR_FORMAT internally.
This is what the series did at v5 and earlier. IMHO it was kind of
counter-productive, because we then had two different things for the
same purpose, and some conversion logic between them. I think it's more
error prone to do it that way (think: mixing up the two), and doesn't
have a clear benefit. Just to give a picture of how bad things get:
1. we have the HDMI color format (aka "HDMI_COLORSPACE")
2. we have driver specific output color formats, e.g. the intel ones
3. we have DRM_COLOR_FORMAT
4. we have the bus formats (multiple per color format)
5. we have the DRM plane formats (again, multiple per color format)
Adding a sixth into the mix feels a bit bad because we'll then need to
justify why we should have another layer of switch-case statements.
Kind regards,
Nicolas Frattaroli
>
> Maxime
>