From 720f3632419a54daab06ea2a75faaa3dd3023398 Mon Sep 17 00:00:00 2001 From: Pekka Paalanen Date: Tue, 11 Jun 2019 11:16:39 +0300 Subject: [PATCH] renderer/native: Add tracing for 2nd GPU copies These traces allow seeing how long the copy operations stall in libmutter, and which copy operations actually get used. https://gitlab.gnome.org/GNOME/mutter/merge_requests/615 --- src/backends/native/meta-renderer-native.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/backends/native/meta-renderer-native.c b/src/backends/native/meta-renderer-native.c index 5aa3af472..d2aba0ce9 100644 --- a/src/backends/native/meta-renderer-native.c +++ b/src/backends/native/meta-renderer-native.c @@ -70,6 +70,7 @@ #include "backends/native/meta-renderer-native.h" #include "cogl/cogl.h" #include "cogl/cogl-framebuffer.h" +#include "cogl/cogl-trace.h" #include "core/boxes-private.h" #ifndef EGL_DRM_MASTER_FD_EXT @@ -1773,6 +1774,9 @@ copy_shared_framebuffer_gpu (CoglOnscreen *onscreen, MetaDrmBufferGbm *buffer_gbm; struct gbm_bo *bo; + COGL_TRACE_BEGIN_SCOPED (CopySharedFramebufferSecondaryGpu, + "FB Copy (secondary GPU)"); + if (!meta_egl_make_current (egl, renderer_gpu_data->egl_display, secondary_gpu_state->egl_surface, @@ -1867,6 +1871,9 @@ copy_shared_framebuffer_primary_gpu (CoglOnscreen *onscre CoglOffscreen *cogl_fbo; int ret; + COGL_TRACE_BEGIN_SCOPED (CopySharedFramebufferPrimaryGpu, + "FB Copy (primary GPU)"); + primary_gpu_data = meta_renderer_native_get_gpu_data (renderer_native, renderer_native->primary_gpu_kms); if (!primary_gpu_data->secondary.has_EGL_EXT_image_dma_buf_import_modifiers) @@ -2030,6 +2037,9 @@ copy_shared_framebuffer_cpu (CoglOnscreen *onscreen, gboolean ret; MetaDrmBufferDumb *buffer_dumb; + COGL_TRACE_BEGIN_SCOPED (CopySharedFramebufferCpu, + "FB Copy (CPU)"); + dumb_fb = secondary_gpu_get_next_dumb_buffer (secondary_gpu_state); g_assert (cogl_framebuffer_get_width (framebuffer) == dumb_fb->width);