mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-06 06:40:08 +01:00
vl/dri3: implement function for flush frontbuffer
Request drawable content in pixmap by calling DRI3 PresentPixmap, and handle PresentIdleNotify event. Signed-off-by: Leo Liu <leo.liu@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com>
This commit is contained in:
parent
e1223282db
commit
b0bd908284
1 changed files with 30 additions and 2 deletions
|
|
@ -96,7 +96,15 @@ dri3_handle_present_event(struct vl_dri3_screen *scrn,
|
|||
break;
|
||||
}
|
||||
case XCB_PRESENT_EVENT_IDLE_NOTIFY: {
|
||||
/* TODO */
|
||||
xcb_present_idle_notify_event_t *ie = (void *) ge;
|
||||
int b;
|
||||
for (b = 0; b < BACK_BUFFER_NUM; b++) {
|
||||
struct vl_dri3_buffer *buf = scrn->back_buffers[b];
|
||||
if (buf && buf->pixmap == ie->pixmap) {
|
||||
buf->busy = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -310,7 +318,27 @@ vl_dri3_flush_frontbuffer(struct pipe_screen *screen,
|
|||
unsigned level, unsigned layer,
|
||||
void *context_private, struct pipe_box *sub_box)
|
||||
{
|
||||
/* TODO */
|
||||
struct vl_dri3_screen *scrn = (struct vl_dri3_screen *)context_private;
|
||||
uint32_t options = XCB_PRESENT_OPTION_NONE;
|
||||
struct vl_dri3_buffer *back;
|
||||
|
||||
back = scrn->back_buffers[scrn->cur_back];
|
||||
if (!back)
|
||||
return;
|
||||
|
||||
xshmfence_reset(back->shm_fence);
|
||||
back->busy = true;
|
||||
|
||||
xcb_present_pixmap(scrn->conn,
|
||||
scrn->drawable,
|
||||
back->pixmap,
|
||||
0, 0, 0, 0, 0,
|
||||
None, None,
|
||||
back->sync_fence,
|
||||
options, 0, 0, 0, 0, NULL);
|
||||
|
||||
xcb_flush(scrn->conn);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue