[Intel-gfx] [PATCH 2/4] drm/i915: Introduce DRM_I915_GEM_MMAP_OFFSET

Chris Wilson chris at chris-wilson.co.uk
Fri Nov 15 13:51:34 UTC 2019


Quoting Abdiel Janulgue (2019-11-15 11:45:47)
> +i915_gem_mmap_offset_ioctl(struct drm_device *dev, void *data,
> +                          struct drm_file *file)
>  {
> -       struct drm_i915_gem_mmap_gtt *args = data;
> +       struct drm_i915_private *i915 = to_i915(dev);
> +       struct drm_i915_gem_mmap_offset *args = data;
> +       enum i915_mmap_type type;
> +
> +       switch (args->flags) {
> +       case I915_MMAP_OFFSET_GTT:
> +               if (!i915_ggtt_has_aperture(&i915->ggtt))
> +                       return -ENODEV;
> +               type = I915_MMAP_TYPE_GTT;
> +               break;
> +
> +       case I915_MMAP_OFFSET_WC:
> +               if (!boot_cpu_has(X86_FEATURE_PAT))
> +                       return -ENODEV;
> +               type = I915_MMAP_TYPE_WC;
> +               break;
> +
> +       case I915_MMAP_OFFSET_WB:
> +               type = I915_MMAP_TYPE_WB;
> +               break;
> +
> +       case I915_MMAP_OFFSET_UC:
> +               if (!boot_cpu_has(X86_FEATURE_PAT))
> +                       return -ENODEV;
> +               type = I915_MMAP_TYPE_UC;
> +               break;
> +
> +       default:
> +               return -EINVAL;
> +       }
>  
>         return __assign_gem_object_mmap_data(file, args->handle,
>                                              I915_MMAP_TYPE_GTT,

s/TYPE_GTT/type/?
-Chris


More information about the Intel-gfx mailing list