Jump to content

The ATI 1Hz driver


jalavoui
 Share

1 post in this topic

Recommended Posts

I've made this driver from old RadeonHD source code.

 

 

It as a lot of features, but in short:

 

- Set 1hz frequency when using 2 displays will turn the screen off

- Acceleration is not suported atm

etc, etc

 

 

Goal is to update the source code for other unsuported ATI cards

 

To use the driver you will need to:

 

- turn debug on in info.plist (0-4)

- check debug log 4 your card connectors

- use xcode to rebuild the driver with your card specs

 

e.g.: my connection string (ATI 4200 AGP) in rhd_id.c is

#define VGA_4200 \

{{ RHD_CONNECTOR_VGA, "VGA CRT1", RHD_DDC_0, RHD_HPD_NONE, { RHD_OUTPUT_DACA, RHD_OUTPUT_NONE }}, \
{RHD_CONNECTOR_PANEL, "LVDS LCD1", RHD_DDC_1, RHD_HPD_NONE, { RHD_OUTPUT_KLDSKP_LVTMA, RHD_OUTPUT_NONE }},   \
{RHD_CONNECTOR_DVI_SINGLE, "PCIE_CONNECTOR DFP1", RHD_DDC_3, RHD_HPD_0, {RHD_OUTPUT_UNIPHYA, RHD_OUTPUT_NONE }}}

If you manage to make it work with your card plz share it here so others can use it

 

 

 

Update 01:

 

forgot to mention the .kext was build on 10.8.3 and that all test where done in legacy mode, i.e., no uefi bios

 

I've add a feature to options that allows to load and test a bios (check in info.plist UserBios)

 

Also add a script that resets video preferences. place it at "/" folder and type ./7 to reset video settings. if u dont use root account edit it and change to /Users/xxx folder

 

Another great tool that allows do dump the bios is atomdis (also attached)

 

To remove the 500 log limit in kernel your can use the com.apple.syslogd

 

 

Acceleration or the so called exotic patch depends on your card type. check the ATIRadeonX2000 function if u playing with it

int ATIRadeonX2000HWFactory__createAMDHardware
{
      ATIRadeonX2000AMDRV630Hardware__ATIRadeonX2000AMDRV630Hardware();
      ATIRadeonX2000AMDRV710Hardware__ATIRadeonX2000AMDRV710Hardware();
      ATIRadeonX2000AMDRV670Hardware__ATIRadeonX2000AMDRV670Hardware();
      ATIRadeonX2000AMDRV770Hardware__ATIRadeonX2000AMDRV770Hardware();
      ATIRadeonX2000AMDRV730Hardware__ATIRadeonX2000AMDRV730Hardware();
      ATIRadeonX2000AMDRV610Hardware__ATIRadeonX2000AMDRV610Hardware();
}

Altought you can get the enconders and transmiters from bios all that won't work if u dont check how the driver handles this info. Check the 4600 controllers code

int AtiAtomBiosPllInterface::getTransmitterIdStr(unsigned char)(int arg0) {
    if (LOBYTE(rsi) == 0x14) {
            rax = "DVO";
    }
    else {
            if (LODWORD(rsi) != 0x15) {
                    if (LODWORD(rsi) == 0x1e) {
                            rax = "UNIPHY";
                    }
                    else {
                            rax = "N/A";
                    }
            }
            else {
                    rax = "DAC";
            }
    }
    return rax;
}

int AtiAtomBiosUtilities::getEncoderIdStr(unsigned int)(unsigned int arg0) {

        case 0:
        goto loc_22edc
        case 1:
        goto loc_22ee5
        case 2:
        goto loc_22eec
        case 3:
        goto loc_22ed3
        case 4:
        goto loc_22ea6
        case 5:
        goto loc_22eaf
        case 6:
        goto loc_22eb8
        case 7:
        goto loc_22ec1
        case 8:
        goto loc_22eca


loc_22edc:
    rax = "DAC:A";
    goto loc_22eec;

loc_22ed3:
    rax = "DAC:B";
    goto loc_22eec;

loc_22ea6:
    rax = "DIG:B";
    goto loc_22eec;

loc_22eaf:
    rax = "DIG:C";
    goto loc_22eec;

loc_22eb8:
    rax = "DIG:D";
    goto loc_22eec;

loc_22ec1:
    rax = "DIG:E";
    goto loc_22eec;

loc_22eca:
    rax = "DIG:F";
    goto loc_22eec;
}

Funny thing is the following function (you can find some of this addresses in radeonhd source code). This is how mac os x drivers do their job

