[Intel-gfx] [PATCH i-g-t] test/kms_properties.c: fix connector-properties

Harry Wentland harry.wentland at amd.com
Tue Jun 20 19:40:52 UTC 2017


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 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
>>
>> _______________________________________________
>> Intel-gfx mailing list
>> Intel-gfx at lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
> 


More information about the Intel-gfx mailing list