summaryrefslogtreecommitdiff
path: root/src/gallium/state_trackers/dri
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/state_trackers/dri')
-rw-r--r--src/gallium/state_trackers/dri/dri_context.c12
-rw-r--r--src/gallium/state_trackers/dri/dri_drawable.c8
2 files changed, 15 insertions, 5 deletions
diff --git a/src/gallium/state_trackers/dri/dri_context.c b/src/gallium/state_trackers/dri/dri_context.c
index 908cef454e..2f991c39e3 100644
--- a/src/gallium/state_trackers/dri/dri_context.c
+++ b/src/gallium/state_trackers/dri/dri_context.c
@@ -128,7 +128,7 @@ dri_unbind_context(__DRIcontext * cPriv)
if (--ctx->bind_count == 0) {
if (ctx->st && ctx->st == st_get_current()) {
st_flush(ctx->st, PIPE_FLUSH_RENDER_CACHE, NULL);
- st_make_current(NULL, NULL, NULL);
+ st_make_current(NULL, NULL, NULL, NULL);
}
}
}
@@ -161,7 +161,13 @@ dri_make_current(__DRIcontext * cPriv,
ctx->r_stamp = driReadPriv->lastStamp - 1;
}
- st_make_current(ctx->st, draw->stfb, read->stfb);
+ /* DRI co-state tracker currently overrides flush_frontbuffer.
+ * When this is fixed, will need to pass the drawable in the
+ * fourth parameter here so that when Mesa calls
+ * flush_frontbuffer directly (in front-buffer rendering), it
+ * will have access to the drawable argument:
+ */
+ st_make_current(ctx->st, draw->stfb, read->stfb, NULL);
if (__dri1_api_hooks) {
dri1_update_drawables(ctx, draw, read);
@@ -170,7 +176,7 @@ dri_make_current(__DRIcontext * cPriv,
ctx->pipe->priv);
}
} else {
- st_make_current(NULL, NULL, NULL);
+ st_make_current(NULL, NULL, NULL, NULL);
}
return GL_TRUE;
diff --git a/src/gallium/state_trackers/dri/dri_drawable.c b/src/gallium/state_trackers/dri/dri_drawable.c
index 173f4041c8..458473853c 100644
--- a/src/gallium/state_trackers/dri/dri_drawable.c
+++ b/src/gallium/state_trackers/dri/dri_drawable.c
@@ -58,6 +58,7 @@ dri_surface_from_handle(struct drm_api *api,
struct pipe_surface *surface = NULL;
struct pipe_texture *texture = NULL;
struct pipe_texture templat;
+ struct winsys_handle whandle;
memset(&templat, 0, sizeof(templat));
templat.tex_usage |= PIPE_TEXTURE_USAGE_RENDER_TARGET;
@@ -68,8 +69,11 @@ dri_surface_from_handle(struct drm_api *api,
templat.width0 = width;
templat.height0 = height;
- texture = api->texture_from_shared_handle(api, screen, &templat,
- "dri2 buffer", pitch, handle);
+ memset(&whandle, 0, sizeof(whandle));
+ whandle.handle = handle;
+ whandle.stride = pitch;
+
+ texture = screen->texture_from_handle(screen, &templat, &whandle);
if (!texture) {
debug_printf("%s: Failed to blanket the buffer with a texture\n", __func__);