About ExaOffscreenDefragment in Geode LX platform Rotate operation
madman2003 at gmail.com
Mon Jun 21 10:12:41 PDT 2010
2010/6/21 Cui, Hunk <Hunk.Cui at amd.com>:
> Hi, Maarten & Michel
> Thanks for your reminder about the exaAllocOffscreen, now I try to modify the memorySize. Meet some question. Please see below:
> 1). Can you explain ExaOffscreenDefragment -> prev->offset? When do the rotate operation, where is triggered this function and what is the prev->offset value?
I think ExaOffscreenDefragment is triggered from the block handler
(but i didn't check).
> 2). Now I add the memorySize length(+1) when lx_crtc_shadow_allocate, after rotate normal, subtract the former memorySize length(-1) when lx_crtc_shadow_destroy. I have been used this methods to test the Geode LX platform for two days, It can properly rotate in Xserver 1.8 and 1.7. Because I have some confuse on memorysize, so I want to ask you whether this approach is correct. I can not explain too specific. Can you explain it?
Don't change memorySize (it should include the size you previously
subtracted for rotatedData), do exaOffscreenAlloc at the beginning if
you want to be 100% sure there is space. But i think only the
frontbuffer is fixed memory, the rest will be kicked out if needed.
> Hunk Cui
> -----Original Message-----
> From: Maarten Maathuis [mailto:madman2003 at gmail.com]
> Sent: Tuesday, June 15, 2010 3:54 AM
> To: Cui, Hunk
> Cc: Michel Dänzer; xorg-devel at lists.x.org; xorg-driver-geode at lists.x.org
> Subject: Re: Who can explain the diff between Xserver-1.6.4 version and >1.7 version about the ExaGetPixmapAddress?
> 2010/6/14 Cui, Hunk <Hunk.Cui at amd.com>:
>> Hi, Maarten & Michel,
>> Before 08/2008, our Geode-LX driver were use exaAllocOffscreen, but for update to Randr 1.2, Jordan Crouse replace exaAllocOffscreen with GeodeAllocOffscreen, now Jordan Crouse have been leave AMD, So I can not trace the change log.
>> About the change, you can see: http://cgit.freedesktop.org/xorg/driver/xf86-video-geode/commit/?id=d681a844e448712a9a419d2a4dca81930d39a80a
>> (It have been delete exaAllocOffscreen)
>> As you said Rotateddata has to be allocated between memoryBase and memorySize. Can you afford a structure of exaAllocOffscreen in another video-driver? How to allocate the memory in InitMemory? (e.g: ATI driver), then I can compare the diff.
>> I think the GeodeAllocOffscreen have been use for more than two years, It can always properly allocate memory. Now because the Xserver have been updated to >1.7 version, delete sys_ptr in exaGetPixmapOffset, therefore, cause this error.
> You relied on behaviour that shouldn't have been defined in the first
> place, we have given hints how to do it properly that will work in all
> versions. One example of how exaAllocOffscreen is used can be found
> here http://cgit.freedesktop.org/xorg/driver/xf86-video-ati/tree/src/radeon_legacy_memory.c#n50.
> area->offset is relative to memoryBase.
>> Hunk Cui
>> -----Original Message-----
>> From: Michel Dänzer [mailto:michel at daenzer.net]
>> Sent: Monday, June 14, 2010 3:26 PM
>> To: Maarten Maathuis
>> Cc: Cui, Hunk; xorg-devel at lists.x.org; xorg-driver-geode at lists.x.org
>> Subject: Re: Who can explain the diff between Xserver-1.6.4 version and >1.7 version about the ExaGetPixmapAddress?
>> On Son, 2010-06-13 at 16:10 +0200, Maarten Maathuis wrote:
>>> 2010/6/13 Cui, Hunk <Hunk.Cui at amd.com>:
>>> > Hi, Maarten,
>>> > In our xf86-video-geode driver, all of memories are allocated by GeodeAllocOffscreen, the exa offscreen memory is part of the memorySize. And the rotation data is not in memorySize, it is allocated after memorySize.
>>> This is exactly the reason why exa doesn't recognize it. Rotateddata
>>> has to be allocated between memoryBase and memorySize. Only
>>> exaAllocOffscreen can do that.
>>> > About the GeodeAllocOffscreen, it is Data structure tables, why you said "allocate exa offscreen memory out of a private pool"? What the diff between GeodeAllocOffscreen and exaOffscreen? In exaOffscreenInit, the EXA offscreen base and size are loaded into server, so the exa should recognize it as offscreen memory, furthermore, the ratate_memory(2MB) is not included in EXA offscreen space.
>>> > That "pPixData - pExaScr->info->memoryBase = pExaScr->info->memorySize" should right.
>>> Just because it's right for your driver doesn't mean it's right
>>> everywhere (the memory after memorySize could belong to another device
>>> for example). Classic exa is made on the assumption that all memory
>>> usable for gpu acceleration is a linear range between memoryBase and
>>> memorySize. If you don't want this limitation then you should move to
>>> another type of exa where the driver has more control.
>>> I just don't see why you cannot use exaAllocOffscreen for rotatedData,
>>> that's what every driver has done and it works last i tried.
>>> What you have proposed so far is just a hack that will never be added.
>> Agreed. The geode driver should either allocate the memory with
>> exaOffscreenAlloc() or not rely on EXA facilities like
>> exaGetPixmapOffset() in the PixmapIsOffscreen driver hook.
>> Earthling Michel Dänzer | http://www.vmware.com
>> Libre software enthusiast | Debian, X and DRI developer
> Life spent, a precious moment, in the wink of an eye we live and we die.
Life spent, a precious moment, in the wink of an eye we live and we die.
More information about the xorg-devel