[PATCH] exa: Accept scratch pixmaps with offscreen memory as such.

Michel Dänzer michel at daenzer.net
Thu Mar 19 11:51:32 PDT 2009


On Don, 2009-03-19 at 19:48 +0100, Maarten Maathuis wrote:
> >> >> +         if ((CARD8 *)pPixData >= pExaScr->info->memoryBase &&
> >> >> +             (CARD8 *)pPixData < (pExaScr->info->memoryBase + pExaScr->info->memorySize)) {
> >> >
> >> > (pExaScr->info->memoryBase + pExaScr->info->memorySize) could wrap
> >> > around to 0, in which case the latter check would always fail.
> >>
> >> I don't see how that failure is bad (considering it won't wrap for the
> >> cases that are offscreen).
> >
> > You don't seem to understand: pPixData < 0 is false for any value of
> > pPixData.
> >
> 
> If it folds, then it means that (pExaScr->info->memoryBase +
> pExaScr->info->memorySize) is outside the range of a uint32_t or
> uint64_t, how much sense would a mapped memory range make if it didn't
> fit into address space?

It happens if the memory range is right at the end of address space.

We've been bitten by this in the radeon DRM before. :}


-- 
Earthling Michel Dänzer           |                http://www.vmware.com
Libre software enthusiast         |          Debian, X and DRI developer


More information about the xorg-devel mailing list