kms: Add update test API

This API can be used to construct a MetaKmsUpdate with plane assignments
that in isolation will be tested against the current KMS state. How it
is tested depends on the KMS implementation; in the simple / legacy KMS
backend, the tests are identical to the current scanout requirements
(dimension, stride, format, modifiers, all must match), and with atomic
KMS, it uses the TEST_ONLY on a real constructed atomic mode setting
commit.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2146>
This commit is contained in:
Jonas Ådahl
2021-12-08 21:20:52 +01:00
committed by Marge Bot
parent 4bcd4a6fab
commit a14923e993
6 changed files with 145 additions and 5 deletions

View File

@ -785,6 +785,8 @@ commit_flags_string (uint32_t commit_flags)
commit_flag_strings[i++] = "ATOMIC_ALLOW_MODESET";
if (commit_flags & DRM_MODE_PAGE_FLIP_EVENT)
commit_flag_strings[i++] = "PAGE_FLIP_EVENT";
if (commit_flags & DRM_MODE_ATOMIC_TEST_ONLY)
commit_flag_strings[i++] = "TEST_ONLY";
commit_flags_string = g_strjoinv ("|", (char **) commit_flag_strings);
strncpy (static_commit_flags_string, commit_flags_string,
@ -996,6 +998,9 @@ meta_kms_impl_device_atomic_process_update (MetaKmsImplDevice *impl_device,
if (meta_kms_update_get_page_flip_listeners (update))
commit_flags |= DRM_MODE_PAGE_FLIP_EVENT;
if (flags & META_KMS_UPDATE_FLAG_TEST_ONLY)
commit_flags |= DRM_MODE_ATOMIC_TEST_ONLY;
commit:
meta_topic (META_DEBUG_KMS,
"[atomic] Committing update %" G_GUINT64_FORMAT ", flags: %s",