[Intel-gfx] [PATCH] i965: Embrace "unlimited" GTT mmap support

Kenneth Graunke kenneth at whitecape.org
Thu Aug 25 07:26:32 UTC 2016


On Wednesday, August 24, 2016 8:42:44 PM PDT Chris Wilson wrote:
> From about kernel 4.9, GTT mmaps are virtually unlimited. A new
> parameter, I915_PARAM_MMAP_GTT_VERSION, is added to advertise the
> feature so query it and use it to avoid limiting tiled allocations to
> only fit within the mappable aperture.
> 
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> Cc: Kenneth Graunke <kenneth at whitecape.org>

Cool!  I didn't realize we could do page faulting here, since it's
CPU-related.  It's definitely nice to be able to map an unlimited
amount of space, at least as a fallback, even if other methods end
up being more efficient and we prefer those.

[snip]
> diff --git a/src/mesa/drivers/dri/i965/intel_screen.c b/src/mesa/drivers/dri/i965/intel_screen.c
> index 98f1c76..62eacba 100644
> --- a/src/mesa/drivers/dri/i965/intel_screen.c
> +++ b/src/mesa/drivers/dri/i965/intel_screen.c
> @@ -1006,6 +1006,17 @@ intel_get_boolean(struct intel_screen *screen, int param)
>     return (intel_get_param(screen, param, &value) == 0) && value;
>  }
>  
> +static int
> +intel_get_integer(struct intel_screen *screen, int param)
> +{
> +   int value = -1;
> +
> +   if (intel_get_param(screen, param, &value) == 0)
> +	   return value;

Indentation is a bit off here (spaces only, 3 space indent).

> +
> +   return -1;
> +}
> +
>  static void
>  intelDestroyScreen(__DRIscreen * sPriv)
>  {
> @@ -1576,6 +1587,27 @@ __DRIconfig **intelInitScreen2(__DRIscreen *psp)
>     if (INTEL_DEBUG & DEBUG_AUB)
>        drm_intel_bufmgr_gem_set_aub_dump(intelScreen->bufmgr, true);
>  
> +#define I915_PARAM_MMAP_GTT_VERSION 40 /* XXX delete me with new libdrm */

Lately some other developers have been getting grumpy about requiring
new libdrm versions not in their distros.  Maybe for now, we should do:

#ifndef I915_PARAM_MMAP_GTT_VERSION
#define I915_PARAM_MMAP_GTT_VERSION 40 /* XXX delete me with new libdrm */
#endif

and we can leave it for a little while.

Thanks for doing this, Chris!
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.freedesktop.org/archives/intel-gfx/attachments/20160825/7769e221/attachment.sig>


More information about the Intel-gfx mailing list