backends/native: Get rendering and swap timings during scanout

Scanout doesn't go through the usual path of compositing and doing
eglSwapBuffers, therefore it doesn't hit the timestamp query placed in
that path. Instead, get the timings by binding the scanout buffer to an
FBO and doing a timestamp query on the FBO.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1762>
This commit is contained in:
Ivan Molodetskikh
2021-01-06 15:42:33 +03:00
committed by Marge Bot
parent 5a0d3ed4dd
commit 1116b14f38
5 changed files with 179 additions and 0 deletions

View File

@ -26,6 +26,8 @@
#include <glib-object.h>
#include <stdint.h>
#include "cogl/cogl.h"
#define META_TYPE_DRM_BUFFER (meta_drm_buffer_get_type ())
G_DECLARE_DERIVABLE_TYPE (MetaDrmBuffer,
meta_drm_buffer,
@ -42,4 +44,10 @@ int meta_drm_buffer_get_stride (MetaDrmBuffer *buffer);
uint32_t meta_drm_buffer_get_format (MetaDrmBuffer *buffer);
gboolean meta_drm_buffer_supports_fill_timings (MetaDrmBuffer *buffer);
gboolean meta_drm_buffer_fill_timings (MetaDrmBuffer *buffer,
CoglFrameInfo *info,
GError **error);
#endif /* META_DRM_BUFFER_H */