File U_i965-Remove-early-release-of-DRI2-miptree.patch of Package Mesa.13451

From: Chris Wilson <>
Date: Fri Aug 7 21:13:12 2015 +0100
Subject: [PATCH]i965: Remove early release of DRI2 miptree
Patch-mainline: Upstream
Git-commit: 70e91d61fde239e8ae58148cacd4ff891126e2aa
Git-repo: git://
References: boo#945444
Signed-off-by: Egbert Eich <>

intel_update_winsys_renderbuffer_miptree() will release the existing
miptree when wrapping a new DRI2 buffer, so we can remove the early
release and so prevent a NULL mt dereference should importing the new
DRI2 name fail for any reason. (Reusing the old DRI2 name will result
in the rendering going astray, to a stale buffer, and not shown on the
screen, but it allows us to issue a warning and not crash much later in
innocent code.)

Signed-off-by: Chris Wilson <>
Reviewed-by: Martin Peres <>
Reviewed-by: Chad Versace <>
 Mesa-10.0.3/src/mesa/drivers/dri/i965/brw_context.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Mesa-10.0.3/src/mesa/drivers/dri/i965/brw_context.c b/Mesa-10.0.3/src/mesa/drivers/dri/i965/brw_context.c
index 4fc83df..88158aa 100644
--- a/src/mesa/drivers/dri/i965/brw_context.c
+++ b/src/mesa/drivers/dri/i965/brw_context.c
@@ -1287,7 +1287,6 @@ intel_process_dri2_buffer(struct brw_context *brw,
               buffer->cpp, buffer->pitch);
-   intel_miptree_release(&rb->mt);
    region = intel_region_alloc_for_handle(brw->intelScreen,
@@ -1298,6 +1297,7 @@ intel_process_dri2_buffer(struct brw_context *brw,
    if (!region)
+   intel_miptree_release(&rb->mt);
    rb->mt = intel_miptree_create_for_dri2_buffer(brw,
openSUSE Build Service is sponsored by