From 5cbcf1c94f8ea96280f5ee8c1e92b926158dcf86 Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Mon, 9 Oct 2023 11:10:05 +0400 Subject: [PATCH] meta/kms-impl: Emit trace message on page flips It's sometimes useful to see the earliest point when the compositor became aware of a page flip. Part-of: --- src/backends/native/meta-kms-impl-device-atomic.c | 4 ++++ src/backends/native/meta-kms-impl-device-simple.c | 9 +++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/backends/native/meta-kms-impl-device-atomic.c b/src/backends/native/meta-kms-impl-device-atomic.c index 9a63ce196..3d361463e 100644 --- a/src/backends/native/meta-kms-impl-device-atomic.c +++ b/src/backends/native/meta-kms-impl-device-atomic.c @@ -840,6 +840,10 @@ atomic_page_flip_handler (int fd, NULL, (gpointer *) &page_flip_data); + COGL_TRACE_MESSAGE ("atomic_page_flip_handler()", + "[atomic] Page flip callback for CRTC (%u, %s)", + crtc_id, meta_kms_impl_device_get_path (impl_device)); + meta_topic (META_DEBUG_KMS, "[atomic] Page flip callback for CRTC (%u, %s), data: %p", crtc_id, meta_kms_impl_device_get_path (impl_device), diff --git a/src/backends/native/meta-kms-impl-device-simple.c b/src/backends/native/meta-kms-impl-device-simple.c index fd4bfcfa6..ff452f847 100644 --- a/src/backends/native/meta-kms-impl-device-simple.c +++ b/src/backends/native/meta-kms-impl-device-simple.c @@ -1394,6 +1394,7 @@ page_flip_handler (int fd, MetaKmsImplDevice *impl_device; MetaKmsImplDeviceSimple *impl_device_simple; MetaKmsCrtc *crtc; + uint32_t crtc_id; meta_kms_page_flip_data_set_timings_in_impl (page_flip_data, sequence, tv_sec, tv_usec); @@ -1401,12 +1402,16 @@ page_flip_handler (int fd, impl_device = meta_kms_page_flip_data_get_impl_device (page_flip_data); impl_device_simple = META_KMS_IMPL_DEVICE_SIMPLE (impl_device); crtc = meta_kms_page_flip_data_get_crtc (page_flip_data); + crtc_id = meta_kms_crtc_get_id (crtc); + + COGL_TRACE_MESSAGE ("page_flip_handler()", + "[simple] Page flip callback for CRTC (%u, %s)", + crtc_id, meta_kms_impl_device_get_path (impl_device)); meta_topic (META_DEBUG_KMS, "[simple] Handling page flip callback from %s, data: %p, CRTC: %u", meta_kms_impl_device_get_path (impl_device), - page_flip_data, - meta_kms_crtc_get_id (crtc)); + page_flip_data, crtc_id); meta_kms_impl_device_unhold_fd (impl_device);