Skip to contentSkip to conversation

tests/kms_properties: Don't set immutable properties

PATCH In review Daniel Stone 2 participants 2 messages Aug 4, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tests/kms_properties: Don't set immutable properties

If the kernel tells us it's immutable, trying to set it probably isn't going to succeed.

Fixes a failure seen with the IN_FORMATS property.

Cc Daniel Vetter <[email protected]>
Cc Ben Widawsky <[email protected]>
---
 tests/kms_properties.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
tests/kms_properties.c +7 -3
index 276c07be..23d8a89f 100644
@@ -88,9 +88,13 @@ static bool ignore_plane_property(const char *name, bool atomic)
 	return false;
 }
 
-static bool ignore_property(uint32_t type, const char *name, bool atomic)
+static bool ignore_property(uint32_t obj_type, uint32_t prop_flags,
+			    const char *name, bool atomic)
 {
-	switch (type) {
+	if (prop_flags & DRM_MODE_PROP_IMMUTABLE)
+		return true;
+
+	switch (obj_type) {
 	case DRM_MODE_OBJECT_CRTC:
 		return ignore_crtc_property(name, atomic);
 	case DRM_MODE_OBJECT_CONNECTOR:
@@ -122,7 +126,7 @@ static void test_properties(int fd, uint32_t type, uint32_t id, bool atomic)
 
 		igt_assert(prop);
 
-		if (ignore_property(type, prop->name, atomic)) {
+		if (ignore_property(type, prop->flags, prop->name, atomic)) {
 			igt_debug("Ignoring property \"%s\"\n", prop->name);
 
 			continue;
Signature · 6 lines
2.13.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx