[2/2] enable syncobj test depending on capability

Submitted by Zhou, David(ChunMing) on May 22, 2019, 9:08 a.m.

Details

Message ID 20190522090800.15908-2-david1.zhou@amd.com
State Accepted
Commit 5db0f7692d1fdf05f9f6c0c02ffa5a5f4379c1f3
Headers show
Series "Series without cover letter" ( rev: 1 ) in DRI devel

Not browsing as part of any series.

Commit Message

Zhou, David(ChunMing) May 22, 2019, 9:08 a.m.
Feature is controlled by DRM_CAP_SYNCOBJ_TIMELINE drm capability.

Signed-off-by: Chunming Zhou <david1.zhou@amd.com>
Reviewed-by: Christian K├Ânig <christian.koenig@amd.com>
---
 tests/amdgpu/syncobj_tests.c | 8 ++++++++
 1 file changed, 8 insertions(+)

Patch hide | download patch | download mbox

diff --git a/tests/amdgpu/syncobj_tests.c b/tests/amdgpu/syncobj_tests.c
index a0c627d7..869ed88e 100644
--- a/tests/amdgpu/syncobj_tests.c
+++ b/tests/amdgpu/syncobj_tests.c
@@ -22,6 +22,7 @@ 
 */
 
 #include "CUnit/Basic.h"
+#include "xf86drm.h"
 
 #include "amdgpu_test.h"
 #include "amdgpu_drm.h"
@@ -36,6 +37,13 @@  static void amdgpu_syncobj_timeline_test(void);
 
 CU_BOOL suite_syncobj_timeline_tests_enable(void)
 {
+	int r;
+	uint64_t cap = 0;
+
+	r = drmGetCap(drm_amdgpu[0], DRM_CAP_SYNCOBJ_TIMELINE, &cap);
+	if (r || cap == 0)
+		return CU_FALSE;
+
 	return CU_TRUE;
 }