summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeon/r600_pipe_common.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2013-10-08 21:50:43 +0200
committerMarek Olšák <[email protected]>2013-10-25 11:55:55 +0200
commit9807556e863ca4f49905598a18912852e96fae76 (patch)
treefe365ecd0dc1d3ad147be0d7e922764b5d0c42e8 /src/gallium/drivers/radeon/r600_pipe_common.c
parent6067a30838535c838262a9229b400afe4d92c184 (diff)
r600g,radeonsi: use fences provided by the winsys
Diffstat (limited to 'src/gallium/drivers/radeon/r600_pipe_common.c')
-rw-r--r--src/gallium/drivers/radeon/r600_pipe_common.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/gallium/drivers/radeon/r600_pipe_common.c b/src/gallium/drivers/radeon/r600_pipe_common.c
index f83c7e42a9e..5674f819466 100644
--- a/src/gallium/drivers/radeon/r600_pipe_common.c
+++ b/src/gallium/drivers/radeon/r600_pipe_common.c
@@ -47,6 +47,32 @@ static const struct debug_named_value common_debug_options[] = {
DEBUG_NAMED_VALUE_END /* must be last */
};
+static void r600_fence_reference(struct pipe_screen *screen,
+ struct pipe_fence_handle **ptr,
+ struct pipe_fence_handle *fence)
+{
+ struct radeon_winsys *rws = ((struct r600_common_screen*)screen)->ws;
+
+ rws->fence_reference(ptr, fence);
+}
+
+static boolean r600_fence_signalled(struct pipe_screen *screen,
+ struct pipe_fence_handle *fence)
+{
+ struct radeon_winsys *rws = ((struct r600_common_screen*)screen)->ws;
+
+ return rws->fence_wait(rws, fence, 0);
+}
+
+static boolean r600_fence_finish(struct pipe_screen *screen,
+ struct pipe_fence_handle *fence,
+ uint64_t timeout)
+{
+ struct radeon_winsys *rws = ((struct r600_common_screen*)screen)->ws;
+
+ return rws->fence_wait(rws, fence, timeout);
+}
+
static bool r600_interpret_tiling(struct r600_common_screen *rscreen,
uint32_t tiling_config)
{
@@ -164,6 +190,10 @@ bool r600_common_screen_init(struct r600_common_screen *rscreen,
{
ws->query_info(ws, &rscreen->info);
+ rscreen->b.fence_finish = r600_fence_finish;
+ rscreen->b.fence_reference = r600_fence_reference;
+ rscreen->b.fence_signalled = r600_fence_signalled;
+
rscreen->ws = ws;
rscreen->family = rscreen->info.family;
rscreen->chip_class = rscreen->info.chip_class;