[igt-dev] [RFC PATCH 1/4] lib/i915/gem_mman: add mmap_offset support

Chris Wilson chris at chris-wilson.co.uk
Wed Aug 14 10:28:21 UTC 2019


Quoting Lukasz Kalamarz (2019-08-14 11:21:37)
> With introduction of LMEM concept new IOCTL call were implemented
> - gem_mmap_offset. This patch add support in IGT for it.
> 
> Signed-off-by: Lukasz Kalamarz <lukasz.kalamarz at intel.com>
> Signed-off-by: Antonio Argenziano <antonio.argenziano at intel.com>
> Cc: Matthew Auld <matthew.auld at intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>
> ---
>  lib/i915/gem_mman.c | 188 ++++++++++++++++++++++++++++++++++++++------
>  lib/i915/gem_mman.h |  37 ++++++++-
>  2 files changed, 202 insertions(+), 23 deletions(-)
> 
> diff --git a/lib/i915/gem_mman.c b/lib/i915/gem_mman.c
> index 3cf9a6bb..2b28a67c 100644
> --- a/lib/i915/gem_mman.c
> +++ b/lib/i915/gem_mman.c
> @@ -40,6 +40,27 @@
>  #define VG(x) do {} while (0)
>  #endif
>  
> +#define LOCAL_I915_PARAM_MMAP_OFFSET_VERSION 54
> +
> +bool gem_has_mmap_offset(int fd)
> +{
> +       static int has_mmap_offset = -1;
> +
> +       if (has_mmap_offset == -1) {

How many times do I have to say that I am sorry for introducing static
here. It was to cut down on strace spam, but no one should be repeatedly
checking, so please don't cargo cult it. It doesn't bode well.
-Chris


More information about the igt-dev mailing list