On Tue, Mar 27, 2012 at 12:47 AM, Yuanhan Liu <span dir="ltr"><<a href="mailto:yuanhan.liu@linux.intel.com">yuanhan.liu@linux.intel.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Mon, Feb 27, 2012 at 11:45:46AM -0800, Anuj Phogat wrote:<br>
> This patch handles a case when mapping a large texture fails<br>
> in drm_intel_gem_bo_map_gtt(). These changes avoid assertion<br>
> failure later in the driver as reported in following bugs:<br>
><br>
> <a href="https://bugs.freedesktop.org/show_bug.cgi?id=44970" target="_blank">https://bugs.freedesktop.org/show_bug.cgi?id=44970</a><br>
> <a href="https://bugs.freedesktop.org/show_bug.cgi?id=46303" target="_blank">https://bugs.freedesktop.org/show_bug.cgi?id=46303</a><br>
><br>
> Signed-off-by: Anuj Phogat <<a href="mailto:anuj.phogat@gmail.com">anuj.phogat@gmail.com</a>><br>
> --<br>
</div>[..]<br>
<div class="im">> void<br>
> diff --git a/src/mesa/drivers/dri/intel/intel_regions.c b/src/mesa/drivers/dri/intel/intel_regions.c<br>
> index bc83649..982d6cb 100644<br>
> --- a/src/mesa/drivers/dri/intel/intel_regions.c<br>
> +++ b/src/mesa/drivers/dri/intel/intel_regions.c<br>
> @@ -124,7 +124,7 @@ intel_region_map(struct intel_context *intel, struct intel_region *region,<br>
> */<br>
><br>
> _DBG("%s %p\n", __FUNCTION__, region);<br>
> - if (!region->map_refcount++) {<br>
> + if (!region->map_refcount) {<br>
> intel_flush(&intel->ctx);<br>
><br>
> if (region->tiling != I915_TILING_NONE)<br>
> @@ -133,7 +133,10 @@ intel_region_map(struct intel_context *intel, struct intel_region *region,<br>
> drm_intel_bo_map(region->bo, true);<br>
><br>
> region->map = region->bo->virtual;<br>
> - ++intel->num_mapped_regions;<br>
> + if (region->map) {<br>
> + ++intel->num_mapped_regions;<br>
> + region->map_refcount++;<br>
> + }<br>
> }<br>
</div>Hi Anuj,<br>
<br>
The above change will make the map_refcount un-blanced since you removed<br>
the increase to the successfully mapped region, here is a patch to fix<br>
this issue:<br>
<br>
----<br>