[Nouveau] [Bug 15792] nv04 (TNT2) video blitter problem.

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Mon Jan 19 13:53:24 PST 2009


--- Comment #10 from Stuart Bennett <sb476 at cam.ac.uk>  2009-01-19 13:53:23 PST ---
Created an attachment (id=22105)
 --> (http://bugs.freedesktop.org/attachment.cgi?id=22105)
patch which avoids passing sysmem addresses to the gpu when dest pixmap cannot
be migrated into offscreen memory

I've reproduced this by hobbling my card to believe it only has 16Mb VRAM. 
Under such a constraint the pNv->FB bo is only 8Mb, and with a larger virtual
size it is used up with the viewable FB, leaving little (or no) room for EXA
offscreen allocation (the viewable FB being pinned such that EXA can't migrate
it out for obvious reasons).

Into this scenario the blitter comes with a large screen-sized destination
pixmap.  The PutImage hook in nouveau_xv.c tries to ensure that the pixmap is
in offscreen memory:

/* Ensure pixmap is in offscreen memory */

and later ppix is passed to OUT_PIXMAPl where a relocation is performed. 
Sadly, the migration has failed (insufficient available space as the fullscreen
pixmap is large) and a sys mem address is passed in at the relocation, and the
GPU subsequently barfs.

The attached patch checks if the call to exaMoveInPixmap is successful by
if (exaGetPixmapOffset(ppix) >= pNv->FB->size)
which gets the offset in memory of the pixmap from the start of pNv->FB->map;
if the pixmap offset is less than the size of pNv->FB it is necessarily in
offscreen memory.  This is the same test as applied in exaPixmapIsOffscreen,
which only recently was exported as xorg api as exaDrawableIsOffscreen and
hence cannot be used while maintaining compat with older xservers.  A call to
the driver-supplied IsOffscreen function is included for the
NOUVEAU_EXA_PIXMAPS case.  By returning BadAlloc here the XV client gets the
error and no invalid memory locations reach the GPU.

After some further investigation whether this can/should be caught earlier, it
seems to me it can't, as exaOffscreenAlloc is only called by exaDoMoveInPixmap
which is the migration function.  In the event that exaOffscreenAlloc fails,
exaDoMoveInPixmap simply returns, and as a void function no indication is given
of the failure.  I'd welcome being told I've misunderstood this though.

Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

More information about the Nouveau mailing list