Thread (116 messages) 116 messages, 5 authors, 2021-06-14

Re: [igt-dev] [PATCH i-g-t 15/93] lib/dummyload: Better document igt_spin_factory

From: Zbigniew Kempczyński <hidden>
Date: 2021-06-09 06:24:38

On Tue, Jun 08, 2021 at 11:30:01PM -0500, Jason Ekstrand wrote:
quoted hunk ↗ jump to hunk
Signed-off-by: Jason Ekstrand <redacted>
---
 lib/igt_dummyload.h | 22 ++++++++++++++++------
 1 file changed, 16 insertions(+), 6 deletions(-)
diff --git a/lib/igt_dummyload.h b/lib/igt_dummyload.h
index a75fcdeb..f3d7c128 100644
--- a/lib/igt_dummyload.h
+++ b/lib/igt_dummyload.h
@@ -59,13 +59,23 @@ typedef struct igt_spin {
 #define SPIN_CLFLUSH (1 << 0)
 } igt_spin_t;
 
-struct igt_spin_factory {
+/**
+ * igt_spin_factory_t:
+ * @ctx: GEM context handle
+ * @dependency: GEM object to depend on
+ * @engine: Flags describing the engine to execute on
+ * @flags: Set of IGT_SPIN_* flags
+ * @fence: In-fence to wait on
+ *
+ * A factory struct which contains creation parameters for an igt_spin_t.
+ */
+typedef struct igt_spin_factory {
 	uint32_t ctx;
 	uint32_t dependency;
 	unsigned int engine;
 	unsigned int flags;
 	int fence;
-};
+} igt_spin_factory_t;
 
 #define IGT_SPIN_FENCE_IN      (1 << 0)
 #define IGT_SPIN_FENCE_SUBMIT  (1 << 1)
@@ -78,14 +88,14 @@ struct igt_spin_factory {
 #define IGT_SPIN_SOFTDEP       (1 << 8)
 
 igt_spin_t *
-__igt_spin_factory(int fd, const struct igt_spin_factory *opts);
+__igt_spin_factory(int fd, const igt_spin_factory_t *opts);
 igt_spin_t *
-igt_spin_factory(int fd, const struct igt_spin_factory *opts);
+igt_spin_factory(int fd, const igt_spin_factory_t *opts);
 
 #define __igt_spin_new(fd, ...) \
-	__igt_spin_factory(fd, &((struct igt_spin_factory){__VA_ARGS__}))
+	__igt_spin_factory(fd, &((igt_spin_factory_t){__VA_ARGS__}))
 #define igt_spin_new(fd, ...) \
-	igt_spin_factory(fd, &((struct igt_spin_factory){__VA_ARGS__}))
+	igt_spin_factory(fd, &((igt_spin_factory_t){__VA_ARGS__}))
 
 void igt_spin_set_timeout(igt_spin_t *spin, int64_t ns);
 void igt_spin_reset(igt_spin_t *spin);
Ok, just typedef + doc.

Reviewed-by: Zbigniew Kempczyński <redacted>

--
Zbigniew

-- 
2.31.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help