[Intel-gfx] [PATCH i-g-t 1/2] lib/ioctl_wrappers: Add gem_gtt_type exposing raw HAS_ALIASING_PPGTT param

Chris Wilson chris at chris-wilson.co.uk
Wed Jan 20 13:20:21 PST 2016


On Wed, Jan 20, 2016 at 06:48:25PM +0100, Michał Winiarski wrote:
> No functional changes.
> While I'm here, let's also rename gem_uses_aliasing_ppgtt (since it's
> being used to indicate if we are using ANY kind of ppgtt) and introduce
> gem_uses_full_ppgtt and gem_uses_full_48b_ppgtt to drop some unnecessary
> code from tests that were previously calling getparam directly instead
> of using ioctl wrapper.
> 
> Signed-off-by: Michał Winiarski <michal.winiarski at intel.com>
> ---
>  lib/ioctl_wrappers.c             | 59 ++++++++++++++++++++++++++++++++++------
>  lib/ioctl_wrappers.h             |  5 +++-
>  tests/drv_hangman.c              |  2 +-
>  tests/gem_bad_reloc.c            | 11 +-------
>  tests/gem_ctx_thrash.c           | 20 ++------------
>  tests/gem_exec_parse.c           |  2 +-
>  tests/gem_ppgtt.c                | 20 ++------------
>  tests/gem_storedw_batches_loop.c |  2 +-
>  tests/gem_storedw_loop.c         |  2 +-
>  tests/pm_rps.c                   |  2 +-
>  tests/pm_sseu.c                  |  2 +-
>  11 files changed, 66 insertions(+), 61 deletions(-)
> 
> diff --git a/lib/ioctl_wrappers.c b/lib/ioctl_wrappers.c
> index 0024898..6099657 100644
> --- a/lib/ioctl_wrappers.c
> +++ b/lib/ioctl_wrappers.c
> @@ -924,18 +924,18 @@ bool gem_bo_busy(int fd, uint32_t handle)
>  /* feature test helpers */
>  
>  /**
> - * gem_uses_aliasing_ppgtt:
> + * gem_gtt_type:
>   * @fd: open i915 drm file descriptor
>   *
> - * Feature test macro to check whether the kernel internally uses ppgtt to
> - * execute batches. The /aliasing/ in the function name is a bit a misnomer,
> - * this driver parameter is also true when full ppgtt address spaces are
> - * available since for batchbuffer construction only ppgtt or global gtt is
> - * relevant.
> + * Feature test macro to check what type of gtt is being used by the kernel:
> + * 0 - global gtt
> + * 1 - aliasing ppgtt
> + * 2 - 32bit ppgtt

2 - full ppgtt, limited to 32bit address space

> + * 3 - 48bit ppgtt

s/48bit/64bit ppgtt/ future proofing extraordinaire.

3 - full ppgtt, unlimited (64bit!) address space

In terms of the param APIs, we don't want to encode the address space
into them (and I think/hope we have suceeded in avoiding that in the
kernel uABI). Looking at the API we have now, we don't strictly need
ppgtt==3 in the param interface (but it remains useful as a mapping from
i915.enable_ppgtt).
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the Intel-gfx mailing list