Mesa (master): r300g: store own copy of flush_cb and flush data.
Dave Airlie
airlied at kemper.freedesktop.org
Fri Dec 18 00:23:58 UTC 2009
Module: Mesa
Branch: master
Commit: 5f59e79f3a9f273c683304117802bb216171c257
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=5f59e79f3a9f273c683304117802bb216171c257
Author: Dave Airlie <airlied at redhat.com>
Date: Fri Dec 18 09:32:04 2009 +1000
r300g: store own copy of flush_cb and flush data.
don't go sneaking around inside the libdrm copy.
---
src/gallium/winsys/drm/radeon/core/radeon_buffer.c | 4 ++--
src/gallium/winsys/drm/radeon/core/radeon_buffer.h | 4 ++++
src/gallium/winsys/drm/radeon/core/radeon_r300.c | 2 ++
3 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/src/gallium/winsys/drm/radeon/core/radeon_buffer.c b/src/gallium/winsys/drm/radeon/core/radeon_buffer.c
index 76acc99..cb8d2c2 100644
--- a/src/gallium/winsys/drm/radeon/core/radeon_buffer.c
+++ b/src/gallium/winsys/drm/radeon/core/radeon_buffer.c
@@ -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) {
diff --git a/src/gallium/winsys/drm/radeon/core/radeon_buffer.h b/src/gallium/winsys/drm/radeon/core/radeon_buffer.h
index 1e91e18..950a1d6 100644
--- a/src/gallium/winsys/drm/radeon/core/radeon_buffer.h
+++ b/src/gallium/winsys/drm/radeon/core/radeon_buffer.h
@@ -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);
diff --git a/src/gallium/winsys/drm/radeon/core/radeon_r300.c b/src/gallium/winsys/drm/radeon/core/radeon_r300.c
index ba0596c..0875ee4 100644
--- a/src/gallium/winsys/drm/radeon/core/radeon_r300.c
+++ b/src/gallium/winsys/drm/radeon/core/radeon_r300.c
@@ -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);
}
More information about the mesa-commit
mailing list