mirror of
https://github.com/gnif/LookingGlass.git
synced 2026-08-04 06:12:04 +00:00
[client] report presentation cadence over LGMP
This commit is contained in:
@@ -56,6 +56,8 @@ static void presentationFeedbackPresented(void * opaque,
|
||||
uint32_t tvNsec, uint32_t refresh, uint32_t seqHi, uint32_t seqLo, uint32_t flags)
|
||||
{
|
||||
struct FrameData * data = opaque;
|
||||
if (refresh)
|
||||
atomic_store(&wlWm.presentationPeriod, refresh);
|
||||
struct timespec present = {
|
||||
.tv_sec = (uint64_t) tvSecHi << 32 | tvSecLo,
|
||||
.tv_nsec = tvNsec,
|
||||
@@ -69,6 +71,16 @@ static void presentationFeedbackPresented(void * opaque,
|
||||
wp_presentation_feedback_destroy(feedback);
|
||||
}
|
||||
|
||||
bool waylandGetFramePeriod(uint64_t * period)
|
||||
{
|
||||
const uint64_t value = atomic_load(&wlWm.presentationPeriod);
|
||||
if (!value)
|
||||
return false;
|
||||
|
||||
*period = value;
|
||||
return true;
|
||||
}
|
||||
|
||||
static void presentationFeedbackDiscarded(void * data,
|
||||
struct wp_presentation_feedback * feedback)
|
||||
{
|
||||
|
||||
@@ -314,6 +314,7 @@ struct LG_DisplayServerOps LGDS_Wayland =
|
||||
.waitFrame = waylandWaitFrame,
|
||||
.skipFrame = waylandSkipFrame,
|
||||
.stopWaitFrame = waylandStopWaitFrame,
|
||||
.getFramePeriod = waylandGetFramePeriod,
|
||||
.guestPointerUpdated = waylandGuestPointerUpdated,
|
||||
.setPointer = waylandSetPointer,
|
||||
.grabPointer = waylandGrabPointer,
|
||||
|
||||
@@ -158,6 +158,7 @@ struct WaylandDSState
|
||||
|
||||
struct wp_presentation * presentation;
|
||||
clockid_t clkId;
|
||||
_Atomic(uint64_t) presentationPeriod;
|
||||
RingBuffer photonTimings;
|
||||
GraphHandle photonGraph;
|
||||
|
||||
@@ -399,6 +400,7 @@ bool waylandPollUnregister(int fd);
|
||||
bool waylandPresentationInit(void);
|
||||
void waylandPresentationFrame(void);
|
||||
void waylandPresentationFree(void);
|
||||
bool waylandGetFramePeriod(uint64_t * period);
|
||||
|
||||
// registry module
|
||||
bool waylandRegistryInit(void);
|
||||
|
||||
Reference in New Issue
Block a user