mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-04-26 00:26:32 +00:00
[client] wayland: display swap to photon latency graph
This commit is contained in:
parent
e87bc3a83e
commit
09893fd728
@ -63,12 +63,7 @@ static void presentationFeedbackPresented(void * opaque,
|
|||||||
struct timespec delta;
|
struct timespec delta;
|
||||||
|
|
||||||
tsDiff(&delta, &present, &data->sent);
|
tsDiff(&delta, &present, &data->sent);
|
||||||
printf("Presented in %3jd.%06lums, vsync: %d, hw_clock: %d, hw_compl: %d, zero_copy: %d\n",
|
ringbuffer_push(wlWm.photonTimings, &(float){ delta.tv_sec + delta.tv_nsec * 1e-6f });
|
||||||
(intmax_t) delta.tv_sec * 1000 + delta.tv_nsec / 1000000, delta.tv_nsec % 1000000,
|
|
||||||
(bool) (flags & WP_PRESENTATION_FEEDBACK_KIND_VSYNC),
|
|
||||||
(bool) (flags & WP_PRESENTATION_FEEDBACK_KIND_HW_CLOCK),
|
|
||||||
(bool) (flags & WP_PRESENTATION_FEEDBACK_KIND_HW_COMPLETION),
|
|
||||||
(bool) (flags & WP_PRESENTATION_FEEDBACK_KIND_ZERO_COPY));
|
|
||||||
free(data);
|
free(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -86,6 +81,9 @@ static const struct wp_presentation_feedback_listener presentationFeedbackListen
|
|||||||
|
|
||||||
bool waylandPresentationInit(void)
|
bool waylandPresentationInit(void)
|
||||||
{
|
{
|
||||||
|
wlWm.photonTimings = ringbuffer_new(256, sizeof(float));
|
||||||
|
wlWm.photonGraph = app_registerGraph("PHOTON", wlWm.photonTimings);
|
||||||
|
|
||||||
if (wlWm.presentation)
|
if (wlWm.presentation)
|
||||||
wp_presentation_add_listener(wlWm.presentation, &presentationListener, NULL);
|
wp_presentation_add_listener(wlWm.presentation, &presentationListener, NULL);
|
||||||
return true;
|
return true;
|
||||||
@ -94,6 +92,8 @@ bool waylandPresentationInit(void)
|
|||||||
void waylandPresentationFree(void)
|
void waylandPresentationFree(void)
|
||||||
{
|
{
|
||||||
wp_presentation_destroy(wlWm.presentation);
|
wp_presentation_destroy(wlWm.presentation);
|
||||||
|
app_unregisterGraph(wlWm.photonGraph);
|
||||||
|
ringbuffer_free(&wlWm.photonTimings);
|
||||||
}
|
}
|
||||||
|
|
||||||
void waylandPresentationFrame(void)
|
void waylandPresentationFrame(void)
|
||||||
|
@ -29,9 +29,11 @@
|
|||||||
# include <EGL/eglext.h>
|
# include <EGL/eglext.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "app.h"
|
||||||
#include "egl_dynprocs.h"
|
#include "egl_dynprocs.h"
|
||||||
#include "common/locking.h"
|
#include "common/locking.h"
|
||||||
#include "common/countedbuffer.h"
|
#include "common/countedbuffer.h"
|
||||||
|
#include "common/ringbuffer.h"
|
||||||
#include "interface/displayserver.h"
|
#include "interface/displayserver.h"
|
||||||
|
|
||||||
#include "wayland-xdg-shell-client-protocol.h"
|
#include "wayland-xdg-shell-client-protocol.h"
|
||||||
@ -113,6 +115,8 @@ struct WaylandDSState
|
|||||||
|
|
||||||
struct wp_presentation * presentation;
|
struct wp_presentation * presentation;
|
||||||
clockid_t clkId;
|
clockid_t clkId;
|
||||||
|
RingBuffer photonTimings;
|
||||||
|
GraphHandle photonGraph;
|
||||||
|
|
||||||
#ifdef ENABLE_LIBDECOR
|
#ifdef ENABLE_LIBDECOR
|
||||||
struct libdecor * libdecor;
|
struct libdecor * libdecor;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user