Thread (8 messages) 8 messages, 4 authors, 2021-03-29

Re: [igt-dev] [PATCH i-g-t 1/2] lib/kms: Add for_each_pipe_clamped

From: Modem, Bhanuprakash <hidden>
Date: 2021-03-23 11:32:27

quoted hunk ↗ jump to hunk
From: Patnana, Venkata Sai <redacted>
Sent: Tuesday, March 23, 2021 4:23 PM
To: igt-dev@lists.freedesktop.org
Cc: B S, Karthik <redacted>; Heikkila, Juha-pekka <juha-
pekka.heikkila@intel.com>; Shankar, Uma [off-list ref]; Patnana,
Venkata Sai [off-list ref]; Modem, Bhanuprakash
[off-list ref]; Latvala, Petri [off-list ref]
Subject: [PATCH i-g-t 1/2] lib/kms: Add for_each_pipe_clamped

From: Patnana Venkata Sai <redacted>

for_each_pipe and for_each_pipe_static cannot be used for limiting pipe
iteration.
This api will provide limits the pipe iteration

v2: Handle fused pipes (Petri)
    Add a variable pipe count (Bhanu)
v3: change api name as suggested (Petri)

Cc: Uma Shankar <redacted>
Cc: Juha-Pekka Heikkilä <redacted>
Cc: Modem Bhanuprakash <redacted>
Cc: Karthik B S <redacted>
Cc: Petri Latvala <redacted>
Signed-off-by: Patnana Venkata Sai <redacted>
---
 lib/igt_kms.h | 12 ++++++++++++
 1 file changed, 12 insertions(+)
diff --git a/lib/igt_kms.h b/lib/igt_kms.h
index 09b10b3e04..7dbf14483c 100644
--- a/lib/igt_kms.h
+++ b/lib/igt_kms.h
@@ -534,6 +534,18 @@ static inline bool
igt_output_is_connected(igt_output_t *output)
 	for_each_pipe_static(pipe) \
 		for_each_if((display)->pipes[(pipe)].enabled)

+/**
+ * for_each_pipe_clamped:
+ * @display: a pointer to an #igt_display_t structure
+ * @pipe: The pipe to iterate.
+ * @pipe_count: Number of pipes to be iterate
+ *
+ * This for loop iterates based on pipe_count and supported by IGT
libraries,
+ */
+#define for_each_pipe_clamped(display, pipe, pipe_count) \
What about other APIs like "for_each_pipe_with_valid_output" those iterates
over all enabled pipes? Are we planning to implement similar APIs to limit
the execution to few pipes?
+	for_each_pipe_static(pipe) \
+                for_each_if((display)->pipes[(pipe)].enabled) \
+			for_each_if(pipe_count-- > 0)
 /**
  * for_each_pipe_with_valid_output:
  * @display: a pointer to an #igt_display_t structure
--
2.25.1
_______________________________________________
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