[Intel-gfx] [PATCH 3/4] drm/i915: opt-out CPU and WC mmaps from FBC

Jani Nikula jani.nikula at linux.intel.com
Tue Mar 22 13:52:42 UTC 2016


On Tue, 22 Mar 2016, Daniel Vetter <daniel at ffwll.ch> wrote:
> [ text/plain ]
> On Tue, Mar 22, 2016 at 12:28:20PM +0200, Jani Nikula wrote:
>> On Mon, 21 Mar 2016, Paulo Zanoni <paulo.r.zanoni at intel.com> wrote:
>> > +enum fb_mmap_wa_flags {
>> > +	FB_MMAP_WA_CPU =	1 << 0,
>> > +	FB_MMAP_WA_GTT =	1 << 1,
>> > +	FB_MMAP_WA_DISABLE = 	1 << 2,
>> > +	FB_MMAP_WA_FLAG_COUNT =	3,
>> > +};
>> 
>> Drive-by review, adding bit flags as enums doesn't feel like what enums
>> should be used for. I'd go for macros instead.
>
> Pretty established convention, some like it since it allows gdb&friends to
> decode your bitflags for you. So abusing enums as flag set is imo ok.

Bah, prevents GCC and friends from giving you sensible warnings on
switch cases etc. :p

BR,
Jani.


-- 
Jani Nikula, Intel Open Source Technology Center


More information about the Intel-gfx mailing list