[Intel-gfx] [PATCH 1/2] drm/dp: start a DPCD based DP sink/branch device quirk database

Daniel Vetter daniel at ffwll.ch
Sun May 14 11:00:36 UTC 2017


On Fri, May 12, 2017 at 9:57 AM, Jani Nikula <jani.nikula at intel.com> wrote:
> Personally I don't think enums should be used for defining bits, because
> they are not enumerations. The bits are usually combined to come up with
> values that are not part of the enum.
>
> If we added the quirks to struct intel_dp_desc (and moved to drm
> helpers) we could use enums for defining the bit shifts and add a
> function to query for a specific quirk, say, drm_dp_has_quirk(struct
> drm_dp_desc *desc, enum drm_dpcd_quirk quirk).

It's a bit a gnu-ism afaik, but enums-as-bitfields is very much
standard. gdb even decodes it for you into the individual bits iirc.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch


More information about the Intel-gfx mailing list