[client] expose EGL stages in frame latency

Correlate received frames with the texture update actually consumed by
the renderer and retain damage until its token becomes renderable.

Split client latency into dispatch, import, queue, preparation, setup,
effects, desktop, composition, and swap stages in FRAME LATENCY.
Exclude diagnostic overlay work from composition and preserve client
wait time when producer timing is unavailable.

Publish joined samples through a bounded token queue, avoid sleeping
while producer timing is finalized, and correct Wayland photon units.
This commit is contained in:
Geoffrey McRae
2026-08-03 23:25:25 +10:00
parent 6109501eed
commit fbe08d00ce
21 changed files with 897 additions and 349 deletions

View File

@@ -47,15 +47,46 @@ void overlayAlert_show(LG_MsgAlert type, const char * fmt, va_list args);
typedef struct OverlayFrameTiming
{
uint64_t timestamp;
uint32_t validMask;
float capture;
float postProcess;
float copy;
float ready;
float import;
float render;
float dispatch;
float queue;
float prepare;
float setup;
float effects;
float desktop;
float compose;
float swap;
}
OverlayFrameTiming;
enum OverlayFrameTimingStage
{
OVERLAY_FRAME_TIMING_CAPTURE,
OVERLAY_FRAME_TIMING_POST_PROCESS,
OVERLAY_FRAME_TIMING_COPY,
OVERLAY_FRAME_TIMING_READY,
OVERLAY_FRAME_TIMING_IMPORT,
OVERLAY_FRAME_TIMING_DISPATCH,
OVERLAY_FRAME_TIMING_QUEUE,
OVERLAY_FRAME_TIMING_PREPARE,
OVERLAY_FRAME_TIMING_SETUP,
OVERLAY_FRAME_TIMING_EFFECTS,
OVERLAY_FRAME_TIMING_DESKTOP,
OVERLAY_FRAME_TIMING_COMPOSE,
OVERLAY_FRAME_TIMING_SWAP,
OVERLAY_FRAME_TIMING_COUNT,
};
#define OVERLAY_FRAME_TIMING_VALID_ALL \
((1U << OVERLAY_FRAME_TIMING_COUNT) - 1U)
#define OVERLAY_FRAME_TIMING_VALID_PRODUCER \
((1U << OVERLAY_FRAME_TIMING_IMPORT) - 1U)
GraphHandle overlayGraph_register(const char * name, RingBuffer buffer,
float min, float max, GraphFormatFn formatFn);
GraphHandle overlayGraph_registerFrameTiming(const char * name,