summaryrefslogtreecommitdiff
path: root/src/gallium
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2010-01-11 11:41:47 +1000
committerJakob Bornecrantz <jakob@vmware.com>2010-01-19 17:06:22 +0100
commit116a02be2264807dafb5fdfd4e3c913bb728c11f (patch)
treed432ab0a3d064d2cac49ecd2ec2cc52f8d8c1abf /src/gallium
parente88294328cb71dc32941556da5bd4ed40e8b95f1 (diff)
st/dri: update dri2 drawables when viewport is changed
Fixes gnome-shell on nouveau, as well as window resize with various other applications. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/include/pipe/p_screen.h5
-rw-r--r--src/gallium/state_trackers/dri/dri_drawable.c8
-rw-r--r--src/gallium/state_trackers/dri/dri_drawable.h3
-rw-r--r--src/gallium/state_trackers/dri/dri_screen.c1
4 files changed, 17 insertions, 0 deletions
diff --git a/src/gallium/include/pipe/p_screen.h b/src/gallium/include/pipe/p_screen.h
index f0a4de5df3..b8e001a6b0 100644
--- a/src/gallium/include/pipe/p_screen.h
+++ b/src/gallium/include/pipe/p_screen.h
@@ -266,6 +266,11 @@ struct pipe_screen {
void (*video_surface_destroy)( struct pipe_video_surface *vsfc );
+ /**
+ * Do any special operations to ensure buffer size is correct
+ */
+ void (*update_buffer)( struct pipe_screen *ws,
+ void *context_private );
/**
* Do any special operations to ensure frontbuffer contents are
diff --git a/src/gallium/state_trackers/dri/dri_drawable.c b/src/gallium/state_trackers/dri/dri_drawable.c
index 99dc022549..c20b71e958 100644
--- a/src/gallium/state_trackers/dri/dri_drawable.c
+++ b/src/gallium/state_trackers/dri/dri_drawable.c
@@ -272,6 +272,14 @@ void dri2_set_tex_buffer(__DRIcontext *pDRICtx, GLint target,
}
void
+dri_update_buffer(struct pipe_screen *screen, void *context_private)
+{
+ struct dri_context *ctx = (struct dri_context *)context_private;
+
+ dri_get_buffers(ctx->dPriv);
+}
+
+void
dri_flush_frontbuffer(struct pipe_screen *screen,
struct pipe_surface *surf, void *context_private)
{
diff --git a/src/gallium/state_trackers/dri/dri_drawable.h b/src/gallium/state_trackers/dri/dri_drawable.h
index b910930db4..a0fb05d7b2 100644
--- a/src/gallium/state_trackers/dri/dri_drawable.h
+++ b/src/gallium/state_trackers/dri/dri_drawable.h
@@ -81,6 +81,9 @@ dri_create_buffer(__DRIscreenPrivate * sPriv,
const __GLcontextModes * visual, boolean isPixmap);
void
+dri_update_buffer(struct pipe_screen *screen, void *context_private);
+
+void
dri_flush_frontbuffer(struct pipe_screen *screen,
struct pipe_surface *surf, void *context_private);
diff --git a/src/gallium/state_trackers/dri/dri_screen.c b/src/gallium/state_trackers/dri/dri_screen.c
index d95c62745e..25c392e849 100644
--- a/src/gallium/state_trackers/dri/dri_screen.c
+++ b/src/gallium/state_trackers/dri/dri_screen.c
@@ -310,6 +310,7 @@ dri_init_screen2(__DRIscreenPrivate * sPriv)
}
/* We need to hook in here */
+ screen->pipe_screen->update_buffer = dri_update_buffer;
screen->pipe_screen->flush_frontbuffer = dri_flush_frontbuffer;
driParseOptionInfo(&screen->optionCache,