diff options
author | Daniel Stone <daniels@collabora.com> | 2017-08-04 14:37:24 +0100 |
---|---|---|
committer | Daniel Stone <daniels@collabora.com> | 2017-08-04 14:49:35 +0100 |
commit | 8d28ea33c7bf6c13c2add165398d6f2274bb254d (patch) | |
tree | 992c396eb398351587b96535acc426bacdd1fdab /tests | |
parent | a9d9354de50e7ae4a49da14925116031f8540d37 (diff) |
tests/kms_properties: Don't set immutable properties
If the kernel tells us it's immutable, trying to set it probably isn't
going to succeed. There was previously a hard-coded list of immutable
properties, keyed by name, but we can just test the flag instead, which
is more future-proof.
Fixes a failure seen with the IN_FORMATS property.
v2: Remove the entire list apart from DPMS, replacing it with a test for
immutable.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: Ben Widawsky <ben@bwidawsk.net>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/kms_properties.c | 50 |
1 files changed, 11 insertions, 39 deletions
diff --git a/tests/kms_properties.c b/tests/kms_properties.c index 276c07be..544a8009 100644 --- a/tests/kms_properties.c +++ b/tests/kms_properties.c @@ -57,50 +57,22 @@ static void cleanup_pipe(igt_display_t *display, enum pipe pipe, igt_output_t *o igt_remove_fb(display->drm_fd, fb); } -static bool ignore_crtc_property(const char *name, bool atomic) +static bool ignore_property(uint32_t obj_type, uint32_t prop_flags, + const char *name, bool atomic) { - if (!strcmp(name, "GAMMA_LUT_SIZE")) + if (prop_flags & DRM_MODE_PROP_IMMUTABLE) return true; - if (!strcmp(name, "DEGAMMA_LUT_SIZE")) - return true; - - return false; -} -static bool ignore_connector_property(const char *name, bool atomic) -{ - if (!strcmp(name, "EDID") || - !strcmp(name, "PATH") || - !strcmp(name, "TILE")) - return true; - - if (atomic && !strcmp(name, "DPMS")) - return true; - - return false; -} - -static bool ignore_plane_property(const char *name, bool atomic) -{ - if (!strcmp(name, "type")) - return true; - - return false; -} - -static bool ignore_property(uint32_t type, const char *name, bool atomic) -{ - switch (type) { - case DRM_MODE_OBJECT_CRTC: - return ignore_crtc_property(name, atomic); + switch (obj_type) { case DRM_MODE_OBJECT_CONNECTOR: - return ignore_connector_property(name, atomic); - case DRM_MODE_OBJECT_PLANE: - return ignore_plane_property(name, atomic); + if (atomic && !strcmp(name, "DPMS")) + return true; + break; default: - igt_assert(0); - return false; + break; } + + return false; } static void test_properties(int fd, uint32_t type, uint32_t id, bool atomic) @@ -122,7 +94,7 @@ static void test_properties(int fd, uint32_t type, uint32_t id, bool atomic) igt_assert(prop); - if (ignore_property(type, prop->name, atomic)) { + if (ignore_property(type, prop->flags, prop->name, atomic)) { igt_debug("Ignoring property \"%s\"\n", prop->name); continue; |