mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 11:48:06 +02:00
dri3: Wait for all pending swapbuffers to be scheduled before touching the front
This implements a wait for glXWaitGL, glXCopySubBuffer, dri flush_front and
creation of fake front until all pending SwapBuffers have been committed to
hardware. Among other things this fixes piglit glx-copy-sub-buffers on dri3.
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Sinclair Yeh <syeh@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Cc: <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 185ef06fd2)
This commit is contained in:
parent
4e4f8479a8
commit
eb880dfba7
2 changed files with 21 additions and 0 deletions
|
|
@ -504,6 +504,7 @@ loader_dri3_copy_sub_buffer(struct loader_dri3_drawable *draw,
|
|||
x, y, width, height, __BLIT_FLAG_FLUSH);
|
||||
}
|
||||
|
||||
loader_dri3_swapbuffer_barrier(draw);
|
||||
dri3_fence_reset(draw->conn, back);
|
||||
dri3_copy_area(draw->conn,
|
||||
dri3_back_buffer(draw)->pixmap,
|
||||
|
|
@ -595,6 +596,7 @@ loader_dri3_wait_gl(struct loader_dri3_drawable *draw)
|
|||
front->height,
|
||||
0, 0, front->width,
|
||||
front->height, __BLIT_FLAG_FLUSH);
|
||||
loader_dri3_swapbuffer_barrier(draw);
|
||||
loader_dri3_copy_drawable(draw, draw->drawable, front->pixmap);
|
||||
}
|
||||
|
||||
|
|
@ -1258,6 +1260,7 @@ dri3_get_buffer(__DRIdrawable *driDrawable,
|
|||
}
|
||||
break;
|
||||
case loader_dri3_buffer_front:
|
||||
loader_dri3_swapbuffer_barrier(draw);
|
||||
dri3_fence_reset(draw->conn, new_buffer);
|
||||
dri3_copy_area(draw->conn,
|
||||
draw->drawable,
|
||||
|
|
@ -1431,3 +1434,18 @@ loader_dri3_update_drawable_geometry(struct loader_dri3_drawable *draw)
|
|||
free(geom_reply);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Make sure the server has flushed all pending swap buffers to hardware
|
||||
* for this drawable. Ideally we'd want to send an X protocol request to
|
||||
* have the server block our connection until the swaps are complete. That
|
||||
* would avoid the potential round-trip here.
|
||||
*/
|
||||
void
|
||||
loader_dri3_swapbuffer_barrier(struct loader_dri3_drawable *draw)
|
||||
{
|
||||
int64_t ust, msc, sbc;
|
||||
|
||||
(void) loader_dri3_wait_for_sbc(draw, 0, &ust, &msc, &sbc);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -241,4 +241,7 @@ loader_dri3_get_buffers(__DRIdrawable *driDrawable,
|
|||
|
||||
void
|
||||
loader_dri3_update_drawable_geometry(struct loader_dri3_drawable *draw);
|
||||
|
||||
void
|
||||
loader_dri3_swapbuffer_barrier(struct loader_dri3_drawable *draw);
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue