[client] x11: don't use the atomic msc value when we already have it

This commit is contained in:
Geoffrey McRae 2021-12-21 10:47:11 +11:00
parent a5727262cd
commit 02b59ba8f7

View file

@ -84,7 +84,7 @@ static void x11XInputEvent(XGenericEventCookie *cookie);
static void x11XPresentEvent(XGenericEventCookie *cookie); static void x11XPresentEvent(XGenericEventCookie *cookie);
static void x11GrabPointer(void); static void x11GrabPointer(void);
static void x11DoPresent(void) static void x11DoPresent(uint64_t msc)
{ {
static bool startup = true; static bool startup = true;
if (startup) if (startup)
@ -114,7 +114,6 @@ static void x11DoPresent(void)
static bool first = true; static bool first = true;
static uint64_t lastMsc = 0; static uint64_t lastMsc = 0;
uint64_t msc = atomic_load(&x11.presentMsc);
uint64_t refill; uint64_t refill;
if (!first) if (!first)
@ -686,7 +685,7 @@ static bool x11Init(const LG_DSInitParams params)
} }
if (x11.jitRender) if (x11.jitRender)
x11DoPresent(); x11DoPresent(0);
return true; return true;
@ -1338,10 +1337,10 @@ static void x11XPresentEvent(XGenericEventCookie *cookie)
case PresentCompleteNotify: case PresentCompleteNotify:
{ {
XPresentCompleteNotifyEvent * e = cookie->data; XPresentCompleteNotifyEvent * e = cookie->data;
x11DoPresent(e->msc);
atomic_store(&x11.presentMsc, e->msc); atomic_store(&x11.presentMsc, e->msc);
atomic_store(&x11.presentUst, e->ust); atomic_store(&x11.presentUst, e->ust);
lgSignalEvent(x11.frameEvent); lgSignalEvent(x11.frameEvent);
x11DoPresent();
break; break;
} }
} }