diff options
author | Radhakrishna Sripada <radhakrishna.sripada@intel.com> | 2018-10-12 00:18:46 -0700 |
---|---|---|
committer | Rodrigo Vivi <rodrigo.vivi@intel.com> | 2018-11-02 09:14:18 -0700 |
commit | 7983e19ed62ec8db1884f55e07e458a62cc51e37 (patch) | |
tree | 96c134b47abdd0adcbd222fcd1878308a8c43a67 | |
parent | d39c1b14ebd577b21ad551e3af477f53f1f4e701 (diff) |
tests/kms_properties: Add functional test for "max bpc" property
Test the values in the range advertised by the "max bpc" property.
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Radhakrishna Sripada <radhakrishna.sripada@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
-rw-r--r-- | tests/kms_properties.c | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/tests/kms_properties.c b/tests/kms_properties.c index f5a86236..503a5c25 100644 --- a/tests/kms_properties.c +++ b/tests/kms_properties.c @@ -82,7 +82,37 @@ static bool ignore_property(uint32_t obj_type, uint32_t prop_flags, return false; } -static const struct additional_test property_functional_test[] = {}; +static void max_bpc_prop_test(int fd, uint32_t id, uint32_t type, drmModePropertyPtr prop, + uint32_t prop_id, uint64_t prop_value, bool atomic) +{ + drmModeAtomicReqPtr req = NULL; + int i, ret; + + if (atomic) + req = drmModeAtomicAlloc(); + + for ( i = prop->values[0]; i < prop->values[1] ; i++) { + if (!atomic) { + ret = drmModeObjectSetProperty(fd, id, type, prop_id, i); + + igt_assert_eq(ret, 0); + } else { + ret = drmModeAtomicAddProperty(req, id, prop_id, i); + igt_assert(ret >= 0); + + ret = drmModeAtomicCommit(fd, req, DRM_MODE_ATOMIC_TEST_ONLY, NULL); + igt_assert_eq(ret, 0); + } + } + + if (atomic) + drmModeAtomicFree(req); +} + +static const struct additional_test property_functional_test[] = { + {"max bpc", DRM_MODE_OBJECT_CONNECTOR, + max_bpc_prop_test}, + }; static bool has_additional_test_lookup(uint32_t obj_type, const char *name, bool atomic, int *index) |