G550 Dual-head questions
Daniil V. Kolpakov
dan at solutions.lv
Sun Jul 24 12:48:32 PDT 2005
Alex, thanks for the feedback! More questions follow...
> > My thoughts:
> >
> > 1) G550 has videomodes like 2048x768;
> > 2) It's possible to setup the 1024x768 mode with virtual size
> > of 2048x768 in the clone mode; DRI&xv works
> > 3) mga driver can do dual-head, so I guess it could program both heads
> > to use the same framebuffer, with different viewports?
>
> Exactly. that bascially all mergedfb is. One big framebuffer with
> two viewports looking into it. You'll need to program both crtcs and
> write an adjustframe() function to handle the crtc offsets. One
> possible limitation is the max coordinates size handled by the drawing
> engine. The size of your merged desktop will be limited by the max
> size your drawing engine can handle.
[...]
> the easiest way to start messing with dualhead, IMHO, is to try and
> get the first instance of the driver to initialize the proper mode on
> each crtc. Just start out with a cloned desktop. Once you get that
> create a large virtual desktop and hack the adjustframe() function to
> set the crtc offsets to different values. then work from there to
> integrate some of the other more advanced features.
Actually, I've started with something like that;
In the end of the MGAScreenInit() in mga_driver.c, where the viewport is set,
I've added the following:
pScrn->AdjustFrame(scrnIndex, pScrn->frameX0, pScrn->frameY0, 0);
/*dan*/
xf86DrvMsg(scrnIndex, X_ERROR,
"pScrn->virtualX: %d, pScrn->virtualY: %d\n",
pScrn->virtualX, pScrn->virtualY);
xf86DrvMsg(scrnIndex, X_ERROR, "frameX1-frameX0+1: %d\n",
pScrn->frameX1-pScrn->frameX0+1);
if(pScrn->frameX1 - pScrn->frameX0 + 1 == (pScrn->virtualX) / 2){
MGAAdjustFrameCrtc2(0, (pScrn->virtualX) / 2, 0, 0);
MGAAdjustFrame(0, 0, 0, 0);
}
/*\dan*/
The first "pScrn->AdjustFrame()" line is the original code. Then, I check if
the setup is 1024x768/2048x768-virtual, and call different adjustFrame()'s,
for the first and the second SRTC. The xorg.conf used has:
Section "Screen"
[...]
Subsection "Display"
Depth 24
Virtual 2048 768
Modes "1024x768"
EndSubsection
[...]
and
Section "ServerLayout"
Identifier "layout1"
InputDevice "Keyboard1" "CoreKeyboard"
InputDevice "Mouse1" "CorePointer"
Screen "screen1"
EndSection
That is, a single-head (or clone) config.
So, when I've made mentioned change to the driver, I've found that both
MGAAdjustFrameCrtc2() and MGAAdjustFrame() operate on both heads. The code
results in moving the viewport to the start of the framebuffer (both heads),
and if I comment out MGAAdjustFrame(), leaving just MGAAdjustFrameCrtc2(),
viewport is set to the end (the part from the right) of the framebuffer, on
both heads again. MGAAdjustFrameCrtc2()/MGAAdjustFrame() do the same thing.
Why? I guess that's because the card is set into the clone mode. How to setup
the card so it allowed separate viewport adjustment? I guess, MGAGRestore()
from the mga_dacG.c can do that, but I don't know how to call it correctly.
> Take a look at the sis driver too. Thomas has done most of the
> mergedfb pioneering. In the radeon driver, I separated out most of
> the mergedfb stuff into radeon_mergedfb.c/h when I added mergedfb
> support to radeon. If you have any questions along the way feel free
> to ask. I'd be happy to explain anything you have questions about.
Thanks alot!
For a start, do any documentation on the driver writing exist? I need to
understand the order in which the initialisation takes place (and the order
in which functions from mga_driver.c are called).
--
/dev/brains: permission denied
Please avoid sending me Word or PowerPoint attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html
More information about the xorg
mailing list