All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH i-g-t] test/kms_properties.c: fix connector-properties
@ 2017-06-20 18:27 Bhawanpreet Lakha
       [not found] ` <20170620182738.22255-1-Bhawanpreet.Lakha-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Bhawanpreet Lakha @ 2017-06-20 18:27 UTC (permalink / raw)
  To: intel-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	harry.wentland-5C7GfCeVMHo, bhawanpreet.lakha-5C7GfCeVMHo
  Cc: Bhawanpreet Lakha

    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@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

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

end of thread, other threads:[~2017-06-20 19:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-20 18:27 [PATCH i-g-t] test/kms_properties.c: fix connector-properties Bhawanpreet Lakha
     [not found] ` <20170620182738.22255-1-Bhawanpreet.Lakha-5C7GfCeVMHo@public.gmane.org>
2017-06-20 19:03   ` [Intel-gfx] " Ville Syrjälä
     [not found]     ` <20170620190344.GX12629-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2017-06-20 19:40       ` Harry Wentland

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.