[Nouveau] [Bug 15792] nv04 (TNT2) video blitter problem.
bugzilla-daemon at freedesktop.org
bugzilla-daemon at freedesktop.org
Mon Jan 19 23:06:42 PST 2009
http://bugs.freedesktop.org/show_bug.cgi?id=15792
--- Comment #11 from Stephane Marchesin <marchesin at icps.u-strasbg.fr> 2009-01-19 23:06:41 PST ---
(In reply to comment #10)
> Created an attachment (id=22105)
--> (http://bugs.freedesktop.org/attachment.cgi?id=22105) [details]
> 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 */
> exaMoveInPixmap(ppix);
>
> 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
> testing:
> 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.
>
Ok, indeed it seems we can't catch the failing allocation itself. But still,
doing:
if (exaGetPixmapOffset(ppix) >= pNv->FB->size)
totally assumes that the FB is at the beggining of the EXA area. We've done
such asumptions before and they always break in the end. Is there no other way
?
If all else fails, at least make it check agains FB->size and FB->offset.
--
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