+ Reply to Thread
Results 1 to 10 of 10

Thread: CRTC Programming Info

  1. #1
    Join Date
    May 2009
    Posts
    5

    Default CRTC Programming Info

    Where would one find documentation describing how the set up the CRTC registers using common ModeLine values ?

    The application is non-Linux and uses VESA to set up the graphics mode , but VESA does not support graphics resolutions above 1600x1200.

    Also a question : Is it feasible to intialize the graphics mode using VESA then modify the CRTC registers to set the desired graphics mode?

    Thanks
    Brian

  2. #2
    Join Date
    Oct 2007
    Location
    Toronto-ish
    Posts
    6,087

    Default

    Quote Originally Posted by Brian View Post
    Where would one find documentation describing how the set up the CRTC registers using common ModeLine values ? The application is non-Linux and uses VESA to set up the graphics mode , but VESA does not support graphics resolutions above 1600x1200.
    Which GPU ? Docco for more recent GPUs can be found at http://www.x.org/docs/AMD/. We included a couple of typical GPUs from each generation.

    One way would be to just check the source code in the existing X drivers. The radeon driver (xorg/driver/xf86-video-ati) has hard-coded modesetting from r1xx-r4xx, and the radeonhd driver (xorg/driver/xf86-video-radeonhd) has hard-coded modesetting for 5xx through early 7xx.

    Do you really just need to set CRTC registers or do you need to play with the pixel clock PLL as well ? Changing the clock frequencies is more involved, so you might want to use the X driver source as a reference.

    Quote Originally Posted by Brian View Post
    Also a question : Is it feasible to intialize the graphics mode using VESA then modify the CRTC registers to set the desired graphics mode?
    Probably not -- AFAIK the X driver (vesa in this case) negotiates display resolution with the X server so even if you reprogrammed the registers the X server would still think the screen resolution was unchanged. Then again, if this is an embedded application and you don't have a display server/manager either then I guess maybe this could work.
    Last edited by bridgman; 05-09-2009 at 02:50 PM.

  3. #3
    Join Date
    May 2009
    Posts
    5

    Default

    Thanks.

    Another question. Does Xorg use VESA (Int 10) to establish a "safe mode" graphics mode first , then modify the timing parameters , or does it attempt to go into graphics mode using the chip CRTC registers without using VESA?

    Thanks again
    Brian


    Quote Originally Posted by bridgman View Post
    Which GPU ? Docco for more recent GPUs can be found at http://www.x.org/docs/AMD/. We included a couple of typical GPUs from each generation.

    One way would be to just check the source code in the existing X drivers. The radeon driver (xorg/driver/xf86-video-ati) has hard-coded modesetting from r1xx-r4xx, and the radeonhd driver (xorg/driver/xf86-video-radeonhd) has hard-coded modesetting for 5xx through early 7xx.

    Do you really just need to set CRTC registers or do you need to play with the pixel clock PLL as well ? Changing the clock frequencies is more involved, so you might want to use the X driver source as a reference.



    Probably not -- AFAIK the X driver (vesa in this case) negotiates display resolution with the X server so even if you reprogrammed the registers the X server would still think the screen resolution was unchanged. Then again, if this is an embedded application and you don't have a display server/manager either then I guess maybe this could work.

  4. #4
    Join Date
    Oct 2007
    Location
    Toronto-ish
    Posts
    6,087

    Default

    AFAIK the xorg drivers do not rely on VESA to set the mode first, although it's possible they make unintended assumptions about what was done during the initial POST before the OS came up. The drivers can hit the registers directly, or make AtomBIOS calls, or both.

    If you're not familiar with AtomBIOS, most of the code in our VBIOS ROM image is written in an interpreted bytecode rather than x86 assembler. The BIOS image contains four parts; an x86 wrapper for compatibility, a bytecode interpreter, command tables (code) and data tables.

    As part of the open source graphics project we released 'C' source for the interpreter, the same code we use in our drivers, along with header files (atombios.h etc..) which describe how to find your way around the BIOS internals. We introduced AtomBIOS partway through the 4xx family and used it exclusively from 5xx and up.

  5. #5
    Join Date
    Dec 2007
    Posts
    1,689

    Default

    Quote Originally Posted by Brian View Post
    Thanks.

    Another question. Does Xorg use VESA (Int 10) to establish a "safe mode" graphics mode first , then modify the timing parameters , or does it attempt to go into graphics mode using the chip CRTC registers without using VESA?

    Thanks again
    Brian
    Most xorg drivers don't use int10 at all, they generally program the mode directly. You generally can't just modify the crtc timing parameters, you have to adjust the display pll and possibly encoder/transmitter related bits as well.

  6. #6
    Join Date
    May 2009
    Posts
    5

    Thumbs up

    Quote Originally Posted by agd5f View Post
    Most xorg drivers don't use int10 at all, they generally program the mode directly. You generally can't just modify the crtc timing parameters, you have to adjust the display pll and possibly encoder/transmitter related bits as well.
    Thanks... and a few questions.

    1) What are the basic differences between the two drivers ? :
    Radeaon xf86-video-radeonhd-1.2.5.zip
    ATI xf86-video-ati-6.9.0.tar.gz

    2) Is the ATOMBios driver a stand-alone driver , or does it call the Radeaon functions ?

  7. #7
    Join Date
    Oct 2007
    Location
    Toronto-ish
    Posts
    6,087

    Default

    The two drivers are fairly similar in terms of capabilities these days, but differ in internal structure and detailed feature set.

    The radeonhd driver (xf86-video-radeonhd) mostly uses direct register programming for 5xx and 6xx GPUs, while the radeon driver (xf86-video-ati) uses AtomBIOS calls for 4xx-6xx where possible. Both radeon and radeonhd drivers use AtomBIOS calls for 7xx.

    As of today (this could be different tomorrow), I think the main feature differences are that radeon has tvout support while radeonhd has HDMI audio out. There are probably other important differences but those are the only ones I remember right now.

    The acceleration code in the two drivers is fairly similar; differences are primarily in the modesetting area. Since mode-setting is moving from the X driver into the kernel ("KMS"), we expect that the differences between the drivers will gradually become irrelevant over the next year or so.

    With a bit of luck, we'll be able to replace many of the current X drivers with a generic driver using kernel mode-setting for display and Gallium3D for acceleration.

    BTW 6.9.0 is pretty old for the radeon driver; it's currently at 6.12.2 I think.

  8. #8
    Join Date
    May 2009
    Posts
    5

    Default

    Thanks. That is interesting about the mode-setting moving to the Linux kernel.

    Is that because the mode-setting registers generally remain the same as new graphics controllers are introduced , but the acceleration features may change in the new chips?

  9. #9
    Join Date
    Dec 2007
    Posts
    1,689

    Default

    Quote Originally Posted by Brian View Post
    Thanks. That is interesting about the mode-setting moving to the Linux kernel.

    Is that because the mode-setting registers generally remain the same as new graphics controllers are introduced , but the acceleration features may change in the new chips?
    Main reasons:
    - allows for hi-res consoles
    - allows for separate users on each head of a multi-head card
    - non-X applications can use the hw
    - better suspend/resume support
    - allows you to see kernel oops when X is running
    - run X as non-root user

  10. #10
    Join Date
    May 2009
    Posts
    5

    Default AMD/ATI PLL Documentation

    The old ATI Mach64 cards had very extensive developer manuals detailing how the various functions and registers worked.

    Does anyone have a link or documents which describe how the Radeon series PLL's function , other than the driver source code , as the source code does not have any comments describing the "why".

    Thanks
    Brian

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts