[ltp] ATI Rage mobility dual-head support (was: x20 questions)

Alex Deucher linux-thinkpad@linux-thinkpad.org
Sun, 31 Jul 2005 15:34:13 -0400


On 7/31/05, Rolf Leggewie <no2spam@nospam.arcornews.de> wrote:
> Alex Deucher wrote:
>=20
> > no, they are all variations on the same chip.  All of the mach64 based
> > rage mobility support dualhead.
>=20
> You said elsewhere that root access would not be sufficient.  Dual-head
> support would be an important feature for me so obviously I want to help
> out in any way I can.  Call me naive and I hope I am not wasting your
> time but maybe we can still get something going.  Three things I was
> considering.
>=20
> 1) Do you happen to know by chance someone in Europe involved in x.org
>     dual head work?

I know there are some Xorg developers in Europe, but whether or not
they would be interested in writign the driver or have the specs to do
it, I don't know.

> 2) root access coupled with a webcam so you can see what is going on.  I
>     understand and fully appreciate this would be tedious for you.  I'd
>     be willing to leave this running 24/7 so you can work in your pace.
> 3) I assume video graphics programming is very low-level, dig-down-deep
>     kind of stuff.  But maybe there is some kind of way we can work on
>     this together by you sharing some of your knowledge with me.  I am
>     afraid this might be tedious for you as well ;-)

yeah...I don't think it would be really workable.  The problem is it
quite easy to hang the chip or laptop in the process and then it would
need to be rebooted, etc.  I could try and code up some stuff to test
with and have you test and report back, but that tends to be painful
on both sides since you have to wait for feedback both ways.

>=20
> Problem is that I do not even have a grasp about what is involved in
> getting this supported.  Are there specs to be had?  I guess it is not
> just a) write support and b) kill out the bugs, is it?

I have the databooks from ati, but they are under and NDA so I can't share =
them.
Normally, I find it easied to figure out how to get crtc2 programmed
in conjunction with crtc1 (like a clone mode).  once I figure that
out, then I can separate the crtc2 stuff and add support for dualhead.
 Basically you have two display controllers (usually called crtcs for
CRT controllers).  the crtcs can be mapped to one or more outputs such
as a DAC for vga ports or a LVDS contoller for laptop flat panels or a
TMDS controller for DVI ports.  What happens in Xorg is that the
driver loads twice for "regular" dualhead.  the first time through it
sets up the first crtc, the second time through, it sets up the
second.  since there is only one drawing engine, the server has to
sync the engine and change the offset between each head use of it.=20
this works for 2D accel since it is server side only.  it doesn't work
for 3d since right now only the direct rendering case is accelerated.=20
with direct rendering, the 3d client talks directly to the 3d driver
via libGL so there's no way to know which head it's on to change the
3d engine offset.

Mach64 is similar to savage in that the crtc registers are shadowed.=20
basically you flip a bit in one register and program one set of crtc
regs, then flip it back to program the other.  The registers live at
the same offsets though so your mode setup functions can be pretty
similar. you just have to make sure you got the right crtc selected.=20
the problem is mode handling is usually the quirkiest part of graphics
programming so it usually the hardest to get working 100%.

>=20
> BTW, http://www.botchco.com/alex/dualhead/ is your site, isn't it?  Just

yes.

> a stupid question, you always talk about laptops on that site.  What is
> the relation to the normal Mach64?  Are they very similar?
>=20

It's not just laptop, it lists all chips with dualhead support.  I
just so happens that dualhead sort originated in laptop chips so that
they could drive both the LCD and monitor at different refresh rates.=20
The rage mobility, M1, and rage LT pro chips are all based on mach64
core.  As such the 2d and 3d engines and mode controls are all pretty
similar across the line.  hence they are all handled by the same
driver.  The mobile mach64 chips just added a flatpanel controller and
a second crtc.  The M3 and M4 are based on the rage 128 core and m6,
m7, m9, etc. are mobility radeon chips.  It wasn't until the radeon
however that ati actually released a dualhead desktop chip.  The basic
r128 controls are so similar to radeon they really could be handled by
the same driver.  I've though about combining them, but it'd be a lot
of effort for not much gain.

Alex

> regards
>=20
> Rolf
>