mirror of
https://github.com/gnif/LookingGlass.git
synced 2026-08-04 06:12:04 +00:00
[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:
@@ -36,6 +36,8 @@
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#define LGMP_TIMING_SPIN_COUNT 4096
|
||||
|
||||
struct DMAFrameInfo
|
||||
{
|
||||
const KVMFRFrame * frame;
|
||||
@@ -622,18 +624,21 @@ static void lgmp_getFrameTiming(LG_Transport * this,
|
||||
this->pendingFrame->frameSerial != frame->serial)
|
||||
return;
|
||||
|
||||
/* The producer writes these immediately after completing the framebuffer.
|
||||
* nextFrame can observe the header earlier, so sample them only after the
|
||||
* renderer's onFrame call has consumed the framebuffer. */
|
||||
/* The producer writes these immediately after publishing FrameBuffer::wp.
|
||||
* nextFrame can observe the header earlier, so briefly observe the
|
||||
* publication tail after onFrame consumes the framebuffer without sleeping
|
||||
* the frame-acquisition thread. */
|
||||
for (unsigned i = 0;
|
||||
!lgmp_frameTimingReady(this->pendingFrame) &&
|
||||
i < 1000;
|
||||
i < LGMP_TIMING_SPIN_COUNT;
|
||||
++i)
|
||||
usleep(1);
|
||||
{
|
||||
}
|
||||
|
||||
if (!lgmp_frameTimingReady(this->pendingFrame))
|
||||
return;
|
||||
|
||||
timing->valid = true;
|
||||
timing->captureTime = this->pendingFrame->captureTime;
|
||||
timing->postProcessTime = this->pendingFrame->postProcessTime;
|
||||
timing->copyTime = this->pendingFrame->copyTime;
|
||||
|
||||
Reference in New Issue
Block a user