[igt-dev] [PATCH i-g-t 01/16] lib/kms: Add igt_rotation_90_or_270()

Ville Syrjala ville.syrjala at linux.intel.com
Fri Jul 16 14:44:27 UTC 2021


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

Add a helper to simplify the 90/270 vs. 0/180 rotation checks.

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

diff --git a/lib/igt_kms.h b/lib/igt_kms.h
index 8cde24b7911f..45d21e42503e 100644
--- a/lib/igt_kms.h
+++ b/lib/igt_kms.h
@@ -329,6 +329,11 @@ typedef enum {
 #define IGT_ROTATION_MASK \
 	(IGT_ROTATION_0 | IGT_ROTATION_90 | IGT_ROTATION_180 | IGT_ROTATION_270)
 
+static inline bool igt_rotation_90_or_270(igt_rotation_t rotation)
+{
+	return rotation & (IGT_ROTATION_90 | IGT_ROTATION_270);
+}
+
 typedef struct igt_plane {
 	/*< private >*/
 	igt_pipe_t *pipe;
-- 
2.31.1



More information about the igt-dev mailing list