summaryrefslogtreecommitdiff
path: root/src/gallium/state_trackers/dri
diff options
context:
space:
mode:
authorFrancisco Jerez <currojerez@riseup.net>2010-02-08 19:27:58 +0100
committerKristian Høgsberg <krh@bitplanet.net>2010-02-16 10:38:50 -0500
commitf845e4ff1bf4e7e2f804024157494a12eedec174 (patch)
tree07edb3160feed5280a27feba17a6c801c780637b /src/gallium/state_trackers/dri
parent88a560691b904cc8eacda62d9bf80987d3c430c1 (diff)
st/dri2: Use event-driven buffer validation.
Diffstat (limited to 'src/gallium/state_trackers/dri')
-rw-r--r--src/gallium/state_trackers/dri/dri_context.c6
-rw-r--r--src/gallium/state_trackers/dri/dri_drawable.c13
-rw-r--r--src/gallium/state_trackers/dri/dri_screen.c12
3 files changed, 27 insertions, 4 deletions
diff --git a/src/gallium/state_trackers/dri/dri_context.c b/src/gallium/state_trackers/dri/dri_context.c
index 5033c3c85b..908cef454e 100644
--- a/src/gallium/state_trackers/dri/dri_context.c
+++ b/src/gallium/state_trackers/dri/dri_context.c
@@ -166,10 +166,8 @@ dri_make_current(__DRIcontext * cPriv,
if (__dri1_api_hooks) {
dri1_update_drawables(ctx, draw, read);
} else {
- if (driDrawPriv)
- dri_get_buffers(driDrawPriv);
- if (driDrawPriv != driReadPriv && driReadPriv)
- dri_get_buffers(driReadPriv);
+ dri_update_buffer(ctx->pipe->screen,
+ ctx->pipe->priv);
}
} else {
st_make_current(NULL, NULL, NULL);
diff --git a/src/gallium/state_trackers/dri/dri_drawable.c b/src/gallium/state_trackers/dri/dri_drawable.c
index 97277c0507..4d7596a831 100644
--- a/src/gallium/state_trackers/dri/dri_drawable.c
+++ b/src/gallium/state_trackers/dri/dri_drawable.c
@@ -284,7 +284,20 @@ dri_update_buffer(struct pipe_screen *screen, void *context_private)
{
struct dri_context *ctx = (struct dri_context *)context_private;
+ if (ctx->d_stamp == *ctx->dPriv->pStamp &&
+ ctx->r_stamp == *ctx->rPriv->pStamp)
+ return;
+
+ ctx->d_stamp = *ctx->dPriv->pStamp;
+ ctx->r_stamp = *ctx->rPriv->pStamp;
+
+ st_flush(ctx->st, PIPE_FLUSH_RENDER_CACHE, NULL);
+
+ /* Ask the X server for new renderbuffers. */
dri_get_buffers(ctx->dPriv);
+ if (ctx->dPriv != ctx->rPriv)
+ dri_get_buffers(ctx->rPriv);
+
}
void
diff --git a/src/gallium/state_trackers/dri/dri_screen.c b/src/gallium/state_trackers/dri/dri_screen.c
index b36ea43db5..77d640227f 100644
--- a/src/gallium/state_trackers/dri/dri_screen.c
+++ b/src/gallium/state_trackers/dri/dri_screen.c
@@ -61,6 +61,17 @@ static const __DRItexBufferExtension dri2TexBufferExtension = {
dri2_set_tex_buffer2,
};
+static void
+dri2_flush_drawable(__DRIdrawable *draw)
+{
+}
+
+static const __DRI2flushExtension dri2FlushExtension = {
+ { __DRI2_FLUSH, __DRI2_FLUSH_VERSION },
+ dri2_flush_drawable,
+ dri2InvalidateDrawable,
+};
+
static const __DRIextension *dri_screen_extensions[] = {
&driReadDrawableExtension,
&driCopySubBufferExtension.base,
@@ -68,6 +79,7 @@ static const __DRItexBufferExtension dri2TexBufferExtension = {
&driFrameTrackingExtension.base,
&driMediaStreamCounterExtension.base,
&dri2TexBufferExtension.base,
+ &dri2FlushExtension.base,
NULL
};