<div dir="ltr"><div><div><div><div><div>Sorry for misspelling your name, Russell, wasn't on purpose.<br><br></div>Regarding what you said, the above code is correct, it is not the copy_to_vtemp branch that is causing the MMU faults or screen corruption, but rather when the code of etnaviv_aquire_src(...) runs to the end, returning vSrc.<br></div>For some reason the kernel dump wasn't capturing the correct failure source. Possibly the MMU faults occur a bit after when another operation is being started, I don't know.<br></div>I just can say for sure that the above code does circumvent all the MMU faults I am getting with Ubuntu MATE at 1024x768.<br><br></div>I will try to add the picture_desc() helper for us to get more details regarding the source of the MMU fault condition, will get back soon.<br><br></div>I've refined the code circumvent to this one:<br><span class="gmail-im"> if (clip->x2 == 1024 && clip->y2 == 24) {<br> syslog(LOG_ERR, "A: clip[x1=%d,y1=%d], vSrc[w=%d,h=%d], drawable[x=%d,y=%d], src_offset[x=%d,y=%d}\n", <br>
clip->x1, clip->y1, vSrc->width, vSrc->height,
drawable->x, drawable->y, src_offset.x, src_offset.y);<br></span> if (vSrc->height == 768) {<span class="gmail-im"><br> goto fallback;<br> }<br> }<br><br> if (clip->x2 == 1024 && clip->y2 == 27) {<br> syslog(LOG_ERR, "B: clip[x1=%d,y1=%d], vSrc[w=%d,h=%d], drawable[x=%d,y=%d], src_offset[x=%d,y=%d}\n", <br>
clip->x1, clip->y1, vSrc->width, vSrc->height,
drawable->x, drawable->y, src_offset.x, src_offset.y);<br></span> if (vSrc->height == 768) {<br> goto fallback;<br> }<br> }<div><div><div><div><br></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Nov 3, 2017 at 11:29 AM, Russell King - ARM Linux <span dir="ltr"><<a href="mailto:linux@armlinux.org.uk" target="_blank">linux@armlinux.org.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Fri, Nov 03, 2017 at 10:45:04AM +0000, Luís Mendes wrote:<br>
> Hi Russel,<br>
<br>
</span>"Russell" ;)<br>
<div><div class="h5"><br>
> I was able to identify and circumvent the root cause of the MMU faults. We<br>
> had 4 MMU faults, it seems.<br>
> Each one for each of these conditions:<br>
> Nov 3 10:26:26 picolo xf86_armada[1271]: A: clip[x1=0,y1=0],<br>
> vSrc[w=1024,h=768], drawable[x=0,y=0], src_offset[x=0,y=0}<br>
> Nov 3 10:26:26 picolo xf86_armada[1271]: A: clip[x1=0,y1=0],<br>
> vSrc[w=1024,h=768], drawable[x=0,y=0], src_offset[x=0,y=0}<br>
> Nov 3 10:26:29 picolo xf86_armada[1271]: B: clip[x1=0,y1=0],<br>
> vSrc[w=1024,h=768], drawable[x=0,y=0], src_offset[x=0,y=0}<br>
> Nov 3 10:26:32 picolo xf86_armada[1271]: B: clip[x1=0,y1=0],<br>
> vSrc[w=1024,h=27], drawable[x=0,y=0], src_offset[x=0,y=0}<br>
><br>
> The modified etnaviv_render.c - etnaviv_acquire_src(...), that is able to<br>
> circumvent the MMU faults and generate the above log is this one (changes<br>
> in bold):<br>
> static struct etnaviv_pixmap *etnaviv_acquire_src(ScreenPtr pScreen,<br>
> PicturePtr pict, const BoxRec *clip, PixmapPtr *ppPixTemp,<br>
> xPoint *src_topleft, Bool force_vtemp)<br>
> {<br>
> struct etnaviv *etnaviv = etnaviv_get_screen_priv(<wbr>pScreen);<br>
> struct etnaviv_pixmap *vSrc, *vTemp;<br>
> struct etnaviv_blend_op copy_op;<br>
> DrawablePtr drawable;<br>
> uint32_t colour;<br>
> xPoint src_offset;<br>
> int tx, ty;<br>
><br>
> if (etnaviv_pict_solid_argb(pict, &colour)) {<br>
> vTemp = etnaviv_get_scratch_argb(<wbr>pScreen, ppPixTemp,<br>
> clip->x2, clip->y2);<br>
> if (!vTemp)<br>
> return NULL;<br>
><br>
> if (!etnaviv_fill_single(etnaviv, vTemp, clip, colour))<br>
> return NULL;<br>
><br>
> src_topleft->x = 0;<br>
> src_topleft->y = 0;<br>
> return vTemp;<br>
> }<br>
><br>
> drawable = pict->pDrawable;<br>
> vSrc = etnaviv_drawable_offset(<wbr>drawable, &src_offset);<br>
> if (!vSrc)<br>
> goto fallback;<br>
><br>
> if (vSrc->width < clip->x2 || vSrc->height < clip->y2)<br>
> goto fallback;<br>
><br>
> etnaviv_set_format(vSrc, pict);<br>
> if (!etnaviv_src_format_valid(<wbr>etnaviv, vSrc->pict_format))<br>
> goto fallback;<br>
><br>
> if (!transform_is_integer_<wbr>translation(pict->transform, &tx, &ty))<br>
> goto fallback;<br>
><br>
> if (picture_needs_repeat(pict, src_topleft->x + tx, src_topleft->y + ty,<br>
> clip->x2, clip->y2))<br>
> goto fallback;<br>
><br>
><br>
><br>
> src_topleft->x += drawable->x + src_offset.x + tx;<br>
> src_topleft->y += drawable->y + src_offset.y + ty;<br>
> if (force_vtemp) {<br>
> goto copy_to_vtemp;<br>
> }<br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
</div></div>> * if (clip->x2 == 1024 && clip->y2 == 24) { syslog(LOG_ERR, "A:<br>
<span class="">> clip[x1=%d,y1=%d], vSrc[w=%d,h=%d], drawable[x=%d,y=%d],<br>
> src_offset[x=%d,y=%d}\n", clip->x1, clip->y1, vSrc->width,<br>
> vSrc->height, drawable->x, drawable->y, src_offset.x, src_offset.y);<br>
> goto fallback; } if (clip->x2 == 1024 && clip->y2 == 27) {<br>
> syslog(LOG_ERR, "B: clip[x1=%d,y1=%d], vSrc[w=%d,h=%d],<br>
> drawable[x=%d,y=%d], src_offset[x=%d,y=%d}\n", clip->x1,<br>
> clip->y1, vSrc->width, vSrc->height, drawable->x, drawable->y,<br>
</span>> src_offset.x, src_offset.y); goto fallback; }*<br>
> return vSrc;<br>
> ...<br>
<br>
I'm not sure if the above is what you wanted to send - but I don't read<br>
email using a mailer that understands HTML, so the above is what I saw.<br>
"bold" doesn't work for the plain text part of emails, nor do colours!<br>
<br>
It looks like you added your debugging to the fall-through path, where<br>
we use the provided source picture/drawable. Is that the path that's<br>
giving the problems - I thought the faults were coming from the<br>
etnaviv_render() call from this function, which implies that we need<br>
to be taking the "copy_to_vtemp" branch of the if() statement above.<br>
<br>
Note, it's worth using the picture_desc() helper to print the details<br>
of the PicturePtr - this includes the basic details of the picture,<br>
and the underlying drawable. Also, please include the src_topleft<br>
coordinates - I think you'll find one of those will be 0,-24.<br>
<br>
I think the question is why we're ending up with the source top-left<br>
being 0,-24.<br>
<div class="HOEnZb"><div class="h5"><br>
--<br>
RMK's Patch system: <a href="http://www.armlinux.org.uk/developer/patches/" rel="noreferrer" target="_blank">http://www.armlinux.org.uk/<wbr>developer/patches/</a><br>
FTTC broadband for 0.8mile line in suburbia: sync at 8.8Mbps down 630kbps up<br>
According to <a href="http://speedtest.net" rel="noreferrer" target="_blank">speedtest.net</a>: 8.21Mbps down 510kbps up<br>
</div></div></blockquote></div><br></div></div>