diff mbox

[1/3] lib/drmtest: Add a new test helper to check for Full PPGTT usage

Message ID 1386668183-19514-1-git-send-email-oscar.mateo@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

oscar.mateo@intel.com Dec. 10, 2013, 9:36 a.m. UTC
From: Oscar Mateo <oscar.mateo@intel.com>

Signed-off-by: Oscar Mateo <oscar.mateo@intel.com>
---
 lib/drmtest.c |   14 ++++++++++++++
 lib/drmtest.h |    1 +
 2 files changed, 15 insertions(+)
diff mbox

Patch

diff --git a/lib/drmtest.c b/lib/drmtest.c
index f2624a1..c2483ee 100644
--- a/lib/drmtest.c
+++ b/lib/drmtest.c
@@ -87,6 +87,20 @@  is_intel(int fd)
 	return IS_INTEL(devid);
 }
 
+bool gem_uses_full_ppgtt(int fd)
+{
+	struct drm_i915_getparam gp;
+	int val;
+
+	gp.param = 28; /* HAS_FULL_PPGTT */
+	gp.value = &val;
+
+	if (ioctl(fd, DRM_IOCTL_I915_GETPARAM, &gp, sizeof(gp)))
+		return 0;
+
+	return val;
+}
+
 bool gem_uses_aliasing_ppgtt(int fd)
 {
 	struct drm_i915_getparam gp;
diff --git a/lib/drmtest.h b/lib/drmtest.h
index 20e2620..61769e2 100644
--- a/lib/drmtest.h
+++ b/lib/drmtest.h
@@ -91,6 +91,7 @@  void gem_sw_finish(int fd, uint32_t handle);
 bool gem_bo_busy(int fd, uint32_t handle);
 
 /* feature test helpers */
+bool gem_uses_full_ppgtt(int fd);
 bool gem_uses_aliasing_ppgtt(int fd);
 int gem_available_fences(int fd);