etnaviv-gpu 134000.gpu: MMU fault status 0x00000002 on i.XM6 Quad Plus

Luís Mendes luis.p.mendes at gmail.com
Fri Nov 3 10:52:16 UTC 2017


Correction we just had 3 MMU faults, not 4.
The faults only occur when clip->y2 == 24, or clip->y2 == 27, but
vSrc.height==768.

It is probably not clipping just 24 or 27 pixels, but trying instead to
clip the full 768 height pixels.

The complete circumvent conditions for the faults are these ones...
    if (clip->x2 == 1024 && clip->y2 == 24) {
        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",
            clip->x1, clip->y1, vSrc->width, vSrc->height, drawable->x,
drawable->y, src_offset.x, src_offset.y);
        if (vSrc->height == 768) {
            goto fallback;
        }
    }

    if (clip->x2 == 1024 && clip->y2 == 27) {
        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",
            clip->x1, clip->y1, vSrc->width, vSrc->height, drawable->x,
drawable->y, src_offset.x, src_offset.y);
        if (vSrc->height == 768) {
            goto fallback;
        }
    }


On Fri, Nov 3, 2017 at 10:45 AM, Luís Mendes <luis.p.mendes at gmail.com>
wrote:

> Hi Russel,
>
> I was able to identify and circumvent the root cause of the MMU faults. We
> had 4 MMU faults, it seems.
> Each one for each of these conditions:
> Nov  3 10:26:26 picolo xf86_armada[1271]: A: clip[x1=0,y1=0],
> vSrc[w=1024,h=768], drawable[x=0,y=0], src_offset[x=0,y=0}
> Nov  3 10:26:26 picolo xf86_armada[1271]: A: clip[x1=0,y1=0],
> vSrc[w=1024,h=768], drawable[x=0,y=0], src_offset[x=0,y=0}
> Nov  3 10:26:29 picolo xf86_armada[1271]: B: clip[x1=0,y1=0],
> vSrc[w=1024,h=768], drawable[x=0,y=0], src_offset[x=0,y=0}
> Nov  3 10:26:32 picolo xf86_armada[1271]: B: clip[x1=0,y1=0],
> vSrc[w=1024,h=27], drawable[x=0,y=0], src_offset[x=0,y=0}
>
> The modified etnaviv_render.c - etnaviv_acquire_src(...), that is able to
> circumvent the MMU faults and generate the above log is this one (changes
> in bold):
> static struct etnaviv_pixmap *etnaviv_acquire_src(ScreenPtr pScreen,
>     PicturePtr pict, const BoxRec *clip, PixmapPtr *ppPixTemp,
>     xPoint *src_topleft, Bool force_vtemp)
> {
>     struct etnaviv *etnaviv = etnaviv_get_screen_priv(pScreen);
>     struct etnaviv_pixmap *vSrc, *vTemp;
>     struct etnaviv_blend_op copy_op;
>     DrawablePtr drawable;
>     uint32_t colour;
>     xPoint src_offset;
>     int tx, ty;
>
>     if (etnaviv_pict_solid_argb(pict, &colour)) {
>         vTemp = etnaviv_get_scratch_argb(pScreen, ppPixTemp,
>                          clip->x2, clip->y2);
>         if (!vTemp)
>             return NULL;
>
>         if (!etnaviv_fill_single(etnaviv, vTemp, clip, colour))
>             return NULL;
>
>         src_topleft->x = 0;
>         src_topleft->y = 0;
>         return vTemp;
>     }
>
>     drawable = pict->pDrawable;
>     vSrc = etnaviv_drawable_offset(drawable, &src_offset);
>     if (!vSrc)
>         goto fallback;
>
>     if (vSrc->width < clip->x2 || vSrc->height < clip->y2)
>         goto fallback;
>
>     etnaviv_set_format(vSrc, pict);
>     if (!etnaviv_src_format_valid(etnaviv, vSrc->pict_format))
>         goto fallback;
>
>     if (!transform_is_integer_translation(pict->transform, &tx, &ty))
>         goto fallback;
>
>     if (picture_needs_repeat(pict, src_topleft->x + tx, src_topleft->y +
> ty,
>                  clip->x2, clip->y2))
>         goto fallback;
>
>
>
>     src_topleft->x += drawable->x + src_offset.x + tx;
>     src_topleft->y += drawable->y + src_offset.y + ty;
>     if (force_vtemp) {
>         goto copy_to_vtemp;
>     }
>
>
>
>
>
>
>
>
>
>
>
>
> *    if (clip->x2 == 1024 && clip->y2 == 24) {        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",             clip->x1, clip->y1, vSrc->width,
> vSrc->height, drawable->x, drawable->y, src_offset.x, src_offset.y);
> goto fallback;    }    if (clip->x2 == 1024 && clip->y2 == 27) {
> 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",             clip->x1,
> clip->y1, vSrc->width, vSrc->height, drawable->x, drawable->y,
> src_offset.x, src_offset.y);        goto fallback;    }*
>     return vSrc;
>    ...
>
>
> On Fri, Nov 3, 2017 at 9:12 AM, Luís Mendes <luis.p.mendes at gmail.com>
> wrote:
>
>> Hi Russell,
>>
>> Great news! The issue we were getting with copyNtoN(...) is just a side
>> effect of etnaviv_render.c - etnaviv_acquire_src().
>> The root cause of the MMU falts is etnaviv_render.c -
>> etnaviv_acquire_src().
>>
>> I have enabled copyNtoN(...), but made etnaviv_acquire_src(...) always go
>> to fallback and now I am able to log into Ubuntu MATE without any MMU
>> faults.
>> I will include debug logs and get back with them.
>>
>>  static struct etnaviv_pixmap *etnaviv_acquire_src(ScreenPtr pScreen,
>>         PicturePtr pict, const BoxRec *clip, PixmapPtr *ppPixTemp,
>>         xPoint *src_topleft, Bool force_vtemp)
>> {
>>         struct etnaviv *etnaviv = etnaviv_get_screen_priv(pScreen);
>>         struct etnaviv_pixmap *vSrc, *vTemp;
>>         struct etnaviv_blend_op copy_op;
>>         DrawablePtr drawable;
>>         uint32_t colour;
>>         xPoint src_offset;
>>         int tx, ty;
>>
>>         goto fallback;
>>         ...
>>
>> Luis
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/etnaviv/attachments/20171103/7a36929f/attachment.html>


More information about the etnaviv mailing list