int RV730SharedController::hwGetSenseConfig(unsigned int, SenseDataInfo&)(unsigned int arg0, void * arg1) {
    *(int32_t *)(rdx + 0x18) = 0x1;
    *(int32_t *)(rdx + 0x20) = 0x100;
    *(int32_t *)(rdx + 0x1c) = 0x1;
    *(int32_t *)(rdx + 0x24) = 0x100;
    *(int32_t *)(rdx + 0x10) = 0x101;
    *(int32_t *)(rdx + 0x14) = 0x10000;
    LODWORD(rsi) = LODWORD(LODWORD(arg1) & 0xf) - 0x1;
    LODWORD(rax) = 0xe00002f0;
    if (LODWORD(rsi) <= 0x6) {
            rax = sign_extend_64(*(int32_t *)(0xd3c8 + rsi * 0x4));
            switch (rsi) {
                case 0:
                    *(int32_t *)rdx = 0x7e48;
                    *(int32_t *)(rdx + 0x4) = 0x7e40;
                    *(int32_t *)(rdx + 0x8) = 0x7e44;
                    *(int32_t *)(rdx + 0xc) = 0x7e4c;
                    LODWORD(rax) = 0x0;
                    break;
                case 1:
                    *(int32_t *)rdx = 0x7e58;
                    *(int32_t *)(rdx + 0x4) = 0x7e50;
                    *(int32_t *)(rdx + 0x8) = 0x7e54;
                    *(int32_t *)(rdx + 0xc) = 0x7e5c;
                    LODWORD(rax) = 0x0;
                    break;
                case 2:
                    *(int32_t *)rdx = 0x7e68;
                    *(int32_t *)(rdx + 0x4) = 0x7e60;
                    *(int32_t *)(rdx + 0x8) = 0x7e64;
                    *(int32_t *)(rdx + 0xc) = 0x7e6c;
                    LODWORD(rax) = 0x0;
                    break;
                case 3:
                    *(int32_t *)rdx = 0x7e28;
                    *(int32_t *)(rdx + 0x4) = 0x7e20;
                    *(int32_t *)(rdx + 0x8) = 0x7e24;
                    *(int32_t *)(rdx + 0xc) = 0x7e2c;
                    LODWORD(rax) = 0x0;
                    break;
                case 4:
                    *(int32_t *)rdx = 0x7f18;
                    *(int32_t *)(rdx + 0x4) = 0x7f10;
                    *(int32_t *)(rdx + 0x8) = 0x7f14;
                    *(int32_t *)(rdx + 0xc) = 0x7f1c;
                    LODWORD(rax) = 0x0;
                    break;
                case 5:
                    *(int32_t *)rdx = 0x7fa8;
                    *(int32_t *)(rdx + 0x4) = 0x7fa0;
                    *(int32_t *)(rdx + 0x8) = 0x7fa4;
                    *(int32_t *)(rdx + 0xc) = 0x7fac;
                    LODWORD(rax) = 0x0;
                    break;
                case 6:
                    *(int32_t *)rdx = 0x7f70;
                    *(int32_t *)(rdx + 0x4) = 0x7f68;
                    *(int32_t *)(rdx + 0x8) = 0x7f6c;
                    *(int32_t *)(rdx + 0xc) = 0x7f74;
                    *(int32_t *)(rdx + 0x18) = 0x1;
                    *(int32_t *)(rdx + 0x20) = 0x2;
                    LODWORD(rax) = 0x0;
                    *(int32_t *)(rdx + 0x1c) = 0x1;
                    *(int32_t *)(rdx + 0x24) = 0x2;
                    *(int32_t *)(rdx + 0x10) = 0x3;
                    *(int32_t *)(rdx + 0x14) = 0x0;
                    break;
            }
    }
    return rax;
}

Using the atom dissasembler on a legacy bios shows a lot of info. 4 instance on a 9712 1002 card u have

Read ee00 bytes of data from /Extra/ATI.rom

Table Format Rev.   01
Table Content Rev.  01
BIOS Boot Message:  '
HP_JoYaHeWi RS880M DDR2 200e/500m                                           
'
Subsystem Vendor ID 1002
Subsystem ID        1002

Nice i can change 9712 id and also subvendor subsys to match another card.  If u change the bios make shure to fix checksum b4 load on radeonhd.kext

 

On data tables i have the LVDS_Info check the full dump (atom.txt). This is a remind to not to mess 2much with the bios or it wont work at all

 

Further info about video modes also are in bios (i need to update the source code to better use it)

 

 

More to come soon ;)

 

RadeonHD.kext.zip

source.zip

7.zip

atomdis.zip

com.apple.syslogd.zip

atom.zip

Link to comment
Share on other sites

 Share

×
×
  • Create New...