[Intel-gfx] [PATCH v2 34/37] drm/i915: Introduce GEM_OBJECT_SETPARAM with I915_PARAM_MEMORY_REGION

Chris Wilson chris at chris-wilson.co.uk
Fri Jun 28 00:22:09 UTC 2019


Quoting Matthew Auld (2019-06-27 21:56:30)
> +int i915_gem_setparam_ioctl(struct drm_device *dev, void *data,
> +                           struct drm_file *file)
> +{
> +       struct drm_i915_gem_context_param *args = data;

The plan was to use the upper_32_bits() or whatever as the class. To
future proof, I would recommend being more explicit with a switch.

> +       if (args->param <= I915_CONTEXT_PARAM_MAX)
> +               return i915_gem_context_setparam_ioctl(dev, data, file);
> +
> +       return i915_gem_object_setparam_ioctl(dev, data, file);
> +}

>  /* Allow drivers to submit batchbuffers directly to hardware, relying
>   * on the security mechanisms provided by hardware.
> @@ -1595,11 +1597,36 @@ struct drm_i915_gem_context_param {
>   *   i915_context_engines_bond (I915_CONTEXT_ENGINES_EXT_BOND)
>   */
>  #define I915_CONTEXT_PARAM_ENGINES     0xa
> +
> +#define I915_CONTEXT_PARAM_MAX         0xffffffff
>  /* Must be kept compact -- no holes and well documented */

Hahaha. Good one.

The rest of the patch is clearly very early proof of concept as it needs
the locking reworked.
-Chris


More information about the Intel-gfx mailing list