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
This commit is contained in:
Pekka Paalanen 2019-06-11 11:16:39 +03:00 committed by Jonas Ådahl
parent 3794df608c
commit 720f363241

View File

@ -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);