[Intel-gfx] [PATCH] drm/i915: use appropriate integer types for flags

Chris Wilson chris at chris-wilson.co.uk
Wed Nov 14 12:41:55 UTC 2018


Quoting Lionel Landwerlin (2018-11-14 12:08:06)
> We've been dealing a number of 32/64 bits flags issues lately :
> 
>  - 085603287452fc ("drm/i915: Compare user's 64b GTT offset even on 32b")
>  - c58281056a8b26 ("drm/i915: Mark up GTT sizes as u64")
>  - 83b466b1dc5f0b ("drm/i915: Mark pin flags as u64")
> 
> As userspace and in particular Mesa pulls in the uAPI headers and
> builds up flags using the uAPI defines we should probably make those
> more explicitly 32/64bits aware.

I just want to note that since these happen to be signed values, we
don't have the same issue with zero-extension of their inverses. I don't
think there's user impact here; no requirement for cc:stable.
 
> Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
> ---
>  include/uapi/drm/i915_drm.h | 90 ++++++++++++++++++-------------------
>  1 file changed, 45 insertions(+), 45 deletions(-)
> 
> diff --git a/include/uapi/drm/i915_drm.h b/include/uapi/drm/i915_drm.h
> index e477ef8c644e..f562c4239bd8 100644
> --- a/include/uapi/drm/i915_drm.h
> +++ b/include/uapi/drm/i915_drm.h
> @@ -895,12 +895,12 @@ struct drm_i915_gem_exec_object2 {
>          */
>         __u64 offset;
>  
> -#define EXEC_OBJECT_NEEDS_FENCE                 (1<<0)
> -#define EXEC_OBJECT_NEEDS_GTT           (1<<1)
> -#define EXEC_OBJECT_WRITE               (1<<2)
> -#define EXEC_OBJECT_SUPPORTS_48B_ADDRESS (1<<3)
> -#define EXEC_OBJECT_PINNED              (1<<4)
> -#define EXEC_OBJECT_PAD_TO_SIZE                 (1<<5)
> +#define EXEC_OBJECT_NEEDS_FENCE                 (1ULL<<0)

We should probably appease CODING_STYLE a bit more while we are here;
	(1ULL << 0)
-Chris


More information about the Intel-gfx mailing list