All of lore.kernel.org
 help / color / mirror / Atom feed
From: venkata.sai.patnana@intel.com
To: igt-dev@lists.freedesktop.org
Cc: petri.latvala@intel.com, juha-pekka.heikkila@intel.com
Subject: [igt-dev] [PATCH i-g-t 1/2] lib/kms: Add for_each_pipe_clamped
Date: Tue, 23 Mar 2021 16:23:05 +0530	[thread overview]
Message-ID: <20210323105306.400-1-venkata.sai.patnana@intel.com> (raw)

From: Patnana Venkata Sai <venkata.sai.patnana@intel.com>

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 <uma.shankar@intel.com>
Cc: Juha-Pekka Heikkilä <juha-pekka.heikkila@intel.com>
Cc: Modem Bhanuprakash <bhanuprakash.modem@intel.com>
Cc: Karthik B S <karthik.b.s@intel.com>
Cc: Petri Latvala <petri.latvala@intel.com>
Signed-off-by: Patnana Venkata Sai <venkata.sai.patnana@intel.com>
---
 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) \
+	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

             reply	other threads:[~2021-03-23 11:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-23 10:53 venkata.sai.patnana [this message]
2021-03-23 10:53 ` [igt-dev] [PATCH i-g-t 2/2] tests/kms_plane: Restrict the test execution to two pipes venkata.sai.patnana
2021-03-23 11:32 ` [igt-dev] [PATCH i-g-t 1/2] lib/kms: Add for_each_pipe_clamped Modem, Bhanuprakash
2021-03-23 11:48   ` Petri Latvala
2021-03-29  8:19     ` Patnana, Venkata Sai
2021-03-23 11:42 ` Petri Latvala
2021-03-23 14:34 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/2] " Patchwork
2021-03-24  9:08 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210323105306.400-1-venkata.sai.patnana@intel.com \
    --to=venkata.sai.patnana@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=juha-pekka.heikkila@intel.com \
    --cc=petri.latvala@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.