r300g: store own copy of flush_cb and flush data.
authorDave Airlie <airlied@redhat.com>
Thu, 17 Dec 2009 23:32:04 +0000 (09:32 +1000)
committerDave Airlie <airlied@redhat.com>
Fri, 18 Dec 2009 00:24:50 +0000 (10:24 +1000)
don't go sneaking around inside the libdrm copy.

src/gallium/winsys/drm/radeon/core/radeon_buffer.c
src/gallium/winsys/drm/radeon/core/radeon_buffer.h
src/gallium/winsys/drm/radeon/core/radeon_r300.c

index 76acc99ad7388d51ac6af53c9d98f6417b7d9d2d..cb8d2c2cf24925f36f617e7414ca8fca192fe011 100644 (file)
@@ -135,7 +135,7 @@ static void radeon_buffer_del(struct pipe_buffer *buffer)
     struct radeon_winsys_priv *priv = radeon_buffer->ws->priv;
 
     if (radeon_bo_is_referenced_by_cs(radeon_buffer->bo, priv->cs)) {
-        priv->cs->space_flush_fn(priv->cs->space_flush_data);
+        priv->flush_cb(priv->flush_data);
     }
 
     radeon_bo_unref(radeon_buffer->bo);
@@ -152,7 +152,7 @@ static void *radeon_buffer_map(struct pipe_winsys *ws,
     int write = 0;
 
     if (radeon_bo_is_referenced_by_cs(radeon_buffer->bo, priv->cs)) {
-        priv->cs->space_flush_fn(priv->cs->space_flush_data);
+        priv->flush_cb(priv->flush_data);
     }
 
     if (flags & PIPE_BUFFER_USAGE_DONTBLOCK) {
index 1e91e18927a84ed040408ffbcd71199da0222aff..950a1d66c3dcf321f5c6431c8b1512d88cbca83b 100644 (file)
@@ -69,6 +69,10 @@ struct radeon_winsys_priv {
 
     /* Current CS. */
     struct radeon_cs* cs;
+
+    /* Flush CB */
+    void (*flush_cb)(void *);
+    void *flush_data;
 };
 
 struct radeon_winsys* radeon_pipe_winsys(int fb);
index ba0596c30dc3ceb48b7671525e12625b66213846..0875ee41cbfd76d0311258cd5871331f44bff330 100644 (file)
@@ -26,6 +26,8 @@ static void radeon_set_flush_cb(struct radeon_winsys *winsys,
                                 void (*flush_cb)(void *),
                                 void *data)
 {
+    winsys->priv->flush_cb = flush_cb;
+    winsys->priv->flush_data = data;
     radeon_cs_space_set_flush(winsys->priv->cs, flush_cb, data);
 }