[PATCH i-g-t 8/8] lib/kms: Turn igt_pipe_connector_valid() into a function

Ville Syrjala
2026-01-13T12:05:14Z

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

There is no need for igt_pipe_connector_valid() to be a macro,
just make it a function. This gets us type safety, and will
help us do more changes later using coccinelle.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
lib/igt_kms.h | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/lib/igt_kms.h b/lib/igt_kms.h
index e1044101707c..a271c94a97fd 100644
--- a/lib/igt_kms.h
+++ b/lib/igt_kms.h
@@ -669,9 +669,11 @@ static inline bool igt_output_is_connected(igt_output_t *output)
*
* Checks whether the given pipe and output can be used together.
*/
-#define igt_pipe_connector_valid(pipe, output) \
- (igt_output_is_connected((output)) && \
- (output->config.valid_crtc_idx_mask & (1 << (pipe))))
+static inline bool igt_pipe_connector_valid(enum pipe pipe, igt_output_t *output)
+{
+ return igt_output_is_connected(output) &&
+ output->config.valid_crtc_idx_mask & (1 << (pipe));
+}

#define for_each_if(condition) if (!(condition)) {} else

--
2.51.2