From b904321ed018c661271fb1fc3eefd1af0ec61c7f Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 29 Jun 2011 11:14:23 -0700 Subject: [PATCH] intel: Rely on intel_region_reference()'s support of *dst != NULL. Reviewed-by: Chad Versace --- src/mesa/drivers/dri/i915/i830_vtbl.c | 2 -- src/mesa/drivers/dri/i915/i915_vtbl.c | 2 -- src/mesa/drivers/dri/intel/intel_fbo.c | 13 ------------- src/mesa/drivers/dri/intel/intel_screen.c | 1 - 4 files changed, 18 deletions(-) diff --git a/src/mesa/drivers/dri/i915/i830_vtbl.c b/src/mesa/drivers/dri/i915/i830_vtbl.c index 584df82b50c..7775e71381f 100644 --- a/src/mesa/drivers/dri/i915/i830_vtbl.c +++ b/src/mesa/drivers/dri/i915/i830_vtbl.c @@ -618,11 +618,9 @@ i830_set_draw_region(struct intel_context *intel, uint32_t draw_x, draw_y; if (state->draw_region != color_regions[0]) { - intel_region_release(&state->draw_region); intel_region_reference(&state->draw_region, color_regions[0]); } if (state->depth_region != depth_region) { - intel_region_release(&state->depth_region); intel_region_reference(&state->depth_region, depth_region); } diff --git a/src/mesa/drivers/dri/i915/i915_vtbl.c b/src/mesa/drivers/dri/i915/i915_vtbl.c index 9721a1c0e4d..cd7d108222e 100644 --- a/src/mesa/drivers/dri/i915/i915_vtbl.c +++ b/src/mesa/drivers/dri/i915/i915_vtbl.c @@ -570,11 +570,9 @@ i915_set_draw_region(struct intel_context *intel, uint32_t draw_x, draw_y, draw_offset; if (state->draw_region != color_regions[0]) { - intel_region_release(&state->draw_region); intel_region_reference(&state->draw_region, color_regions[0]); } if (state->depth_region != depth_region) { - intel_region_release(&state->depth_region); intel_region_reference(&state->depth_region, depth_region); } diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c index 90c3909d1d8..ee656edae5b 100644 --- a/src/mesa/drivers/dri/intel/intel_fbo.c +++ b/src/mesa/drivers/dri/intel/intel_fbo.c @@ -277,8 +277,6 @@ intel_image_target_renderbuffer_storage(struct gl_context *ctx, return; irb = intel_renderbuffer(rb); - if (irb->region) - intel_region_release(&irb->region); intel_region_reference(&irb->region, image->region); rb->InternalFormat = image->internal_format; @@ -351,12 +349,7 @@ intel_renderbuffer_set_region(struct intel_context *intel, struct intel_renderbuffer *rb, struct intel_region *region) { - struct intel_region *old; - - old = rb->region; - rb->region = NULL; intel_region_reference(&rb->region, region); - intel_region_release(&old); } @@ -365,10 +358,7 @@ intel_renderbuffer_set_hiz_region(struct intel_context *intel, struct intel_renderbuffer *rb, struct intel_region *region) { - struct intel_region *old = rb->hiz_region; - rb->hiz_region = NULL; intel_region_reference(&rb->hiz_region, region); - intel_region_release(&old); } @@ -572,7 +562,6 @@ intel_update_tex_wrapper_regions(struct intel_context *intel, /* Point the renderbuffer's region to the texture's region. */ if (irb->region != intel_image->mt->region) { - intel_region_release(&irb->region); intel_region_reference(&irb->region, intel_image->mt->region); } @@ -592,7 +581,6 @@ intel_update_tex_wrapper_regions(struct intel_context *intel, /* Point the renderbuffer's hiz region to the texture's hiz region. */ if (irb->hiz_region != intel_image->mt->hiz_region) { - intel_region_release(&irb->hiz_region); intel_region_reference(&irb->hiz_region, intel_image->mt->hiz_region); } @@ -770,7 +758,6 @@ intel_render_texture(struct gl_context * ctx, intel_image->mt = new_mt; intel_renderbuffer_set_draw_offset(irb, intel_image, att->Zoffset); - intel_region_release(&irb->region); intel_region_reference(&irb->region, intel_image->mt->region); } #endif diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c index 2a3a601ddba..bd8d574a29e 100644 --- a/src/mesa/drivers/dri/intel/intel_screen.c +++ b/src/mesa/drivers/dri/intel/intel_screen.c @@ -291,7 +291,6 @@ intel_dup_image(__DRIimage *orig_image, void *loaderPrivate) if (image == NULL) return NULL; - image->region = NULL; intel_region_reference(&image->region, orig_image->region); if (image->region == NULL) { FREE(image); -- 2.30.2