Radeon MC setup cleanup

Maciej Cencora m.cencora at gmail.com
Fri Feb 29 13:20:28 PST 2008


Jerome Glisse pisze:
> On Fri, 29 Feb 2008 17:31:46 +0100
> Maciej Cencora <m.cencora at gmail.com> wrote:
>
>   
>> Hi all,
>>
>> I'm trying to understand and cleanup MC setup in Radeon DDX driver. 
>> Currently it's overcomplicated and sometimes unreliable.
>>
>> That's how I understand how MC should be setup. Please check if I 
>> understand it correctly.
>>
>> When DRI is disabled, fb/agp locations should not change during whole 
>> session (even when doing VT switch) so there is no need to save/restore 
>> them.
>>
>> Below I describe the cases when DRI is enabled.
>> -- User starts the machine --
>> Initial reg values are set by BIOS.
>>
>> -- User starts X --
>> 1. Store regs in info->SavedReg.
>> 2. Init DRI (it sets new values to fb/agp location regs).
>> 3. Save new fb/agp location values to info->ModeReg.
>>
>> -- User calls LeaveVT --
>> Restore regs from info->SavedReg and do the rest of LeaveVT.
>>
>> -- User backs to X (EnterVT) --
>> Restore regs from info->ModeReg and do the rest of EnterVT.
>>
>> -- User closes X -- (that case is similar to LeaveVT)
>> Restore regs from info->SavedReg and do the rest of LeaveVT.
>>
>>
>> Regards,
>> Maciej Cencora
>>     
>
> What you are outlining is already done see RADEONRestore
> in radeon_driver.c. Or do i misunderstand the problem you
> are trying to solve ?
>
> Note that when X close we call LeaveVT (at least this what
> my memory told me :))
>
> Cheers,
> Jerome Glisse <glisse at freedesktop.org>
>
>   
You misunderstand. I attach the proposed patch. It works for me.

What I do in the patch is:
- use info->ModeReg and info->SavedReg only
- remove info->mc_fb/agp_location, remove RADEONInitMemMapRegisters
- only two places to restore regs for entering and leaving vt (removed
from atombios_crtc_mode_set and legacy_crtc_mode_set)
- set RADEONRestoreMemMapRegisters static
- remove RADEONRestoreMemMapRegisters call in RADEONAdjustMemMapRegisters

There's only one thing to do. Restore/Save memmap regs only when dri is
enabled.

Regards,
Maciej Cencora

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: my2
URL: <http://lists.x.org/archives/xorg/attachments/20080229/24e775ce/attachment.ksh>


More information about the xorg mailing list