intel: fix un-blanced map_refcount issue
authorYuanhan Liu <yuanhan.liu@linux.intel.com>
Tue, 27 Mar 2012 07:41:52 +0000 (15:41 +0800)
committerYuanhan Liu <yuanhan.liu@linux.intel.com>
Wed, 28 Mar 2012 01:51:38 +0000 (09:51 +0800)
This is a regression introduced by commit cdcfd5, which forget to
increase the map_refcount for successfully-mapped region. Thus caused a
wrong non-blanced map_refcount.

This would fix the regression found in the two following webglc testcase
on Pineview platform:
   texture-npot.html
   gl-max-texture-dimensions.html

Cc: Anuj Phogat <anuj.phogat@gmail.com>
Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
src/mesa/drivers/dri/intel/intel_regions.c

index d2b737b86c50ddf239669a7188aac58359c3cfbf..abea2bd0f710fdfd12840f238a0a2c59f00e4e1b 100644 (file)
@@ -133,10 +133,10 @@ intel_region_map(struct intel_context *intel, struct intel_region *region,
         drm_intel_bo_map(region->bo, true);
 
       region->map = region->bo->virtual;
-      if (region->map) {
-         intel->num_mapped_regions++;
-         region->map_refcount++;
-      }
+   }
+   if (region->map) {
+      intel->num_mapped_regions++;
+      region->map_refcount++;
    }
 
    return region->map;