Replace instances of irb->region = region with intel_region_reference(&irb->region, region)
Signed-off-by: Chad Versace <c...@chad-versace.us> --- src/mesa/drivers/dri/intel/intel_fbo.c | 49 ++++++++++++++++++------------- 1 files changed, 28 insertions(+), 21 deletions(-) diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c index e7c23f0..76c84a8 100644 --- a/src/mesa/drivers/dri/intel/intel_fbo.c +++ b/src/mesa/drivers/dri/intel/intel_fbo.c @@ -184,33 +184,40 @@ intel_alloc_renderbuffer_storage(struct gl_context * ctx, struct gl_renderbuffer * If we neglect to double the pitch, then drm_intel_gem_bo_map_gtt() * maps the memory incorrectly. */ - irb->region = intel_region_alloc(intel->intelScreen, - I915_TILING_Y, - cpp * 2, - width, - height / 2, - GL_TRUE); + struct intel_region *region = intel_region_alloc(intel->intelScreen, + I915_TILING_Y, + cpp * 2, + width, + height / 2, + true); + if (!region) { + return false; + } + intel_region_reference(&irb->region, region); + } else { - irb->region = intel_region_alloc(intel->intelScreen, tiling, cpp, - width, height, GL_TRUE); + struct intel_region *region = + intel_region_alloc(intel->intelScreen, tiling, cpp, + width, height, true); + if (!region) { + return false; + } + intel_region_reference(&irb->region, region); } - if (!irb->region) - return GL_FALSE; /* out of memory? */ - - ASSERT(irb->region->buffer); - if (intel->vtbl.is_hiz_depth_format(intel, rb->Format)) { - irb->hiz_region = intel_region_alloc(intel->intelScreen, - I915_TILING_Y, - irb->region->cpp, - irb->region->width, - irb->region->height, - GL_TRUE); - if (!irb->hiz_region) { + struct intel_region *hiz_region = + intel_region_alloc(intel->intelScreen, + I915_TILING_Y, + irb->region->cpp, + irb->region->width, + irb->region->height, + true); + if (!hiz_region) { intel_region_release(&irb->region); - return GL_FALSE; + return false; } + intel_region_reference(&irb->hiz_region, hiz_region); } rb->Width = width; -- 1.7.5.2 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev