All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH libdrm] enable syncobj test depending on capability
@ 2019-05-16 10:46 Chunming Zhou
  2019-05-16 10:51 ` Koenig, Christian
  0 siblings, 1 reply; 9+ messages in thread
From: Chunming Zhou @ 2019-05-16 10:46 UTC (permalink / raw)
  To: Christian.Koenig, dri-devel

Feature is controlled by DRM_CAP_SYNCOBJ_TIMELINE drm capability.

Signed-off-by: Chunming Zhou <david1.zhou@amd.com>
---
 include/drm/drm.h            | 1 +
 tests/amdgpu/syncobj_tests.c | 8 ++++++++
 2 files changed, 9 insertions(+)

diff --git a/include/drm/drm.h b/include/drm/drm.h
index c893f3b4..532787bf 100644
--- a/include/drm/drm.h
+++ b/include/drm/drm.h
@@ -643,6 +643,7 @@ struct drm_gem_open {
 #define DRM_CAP_PAGE_FLIP_TARGET	0x11
 #define DRM_CAP_CRTC_IN_VBLANK_EVENT	0x12
 #define DRM_CAP_SYNCOBJ		0x13
+#define DRM_CAP_SYNCOBJ_TIMELINE	0x14
 
 /** DRM_IOCTL_GET_CAP ioctl argument type */
 struct drm_get_cap {
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;
 }
 
-- 
2.17.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2019-05-17 14:28 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-16 10:46 [PATCH libdrm] enable syncobj test depending on capability Chunming Zhou
2019-05-16 10:51 ` Koenig, Christian
2019-05-16 11:03   ` Zhou, David(ChunMing)
2019-05-17  9:47     ` [PATCH " zhoucm1
2019-05-17  9:55       ` Michel Dänzer
2019-05-17 12:13         ` Koenig, Christian
2019-05-17 12:28           ` Zhou, David(ChunMing)
2019-05-17 13:43             ` [PATCH " Koenig, Christian
2019-05-17 14:28               ` Michel Dänzer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.