[client/host/idd] correct frame timing attribution

Use calibrated copy-queue timestamps to separate source and effect
waits from the actual framebuffer copy.

Exclude producer readiness waits from client import timing so the
same interval is not counted in both Copy and Import.
This commit is contained in:
Geoffrey McRae
2026-08-03 15:58:41 +10:00
parent c8e4b97c3c
commit aa289fa022
17 changed files with 630 additions and 92 deletions

View File

@@ -220,22 +220,37 @@ void rectsBufferToFramebuffer(FrameDamageRect * rects, int count, int bpp,
struct FromFramebufferData
{
const FrameBuffer * frame;
int pitch;
int pitch;
uint64_t * waitTimeNs;
};
static bool fbRowStart(int y, void * opaque)
{
struct FromFramebufferData * data = opaque;
return framebuffer_wait(data->frame, y * data->pitch);
return framebuffer_wait_timed(
data->frame, y * data->pitch, data->waitTimeNs);
}
bool rectsFramebufferToBufferTimed(FrameDamageRect * rects, int count, int bpp,
uint8_t * dst, int dstPitch, int height,
const FrameBuffer * frame, int srcPitch, uint64_t * waitTimeNs)
{
struct FromFramebufferData data =
{
.frame = frame,
.pitch = srcPitch,
.waitTimeNs = waitTimeNs
};
return rectsBufferCopy(rects, count, bpp, dst, dstPitch, height,
framebuffer_get_buffer(frame), srcPitch, &data, fbRowStart, NULL);
}
bool rectsFramebufferToBuffer(FrameDamageRect * rects, int count, int bpp,
uint8_t * dst, int dstPitch, int height,
const FrameBuffer * frame, int srcPitch)
{
struct FromFramebufferData data = { .frame = frame, .pitch = srcPitch };
return rectsBufferCopy(rects, count, bpp, dst, dstPitch, height,
framebuffer_get_buffer(frame), srcPitch, &data, fbRowStart, NULL);
return rectsFramebufferToBufferTimed(rects, count, bpp, dst, dstPitch,
height, frame, srcPitch, NULL);
}
int rectsMergeOverlapping(FrameDamageRect * rects, int count)