[Intel-gfx] [RFC 02/44] drm/i915: Added getparam for native sync

John.C.Harrison at Intel.com John.C.Harrison at Intel.com
Thu Jun 26 19:23:53 CEST 2014


From: John Harrison <John.C.Harrison at Intel.com>

Validation tests need a run time mechanism for querying whether or not the
driver supports the Android native sync facility.
---
 drivers/gpu/drm/i915/i915_dma.c |    7 +++++++
 include/uapi/drm/i915_drm.h     |    1 +
 2 files changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
index 6cce55b..67f2918 100644
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
@@ -1022,6 +1022,13 @@ static int i915_getparam(struct drm_device *dev, void *data,
 	case I915_PARAM_CMD_PARSER_VERSION:
 		value = i915_cmd_parser_get_version();
 		break;
+	case I915_PARAM_HAS_NATIVE_SYNC:
+#ifdef CONFIG_DRM_I915_SYNC
+		value = 1;
+#else
+		value = 0;
+#endif
+		break;
 	default:
 		DRM_DEBUG("Unknown parameter %d\n", param->param);
 		return -EINVAL;
diff --git a/include/uapi/drm/i915_drm.h b/include/uapi/drm/i915_drm.h
index ff57f07..bf54c78 100644
--- a/include/uapi/drm/i915_drm.h
+++ b/include/uapi/drm/i915_drm.h
@@ -340,6 +340,7 @@ typedef struct drm_i915_irq_wait {
 #define I915_PARAM_HAS_EXEC_HANDLE_LUT   26
 #define I915_PARAM_HAS_WT     	 	 27
 #define I915_PARAM_CMD_PARSER_VERSION	 28
+#define I915_PARAM_HAS_NATIVE_SYNC	 30
 
 typedef struct drm_i915_getparam {
 	int param;
-- 
1.7.9.5




More information about the Intel-gfx mailing list