Re: [PATCH 1/3] drm/i915: Reject unknown syncobj flags

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Quoting Tvrtko Ursulin (2017-10-27 14:40:12)
> From: Tvrtko Ursulin <tvrtko.ursulin@xxxxxxxxx>
> 
> We have to reject unknown flags for uAPI considerations, and also
> because the curent implementation limits their i915 storage space
> to two bits.
> 
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@xxxxxxxxx>
> Fixes: cf6e7bac6357 ("drm/i915: Add support for drm syncobjs")
> Cc: Jason Ekstrand <jason@xxxxxxxxxxxxxx>
> Cc: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
> Cc: Jani Nikula <jani.nikula@xxxxxxxxxxxxxxx>
> Cc: Joonas Lahtinen <joonas.lahtinen@xxxxxxxxxxxxxxx>
> Cc: Rodrigo Vivi <rodrigo.vivi@xxxxxxxxx>
> Cc: David Airlie <airlied@xxxxxxxx>
> Cc: intel-gfx@xxxxxxxxxxxxxxxxxxxxx
> Cc: dri-devel@xxxxxxxxxxxxxxxxxxxxx
> ---
>  drivers/gpu/drm/i915/i915_gem_execbuffer.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
> index 3d7190764f10..3bc723ed6e2f 100644
> --- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
> +++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
> @@ -2100,6 +2100,11 @@ get_fence_array(struct drm_i915_gem_execbuffer2 *args,
>                         goto err;
>                 }
>  

Make the test explicit for the abi:

> +               if (fence.flags & ~((typeof(fence.flags))2)) {
s/2/3/!

if (fence.flags & ~(I915_EXEC_FENCE_WAIT | I915_EXEC_FENCE_SIGNAL)) {

> +                       err = -EINVAL;
> +                       goto err;
> +               }
> +

BUILD_BUG_ON((I915_EXEC_FENCE_WAIT | I915_EXEC_FENCE_SIGNAL)) & ~(alignof(void *)-1)) ?

#define I915_EXEC_FENCE_FLAGS ... ?
-Chris
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux