summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/gallium/frontends/dri/dri2.c6
-rw-r--r--src/gallium/frontends/dri/dri_context.c4
-rw-r--r--src/gallium/frontends/dri/dri_drawable.c1
-rw-r--r--src/gallium/frontends/dri/dri_drawable.h5
-rw-r--r--src/gallium/frontends/dri/kopper.c6
5 files changed, 6 insertions, 16 deletions
diff --git a/src/gallium/frontends/dri/dri2.c b/src/gallium/frontends/dri/dri2.c
index 17bede81167..a678a83a14e 100644
--- a/src/gallium/frontends/dri/dri2.c
+++ b/src/gallium/frontends/dri/dri2.c
@@ -73,10 +73,10 @@ dri2_buffer(__DRIbuffer * driBufferPriv)
static void
dri2_flush_drawable(__DRIdrawable *dPriv)
{
- struct dri_drawable *drawable = dri_drawable(dPriv);
+ struct dri_context *ctx = dri_get_current();
- dri_flush(opaque_dri_context(drawable->ctx), dPriv, __DRI2_FLUSH_DRAWABLE,
- -1);
+ if (ctx)
+ dri_flush(opaque_dri_context(ctx), dPriv, __DRI2_FLUSH_DRAWABLE, -1);
}
/**
diff --git a/src/gallium/frontends/dri/dri_context.c b/src/gallium/frontends/dri/dri_context.c
index 5c6b0617303..dc2b06ee419 100644
--- a/src/gallium/frontends/dri/dri_context.c
+++ b/src/gallium/frontends/dri/dri_context.c
@@ -305,10 +305,8 @@ dri_make_current(struct dri_context *ctx,
ctx->draw = draw;
ctx->read = read;
- if (draw) {
- draw->ctx = ctx;
+ if (draw)
dri_get_drawable(draw);
- }
if (read && draw != read)
dri_get_drawable(read);
diff --git a/src/gallium/frontends/dri/dri_drawable.c b/src/gallium/frontends/dri/dri_drawable.c
index 150603d6d08..6c43bff5763 100644
--- a/src/gallium/frontends/dri/dri_drawable.c
+++ b/src/gallium/frontends/dri/dri_drawable.c
@@ -156,7 +156,6 @@ dri_create_drawable(struct dri_screen *screen, const struct gl_config *visual,
goto fail;
drawable->loaderPrivate = loaderPrivate;
- drawable->ctx = NULL;
drawable->refcount = 1;
drawable->lastStamp = 0;
drawable->w = 0;
diff --git a/src/gallium/frontends/dri/dri_drawable.h b/src/gallium/frontends/dri/dri_drawable.h
index 5d06eaa0cf4..9ee0b88da4c 100644
--- a/src/gallium/frontends/dri/dri_drawable.h
+++ b/src/gallium/frontends/dri/dri_drawable.h
@@ -67,11 +67,6 @@ struct dri_drawable
void *loaderPrivate;
/**
- * Pointer to context to which this drawable is currently bound.
- */
- struct dri_context *ctx;
-
- /**
* Reference count for number of context's currently bound to this
* drawable.
*
diff --git a/src/gallium/frontends/dri/kopper.c b/src/gallium/frontends/dri/kopper.c
index 88a0f99286c..677fe219377 100644
--- a/src/gallium/frontends/dri/kopper.c
+++ b/src/gallium/frontends/dri/kopper.c
@@ -62,10 +62,8 @@ kopper_create_drawable(struct dri_screen *screen, const struct gl_config *visual
static void
kopper_flush_drawable(__DRIdrawable *dPriv)
{
- struct dri_drawable *drawable = dri_drawable(dPriv);
-
- dri_flush(opaque_dri_context(drawable->ctx), dPriv, __DRI2_FLUSH_DRAWABLE,
- -1);
+ dri_flush(opaque_dri_context(dri_get_current()), dPriv,
+ __DRI2_FLUSH_DRAWABLE, -1);
}
static inline void