<br>On Thu, Mar 15, 2012 at 5:04 PM, nobled <span dir="ltr"><<a href="mailto:nobled@dreamwidth.org">nobled@dreamwidth.org</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 Thu, Mar 15, 2012 at 2:26 PM, Anuj Phogat <<a href="mailto:anuj.phogat@gmail.com">anuj.phogat@gmail.com</a>> wrote:<br>
><br>
><br>
> On Wed, Mar 7, 2012 at 4:28 PM, Anuj Phogat <<a href="mailto:anuj.phogat@gmail.com">anuj.phogat@gmail.com</a>> wrote:<br>
>><br>
>> On Mon 27 Feb 2012 11:45:46 AM PST, 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>I've been testing this since yesterday applied on top of the 8.0<br>
branch, and compiz is still crashing for me (bug 46303).<br></blockquote><div><br></div><div>I haven't tried compiz with this patch. looks like compiz crash (<a href="https://bugs.freedesktop.org//show_bug.cgi?id=46739">Bug 46737</a>)</div>
<div>is a different issue than assertion failure in intel_regions.c line 310 (<a href="https://bugs.freedesktop.org/show_bug.cgi?id=46303">Bug 46303</a>). </div><div>You can look at the <b style="background-color:rgb(255,255,255);color:rgb(102,51,102);font-family:Verdana,sans-serif"><a href="https://bugs.freedesktop.org//attachment.cgi?id=57785" title="View the content of the attachment" style="color:rgb(102,51,102)">ThreadStacktrcace.txt</a> . </b>Last instruction executed on</div>
<div> Thread 1: </div><div>#0 intel_miptree_release (mt=0x220) at intel_mipmap_tree.c:290</div><div> __FUNCTION__ = "intel_miptree_release"</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div class="h5"><br>
>> > ---<br>
>> > src/mesa/drivers/dri/intel/intel_mipmap_tree.c | 26<br>
>> > ++++++++++++++++-------<br>
>> > src/mesa/drivers/dri/intel/intel_regions.c | 7 ++++-<br>
>> > 2 files changed, 23 insertions(+), 10 deletions(-)<br>
>> ><br>
>> > diff --git a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c<br>
>> > b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c<br>
>> > index 5290da4..507702a 100644<br>
>> > --- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c<br>
>> > +++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c<br>
>> > @@ -702,15 +702,20 @@ intel_miptree_map_gtt(struct intel_context *intel,<br>
>> > y /= bh;<br>
>> ><br>
>> > base = intel_region_map(intel, mt->region, map->mode);<br>
>> > - /* Note that in the case of cube maps, the caller must have passed<br>
>> > the slice<br>
>> > - * number referencing the face.<br>
>> > - */<br>
>> > - intel_miptree_get_image_offset(mt, level, 0, slice, &image_x,<br>
>> > &image_y);<br>
>> > - x += image_x;<br>
>> > - y += image_y;<br>
>> ><br>
>> > - map->stride = mt->region->pitch * mt->cpp;<br>
>> > - map->ptr = base + y * map->stride + x * mt->cpp;<br>
>> > + if (base == NULL)<br>
>> > + map->ptr = NULL;<br>
>> > + else {<br>
>> > + /* Note that in the case of cube maps, the caller must have<br>
>> > passed the<br>
>> > + * slice number referencing the face.<br>
>> > + */<br>
>> > + intel_miptree_get_image_offset(mt, level, 0, slice, &image_x,<br>
>> > &image_y);<br>
>> > + x += image_x;<br>
>> > + y += image_y;<br>
>> > +<br>
>> > + map->stride = mt->region->pitch * mt->cpp;<br>
>> > + map->ptr = base + y * map->stride + x * mt->cpp;<br>
>> > + }<br>
>> ><br>
>> > DBG("%s: %d,%d %dx%d from mt %p (%s) %d,%d = %p/%d\n", __FUNCTION__,<br>
>> > map->x, map->y, map->w, map->h,<br>
>> > @@ -1063,6 +1068,11 @@ intel_miptree_map(struct intel_context *intel,<br>
>> ><br>
>> > *out_ptr = map->ptr;<br>
>> > *out_stride = map->stride;<br>
>> > +<br>
>> > + if (map->ptr == NULL) {<br>
>> > + mt->level[level].slice[slice].map = NULL;<br>
>> > + free(map);<br>
>> > + }<br>
>> > }<br>
>> ><br>
>> > void<br>
>> > diff --git a/src/mesa/drivers/dri/intel/intel_regions.c<br>
>> > 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<br>
>> > 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,<br>
>> > 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>
>> ><br>
>> > return region->map;<br>
>><br>
>> Any comments on this patch?<br>
><br>
><br>
> I am planning to push this today.<br>
</div></div>> _______________________________________________<br>
> mesa-dev mailing list<br>
> <a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
> <a href="http://lists.freedesktop.org/mailman/listinfo/mesa-dev" target="_blank">http://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
><br>
</blockquote></div><br>