[client] egl: snapshot DMA frames before release

Copy imported IVSHMEM frames into renderer-owned textures before
acknowledging their LGMP messages. Hold each lease until its copy fence
signals, and protect selected snapshots until rendering completes.

Track independent delivery lanes, drain acknowledgements on the frame
thread, and recover stale queue subscriptions after host timeouts.
This commit is contained in:
Geoffrey McRae
2026-08-06 14:47:40 +10:00
parent f6c72b0bc5
commit 05f3b39b43
12 changed files with 824 additions and 227 deletions

View File

@@ -41,9 +41,12 @@ typedef struct EGL_Model EGL_Model;
typedef struct EGL_TexUpdate
{
/* the type of this update */
EGL_TexType type;
LG_RendererFrameToken frameToken;
uint64_t * waitTimeNs;
EGL_TexType type;
LG_RendererFrameToken frameToken;
uint64_t * waitTimeNs;
LG_FrameReleaseFn releaseFn;
void * releaseOpaque;
uint64_t releaseHandle;
int x, y, width, height;
@@ -101,6 +104,15 @@ typedef struct EGL_TextureOps
/* bind the texture for use */
enum EGL_TexStatus (*bind)(EGL_Texture * texture, GLuint unit);
/* release queued updates and reset stream state */
void (*reset)(EGL_Texture * texture);
/* poll asynchronous work without changing the selected frame */
void (*poll)(EGL_Texture * texture);
/* record that the selected texture has been sampled */
void (*markUsed)(EGL_Texture * texture);
}
EGL_TextureOps;
@@ -135,7 +147,12 @@ bool egl_textureUpdateFromFrame(EGL_Texture * texture,
bool egl_textureUpdateFromDMA(EGL_Texture * texture,
const FrameBuffer * frame, LG_RendererFrameToken frameToken,
const int dmaFd, uint64_t * waitTimeNs);
const int dmaFd, uint64_t * waitTimeNs, LG_FrameReleaseFn releaseFn,
void * releaseOpaque, uint64_t releaseHandle);
void egl_textureReset(EGL_Texture * texture);
void egl_texturePoll(EGL_Texture * texture);
void egl_textureMarkUsed(EGL_Texture * texture);
enum EGL_TexStatus egl_textureProcess(EGL_Texture * texture,
LG_RendererFrameToken frameTokenLimit,