[Intel-gfx] [PATCH 2/3] drm/file: Uncompact the feature flags

Chris Wilson chris at chris-wilson.co.uk
Fri Nov 2 17:05:54 UTC 2018


Quoting Daniel Vetter (2018-11-02 13:25:42)
> This essentially undoes
> 
> commit 39868bd7668bd47308b1dfd97c212757caee764f
> Author: Chris Wilson <chris at chris-wilson.co.uk>
> Date:   Tue Oct 29 08:55:58 2013 +0000
> 
>     drm: Compact booleans within struct drm_file
> 
> We do lockless access to these flags everywhere, and it's kinda not a
> great idea to mix lockless and bitfields. Aside from that gcc isn't
> generating great code for these.
> 
> If this ever becomes an issue size-wise, I think we need atomic_t here
> and atomic bitflag ops.

(you don't need atomic_t to use atomic bitflag ops, more so since the
bit ops work on unsigned long!)

> Cc: Chris Wilson <chris at chris-wilson.co.uk>
> Cc: David Herrmann <dh.herrmann at gmail.com>
> Cc: Dave Airlie <airlied at redhat.com>
> Signed-off-by: Daniel Vetter <daniel.vetter at intel.com>

A bit of a nuisance since bools are not well specified in terms of
alignment and size, so the growth is as bad as you would expect, and if
atomic access to these individual members was strictly required we
would already be up the proverbial creek.

Acked-by: Chris Wilson <chris at chris-wilson.co.uk>
-Chris


More information about the Intel-gfx mailing list