igt-dev.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t v2 1/2] tests/kms_properties: Add additional prperty test infrastructure
@ 2018-10-12  7:18 Radhakrishna Sripada
  2018-10-12  7:18 ` [igt-dev] [PATCH i-g-t v2 2/2] tests/kms_properties: Add functional test for "max bpc" property Radhakrishna Sripada
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Radhakrishna Sripada @ 2018-10-12  7:18 UTC (permalink / raw)
  To: igt-dev

We currently test the existimg properties by setting them with default value.
Add infrastructure to perform additional test on a desired property.

v2: Fix the strcmp logic

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Radhakrishna Sripada <radhakrishna.sripada@intel.com>
---
 tests/kms_properties.c | 28 +++++++++++++++++++++++++++-
 1 file changed, 27 insertions(+), 1 deletion(-)

diff --git a/tests/kms_properties.c b/tests/kms_properties.c
index 9548cf44017a..f5a86236f5c8 100644
--- a/tests/kms_properties.c
+++ b/tests/kms_properties.c
@@ -29,6 +29,13 @@
 #include <string.h>
 #include <time.h>
 
+struct additional_test {
+	char *name;
+	uint32_t obj_type;
+	void (*prop_test)(int fd, uint32_t id, uint32_t type, drmModePropertyPtr prop,
+			  uint32_t prop_id, uint64_t prop_value, bool atomic);
+};
+
 static void prepare_pipe(igt_display_t *display, enum pipe pipe, igt_output_t *output, struct igt_fb *fb)
 {
 	drmModeModeInfo *mode = igt_output_get_mode(output);
@@ -75,11 +82,27 @@ static bool ignore_property(uint32_t obj_type, uint32_t prop_flags,
 	return false;
 }
 
+static const struct additional_test property_functional_test[] = {};
+
+static bool has_additional_test_lookup(uint32_t obj_type, const char *name,
+				bool atomic, int *index)
+{
+	int i;
+
+	for (i = 0; i < ARRAY_SIZE(property_functional_test); i++)
+		if (property_functional_test[i].obj_type == obj_type &&
+		    !strcmp(name, property_functional_test[i].name)) {
+			*index = i;
+			return true;
+		}
+
+	return false;
+}
 static void test_properties(int fd, uint32_t type, uint32_t id, bool atomic)
 {
 	drmModeObjectPropertiesPtr props =
 		drmModeObjectGetProperties(fd, id, type);
-	int i, ret;
+	int i, j, ret;
 	drmModeAtomicReqPtr req = NULL;
 
 	igt_assert(props);
@@ -114,6 +137,9 @@ static void test_properties(int fd, uint32_t type, uint32_t id, bool atomic)
 			igt_assert_eq(ret, 0);
 		}
 
+		if (has_additional_test_lookup(type, prop->name, atomic, &j))
+			property_functional_test[j].prop_test(fd, id, type, prop, prop_id, prop_value, atomic);
+
 		drmModeFreeProperty(prop);
 	}
 
-- 
2.9.3

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2018-11-02 16:17 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-10-12  7:18 [igt-dev] [PATCH i-g-t v2 1/2] tests/kms_properties: Add additional prperty test infrastructure Radhakrishna Sripada
2018-10-12  7:18 ` [igt-dev] [PATCH i-g-t v2 2/2] tests/kms_properties: Add functional test for "max bpc" property Radhakrishna Sripada
2018-10-24 22:45   ` Rodrigo Vivi
2018-10-29 11:23     ` Radhakrishna Sripada
2018-10-31 19:41       ` Rodrigo Vivi
2018-11-02  9:32         ` Daniel Vetter
2018-11-02 16:17           ` Rodrigo Vivi
2018-10-12  8:21 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,v2,1/2] tests/kms_properties: Add additional prperty test infrastructure Patchwork
2018-10-12  9:43 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).