[client] x11: remove junk code from evaluation

This commit is contained in:
Geoffrey McRae 2021-08-03 01:11:20 +10:00
parent 5d5e4ede1a
commit 50f9baedba
2 changed files with 1 additions and 35 deletions

View File

@ -516,11 +516,9 @@ static bool x11Init(const LG_DSInitParams params)
x11.frameEvent = lgCreateEvent(true, 0); x11.frameEvent = lgCreateEvent(true, 0);
x11.presentAvg = runningavg_new(1000);
XPresentQueryExtension(x11.display, &x11.xpresentOp, &event, &error); XPresentQueryExtension(x11.display, &x11.xpresentOp, &event, &error);
x11.presentPixmap = XCreatePixmap(x11.display, x11.window, 1, 1, 24); x11.presentPixmap = XCreatePixmap(x11.display, x11.window, 1, 1, 24);
XPresentSelectInput(x11.display, x11.window, XPresentSelectInput(x11.display, x11.window, PresentCompleteNotifyMask);
PresentCompleteNotifyMask | PresentIdleNotifyMask);
XMapWindow(x11.display, x11.window); XMapWindow(x11.display, x11.window);
XFlush(x11.display); XFlush(x11.display);
@ -1037,36 +1035,6 @@ static void x11XPresentEvent(XGenericEventCookie *cookie)
{ {
lgSignalEvent(x11.frameEvent); lgSignalEvent(x11.frameEvent);
x11DoPresent(); x11DoPresent();
#if 0
static uint64_t last = 0;
static uint64_t predict = 0;
XPresentCompleteNotifyEvent * ev =
(XPresentCompleteNotifyEvent *)cookie->data;
const int64_t err = (int64_t)predict - ev->ust;
if (last)
{
const uint64_t delta = ev->ust - last;
runningavg_push(x11.presentAvg, delta);
}
DEBUG_WARN("predict err %f", err / 1000.0f);
predict = (ev->ust + round(runningavg_calc(x11.presentAvg)));
last = ev->ust;
XFlush(x11.display);
#endif
break;
}
case PresentIdleNotify:
{
XPresentIdleNotifyEvent * ev =
(XPresentIdleNotifyEvent *)cookie->data;
(void)ev;
break; break;
} }
} }

View File

@ -32,7 +32,6 @@
#include "interface/displayserver.h" #include "interface/displayserver.h"
#include "common/thread.h" #include "common/thread.h"
#include "common/types.h" #include "common/types.h"
#include "common/runningavg.h"
struct X11DSState struct X11DSState
{ {
@ -43,7 +42,6 @@ struct X11DSState
uint32_t presentSerial; uint32_t presentSerial;
Pixmap presentPixmap; Pixmap presentPixmap;
RunningAvg presentAvg;
LGEvent * frameEvent; LGEvent * frameEvent;
LGThread * eventThread; LGThread * eventThread;