[Intel-gfx] [PATCH 3/3] drm/i915/fb: Fold modifier CCS type/tiling attribute to plane caps

Jani Nikula jani.nikula at linux.intel.com
Wed Oct 27 08:05:08 UTC 2021


On Wed, 27 Oct 2021, Imre Deak <imre.deak at intel.com> wrote:
> On Tue, Oct 26, 2021 at 08:52:12PM +0300, Jani Nikula wrote:
>> AFAICT there are no intel_plane_caps references anywhere after this, and
>> it no longer looks like an enum, so perhaps it just shouldn't be an enum
>> anymore? Just make them macros?
>
> There are other instances of bitfield enums in the kernel, but yes in C
> there's no benefit of enums for this over the simpler macro approach.
> Will change this.

Semantically I think enums are good for enumerating and naming the bit
*positions*, but not so much the shifted bit values. See e.g. enum
drm_dp_quirk, where the values aren't important, but they're used with
BIT() in drm_dp_has_quirk().

BR,
Jani.


-- 
Jani Nikula, Intel Open Source Graphics Center


More information about the Intel-gfx mailing list