Radeon MC setup cleanup
Alex Deucher
alexdeucher at gmail.com
Sun Mar 2 11:12:26 PST 2008
On Fri, Feb 29, 2008 at 4:20 PM, Maciej Cencora <m.cencora at gmail.com> wrote:
> 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
>
I committed a variation on this patch:
- don't need to restore memmap on each mode set
- don't need two copies of the mc regs stored in the driver
Alex
More information about the xorg
mailing list