[client] scheduler: qualify presentation feedback

Track cadence, interruption, and calibration wake reasons independently
across X11 and Wayland. Feed phase correction back only when a pure
cadence wake renders the exact frame that was queued at that wake.

Propagate EGL swap results through the display-server boundary. Reject
failed presentations and keep pending Wayland HDR descriptions inactive
until the preceding surface commit succeeds.
This commit is contained in:
Geoffrey McRae
2026-08-06 16:17:23 +10:00
parent 515f4ba06f
commit 3d1064001d
12 changed files with 119 additions and 57 deletions

View File

@@ -103,7 +103,8 @@ bool app_getHDRDescFailed(void);
#ifdef ENABLE_EGL
EGLDisplay app_getEGLDisplay(void);
EGLNativeWindowType app_getEGLNativeWindow(void);
void app_eglSwapBuffers(EGLDisplay display, EGLSurface surface, const struct Rect * damage, int count);
bool app_eglSwapBuffers(EGLDisplay display, EGLSurface surface,
const struct Rect * damage, int count);
#endif
#ifdef ENABLE_OPENGL

View File

@@ -35,7 +35,7 @@ struct SwapWithDamageData
void swapWithDamageInit(struct SwapWithDamageData * data, EGLDisplay display);
void swapWithDamageDisable(struct SwapWithDamageData * data);
void swapWithDamage(struct SwapWithDamageData * data, EGLDisplay display, EGLSurface surface,
const struct Rect * damage, int count);
bool swapWithDamage(struct SwapWithDamageData * data, EGLDisplay display,
EGLSurface surface, const struct Rect * damage, int count);
#endif

View File

@@ -103,6 +103,15 @@ typedef enum LG_DSPointer
}
LG_DSPointer;
typedef enum LG_DSWaitFrameResult
{
LG_DS_WAIT_FRAME_NONE = 0,
LG_DS_WAIT_FRAME_CADENCE = 1 << 0,
LG_DS_WAIT_FRAME_INTERRUPTED = 1 << 1,
LG_DS_WAIT_FRAME_FORCE_RENDER = 1 << 2,
}
LG_DSWaitFrameResult;
#define LG_POINTER_COUNT (LG_POINTER_NOT_ALLOWED + 1)
typedef struct LG_DSInitParams
@@ -171,7 +180,8 @@ struct LG_DisplayServerOps
/* EGL support */
EGLDisplay (*getEGLDisplay)(void);
EGLNativeWindowType (*getEGLNativeWindow)(void);
void (*eglSwapBuffers)(EGLDisplay display, EGLSurface surface, const struct Rect * damage, int count);
bool (*eglSwapBuffers)(EGLDisplay display, EGLSurface surface,
const struct Rect * damage, int count);
#endif
#ifdef ENABLE_OPENGL
@@ -184,11 +194,8 @@ struct LG_DisplayServerOps
#endif
/* Waits for a good time to render the next frame in time for the next vblank.
* This is optional and a display server may choose to not implement it.
*
* return true to force the frame to be rendered, this is used by X11 for
* calibration */
bool (*waitFrame)(void);
* This is optional and a display server may choose to not implement it. */
LG_DSWaitFrameResult (*waitFrame)(void);
/* This must be called when waitFrame returns, but no frame is actually rendered. */
void (*skipFrame)(void);