i965: Remove early release of DRI2 miptree
authorChris Wilson <chris@chris-wilson.co.uk>
Fri, 7 Aug 2015 20:13:12 +0000 (21:13 +0100)
committerMartin Peres <martin.peres@linux.intel.com>
Wed, 30 Sep 2015 07:52:30 +0000 (10:52 +0300)
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 <chris@chris-wilson.co.uk>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=86281
Reviewed-by: Martin Peres <martin.peres@linux.intel.com>
Reviewed-by: Chad Versace <chad.versace@intel.com>
src/mesa/drivers/dri/i965/brw_context.c

index 9dcdaf5cd4fe6076ed3ef0b9ed934e71127c26f3..4d499295730288eb9e407379d45626ea93dc1eb0 100644 (file)
@@ -1436,7 +1436,6 @@ intel_process_dri2_buffer(struct brw_context *brw,
               buffer->cpp, buffer->pitch);
    }
 
-   intel_miptree_release(&rb->mt);
    bo = drm_intel_bo_gem_create_from_name(brw->bufmgr, buffer_name,
                                           buffer->name);
    if (!bo) {