lib/ioctl_wrappers: Add gem_gtt_type exposing raw HAS_ALIASING_PPGTT param

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 to drop some unnecessary code from tests that were
previously calling getparam directly instead of using ioctl wrapper.

v2: drop gem_uses_full_48b_ppgtt since it's no longer used anywhere,
    s/48b/64b (Chris)
v3: rebase

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Michał Winiarski <michal.winiarski@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
Michał Winiarski
2016-01-25 19:35:01 +01:00
committed by Daniel Vetter
parent 0e2071411a
commit 52b5d5016e
12 changed files with 52 additions and 62 deletions
+37 -8
View File
@@ -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 - full ppgtt, limited to 32bit address space
* 3 - full ppgtt, 64bit address space
*
* Returns: Whether batches are run through ppgtt.
* Returns: Type of gtt being used.
*/
bool gem_uses_aliasing_ppgtt(int fd)
int gem_gtt_type(int fd)
{
struct drm_i915_getparam gp;
int val = 0;
@@ -951,6 +951,35 @@ bool gem_uses_aliasing_ppgtt(int fd)
return val;
}
/**
* gem_uses_ppgtt:
* @fd: open i915 drm file descriptor
*
* Feature test macro to check whether the kernel internally uses ppgtt to
* execute batches. Note that this is also true when we're using full ppgtt.
*
* Returns: Whether batches are run through ppgtt.
*/
bool gem_uses_ppgtt(int fd)
{
return gem_gtt_type(fd) > 0;
}
/**
* gem_uses_full_ppgtt:
* @fd: open i915 drm file descriptor
*
* Feature test macro to check whether the kernel internally uses full
* per-process gtt to execute batches. Note that this is also true when we're
* using full 64b ppgtt.
*
* Returns: Whether batches are run through full ppgtt.
*/
bool gem_uses_full_ppgtt(int fd)
{
return gem_gtt_type(fd) > 1;
}
/**
* gem_available_fences:
* @fd: open i915 drm file descriptor
+3 -1
View File
@@ -125,7 +125,9 @@ bool gem_has_bsd(int fd);
bool gem_has_blt(int fd);
bool gem_has_vebox(int fd);
bool gem_has_bsd2(int fd);
bool gem_uses_aliasing_ppgtt(int fd);
int gem_gtt_type(int fd);
bool gem_uses_ppgtt(int fd);
bool gem_uses_full_ppgtt(int fd);
int gem_available_fences(int fd);
uint64_t gem_available_aperture_size(int fd);
uint64_t gem_aperture_size(int fd);