From 29ae12bd764e3b1876356e7628a32192b4ec9066 Mon Sep 17 00:00:00 2001 From: Ville Syrjälä Date: Wed, 7 Mar 2018 23:33:07 +0200 Subject: tests/kms_properties: Validate properties harder MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Make the property validation more thorough: - validate property flags - make sure there's an expected number of values/enums - make sure the possible values make sense - make sure the current value makes sense - actually iterate through all planes/crtc/connectors to check their properties - make sure encoders don't expose properties while at it - check that atomic props aren't exposed to non-atomic clients Still passes on my ivb. Not tested anything else so far. Signed-off-by: Ville Syrjälä Reviewed-by: Stanislav Lisovskiy --- lib/igt_aux.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/igt_aux.h') diff --git a/lib/igt_aux.h b/lib/igt_aux.h index faddd478..9bb03b77 100644 --- a/lib/igt_aux.h +++ b/lib/igt_aux.h @@ -390,4 +390,6 @@ static inline bool igt_list_empty(const struct igt_list *list) __builtin_popcountll(x), \ __builtin_popcount(x)) +#define is_power_of_two(x) (((x) & ((x)-1)) == 0) + #endif /* IGT_AUX_H */ -- cgit v1.2.3