[PATCH i-g-t] test/kms_properties.c: fix connector-properties
Bhawanpreet Lakha
Bhawanpreet.Lakha at amd.com
Tue Jun 20 18:27:38 UTC 2017
The test doesn't consider immutable properties
Legacy Test: The test trys to set the property, but if the property
is immutable the test fails.
Added conditions to check if the property is immutable.
Atomic Test: The immutable properties are added and fails on commit.
Added condition to skip 'add property' if the property
is immutable. This insures that the commit will not fail.
Skipping the add property is the only way, because otherwise
the the actual commit will always fail if there is atleast
one immutable property.
Signed-off-by: Bhawanpreet Lakha <Bhawanpreet.Lakha at amd.com>
---
tests/kms_properties.c | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/tests/kms_properties.c b/tests/kms_properties.c
index c15026b8..aa1af767 100644
--- a/tests/kms_properties.c
+++ b/tests/kms_properties.c
@@ -138,13 +138,19 @@ static void test_properties(int fd, uint32_t type, uint32_t id, bool atomic)
if (!atomic) {
ret = drmModeObjectSetProperty(fd, id, type, prop_id, prop_value);
- igt_assert_eq(ret, 0);
+ if (!(prop->flags & DRM_MODE_PROP_IMMUTABLE))
+ igt_assert_eq(ret, 0);
+ else
+ igt_assert(ret != 0);
+
} else {
- ret = drmModeAtomicAddProperty(req, id, prop_id, prop_value);
- igt_assert(ret >= 0);
+ if (!(prop->flags & DRM_MODE_PROP_IMMUTABLE)) {
+ ret = drmModeAtomicAddProperty(req, id, prop_id, prop_value);
+ igt_assert(ret >= 0);
- ret = drmModeAtomicCommit(fd, req, DRM_MODE_ATOMIC_TEST_ONLY, NULL);
- igt_assert_eq(ret, 0);
+ ret = drmModeAtomicCommit(fd, req, DRM_MODE_ATOMIC_TEST_ONLY, NULL);
+ igt_assert_eq(ret, 0);
+ }
}
drmModeFreeProperty(prop);
--
2.11.0
More information about the amd-gfx
mailing list