* [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
* Re: [Intel-gfx] [PATCH i-g-t] test/kms_properties.c: fix connector-properties
[not found] ` <20170620182738.22255-1-Bhawanpreet.Lakha-5C7GfCeVMHo@public.gmane.org>
@ 2017-06-20 19:03 ` Ville Syrjälä
[not found] ` <20170620190344.GX12629-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Ville Syrjälä @ 2017-06-20 19:03 UTC (permalink / raw)
To: Bhawanpreet Lakha
Cc: intel-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
harry.wentland-5C7GfCeVMHo,
amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
On Tue, Jun 20, 2017 at 02:27:38PM -0400, Bhawanpreet Lakha wrote:
> 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.
Might be a good idea to have a test that tries to set immutable
properties via atomic as well.
>
> 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
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Ville Syrjälä
Intel OTC
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Intel-gfx] [PATCH i-g-t] test/kms_properties.c: fix connector-properties
[not found] ` <20170620190344.GX12629-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
@ 2017-06-20 19:40 ` Harry Wentland
0 siblings, 0 replies; 3+ messages in thread
From: Harry Wentland @ 2017-06-20 19:40 UTC (permalink / raw)
To: Ville Syrjälä, Bhawanpreet Lakha
Cc: intel-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
On 2017-06-20 03:03 PM, Ville Syrjälä wrote:
> On Tue, Jun 20, 2017 at 02:27:38PM -0400, Bhawanpreet Lakha wrote:
>> 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.
>
> Might be a good idea to have a test that tries to set immutable
> properties via atomic as well.
>
True, but it might make sense to do that as a separate change as I don't
see a way to keep that within a couple of lines and would rather keep
this commit simpler.
Harry
>>
>> 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
>>
>> _______________________________________________
>> Intel-gfx mailing list
>> Intel-gfx@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
>
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [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.