r300g: expose radeon_bo_wait to the driver
authorMarek Olšák <maraeo@gmail.com>
Sun, 16 May 2010 16:31:22 +0000 (18:31 +0200)
committerMarek Olšák <maraeo@gmail.com>
Sun, 16 May 2010 17:18:10 +0000 (19:18 +0200)
src/gallium/drivers/r300/r300_winsys.h
src/gallium/winsys/radeon/drm/radeon_buffer.h
src/gallium/winsys/radeon/drm/radeon_drm_buffer.c
src/gallium/winsys/radeon/drm/radeon_r300.c

index f6cb97bc0801bb5b3962ea55b5f116d772c76014..3d0413f90af4f20ee4a5add95c923041ddf6b88f 100644 (file)
@@ -87,6 +87,9 @@ struct r300_winsys_screen {
                             struct r300_winsys_buffer **pdst,
                             struct r300_winsys_buffer *src);
 
+    void (*buffer_wait)(struct r300_winsys_screen *rws,
+                        struct r300_winsys_buffer *buf);
+
     /* Add a pipe_resource to the list of buffer objects to validate. */
     boolean (*add_buffer)(struct r300_winsys_screen *winsys,
                           struct r300_winsys_buffer *buf,
index b48b6358e01a4dec2000805ba5d1155dcf3bf84f..b9ecf9ded071e9c80265f2ad93e16cb701297642 100644 (file)
@@ -88,4 +88,7 @@ boolean radeon_drm_bufmgr_get_handle(struct pb_buffer *_buf,
 
 boolean radeon_drm_bufmgr_is_buffer_referenced(struct pb_buffer *_buf,
                                                enum r300_reference_domain domain);
+
+void radeon_drm_bufmgr_wait(struct pb_buffer *_buf);
+
 #endif
index b8366498922803844b3d895e23242e8caf5e1ee1..a05205da8861fc4e76290e5ebcae62cbdac8be18 100644 (file)
@@ -419,3 +419,10 @@ void radeon_drm_bufmgr_flush_maps(struct pb_manager *_mgr)
 
     make_empty_list(&mgr->buffer_map_list);
 }
+
+void radeon_drm_bufmgr_wait(struct pb_buffer *_buf)
+{
+    struct radeon_drm_buffer *buf = get_drm_buffer(_buf);
+
+    radeon_bo_wait(buf->bo);
+}
index 94cd5281e268c29aaee77cb255e2a9e8218bc3f1..e188f7e7ccd50271f34300c7dadb2c73ebc4d96f 100644 (file)
@@ -98,6 +98,13 @@ static void radeon_r300_winsys_buffer_unmap(struct r300_winsys_screen *ws,
     pb_unmap(_buf);
 }
 
+static void radeon_r300_winsys_buffer_wait(struct r300_winsys_screen *ws,
+                                           struct r300_winsys_buffer *buf)
+{
+    struct pb_buffer *_buf = radeon_pb_buffer(buf);
+    radeon_drm_bufmgr_wait(_buf);
+}
+
 static void radeon_r300_winsys_buffer_reference(struct r300_winsys_screen *rws,
                                                struct r300_winsys_buffer **pdst,
                                                struct r300_winsys_buffer *src)
@@ -343,6 +350,7 @@ radeon_setup_winsys(int fd, struct radeon_libdrm_winsys* ws)
     ws->base.buffer_get_tiling = radeon_r300_winsys_buffer_get_tiling;
     ws->base.buffer_map = radeon_r300_winsys_buffer_map;
     ws->base.buffer_unmap = radeon_r300_winsys_buffer_unmap;
+    ws->base.buffer_wait = radeon_r300_winsys_buffer_wait;
     ws->base.buffer_reference = radeon_r300_winsys_buffer_reference;
     ws->base.buffer_from_handle = radeon_r300_winsys_buffer_from_handle;
     ws->base.buffer_get_handle = radeon_r300_winsys_buffer_get_handle;