[i-g-t,1/3] lib: check whether kernel has dual bsd ring
diff mbox

Message ID 1417571563-16004-2-git-send-email-zhipeng.gong@intel.com
State New, archived
Headers show

Commit Message

Zhipeng Gong Dec. 3, 2014, 1:52 a.m. UTC
Signed-off-by: Zhipeng Gong <zhipeng.gong@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Tested-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
---
 lib/ioctl_wrappers.c | 16 ++++++++++++++++
 lib/ioctl_wrappers.h |  1 +
 2 files changed, 17 insertions(+)

Patch
diff mbox

diff --git a/lib/ioctl_wrappers.c b/lib/ioctl_wrappers.c
index 56280b6..ad746e9 100644
--- a/lib/ioctl_wrappers.c
+++ b/lib/ioctl_wrappers.c
@@ -771,6 +771,22 @@  bool gem_has_vebox(int fd)
 	return gem_has_enable_ring(fd,LOCAL_I915_PARAM_HAS_VEBOX);
 }
 
+#define LOCAL_I915_PARAM_HAS_BSD2 30
+/**
+ * gem_has_bsd2:
+ * @fd: open i915 drm file descriptor
+ *
+ * Feature test macro to query whether the BSD2 ring is available. This is simply
+ * a specific version of gem_has_enable_ring() for the BSD2 ring.
+ *
+ * Note that recent Bspec calls this the VCS ring for Video Command Submission.
+ *
+ * Returns: Whether the BSD ring is avaible or not.
+ */
+bool gem_has_bsd2(int fd)
+{
+	return gem_has_enable_ring(fd,LOCAL_I915_PARAM_HAS_BSD2);
+}
 /**
  * gem_available_aperture_size:
  * @fd: open i915 drm file descriptor
diff --git a/lib/ioctl_wrappers.h b/lib/ioctl_wrappers.h
index d13408c..46b5c45 100644
--- a/lib/ioctl_wrappers.h
+++ b/lib/ioctl_wrappers.h
@@ -84,6 +84,7 @@  bool gem_has_enable_ring(int fd,int param);
 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_available_fences(int fd);
 uint64_t gem_available_aperture_size(int fd);