[igt-dev] [PATCH i-g-t v4 2/3] lib/i915/gem_mman: add mmap_offset support

Chris Wilson chris at chris-wilson.co.uk
Thu Nov 28 14:38:13 UTC 2019


Quoting Zbigniew KempczyƄski (2019-11-26 17:25:55)
>  /**
>   * __gem_mmap__wc:
>   * @fd: open i915 drm file descriptor
> @@ -194,7 +285,12 @@ static void
>   */
>  void *__gem_mmap__wc(int fd, uint32_t handle, uint64_t offset, uint64_t size, unsigned prot)
>  {
> -       return __gem_mmap(fd, handle, offset, size, prot, I915_MMAP_WC);
> +       void *ptr = __gem_mmap_offset(fd, handle, offset, size, prot,
> +                                     I915_MMAP_OFFSET_WC);
> +       if (!ptr)
> +               ptr = __gem_mmap(fd, handle, offset, size, prot, I915_MMAP_WC);

This subverts the tests/i915/gem_mmap_wc.c so we lose coverage of the
legacy API.

Yikes.
-Chris


More information about the igt-dev mailing list