Help - Search - Members - Calendar
Full Version: ATI Framebuffer development
InsanelyMac Forum > InsanelyMac Lounge > The X Labs > ATI Framebuffer
Pages: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
Slice
Joblo stop development but the driver is really needed. Callisto works but not perfect and we have no sources to correct it.

Now I have working sources of Apple's IONDRVFramebuffer and Joblo's XRadeonFB that is based on very old Framebuffer v1.2 and it doesn't work.

I have Radeon9000 and work under Tiger. Is there any programmer want to join us (with OLE2) to make this project works in Leo with other Radeons?
Useful link to linux drivers

Any suggestions and advices welcomed.

TODO:
1. Make zero project be working. - Done!
2. Add Radeon functionality step by step keeping the driver works.
3. Study what IORegistry's keys used by the driver and write it into injector (or gfx).
4. Trace GA connection to make AGP working.

This is compilable version - start point. Without radeon functions yet.

EDITED 17.04.2008
There are all needed sources
IOGraphics by Apple. My version contains all codes from latest and old version with my comments who from where. Some codes needed only for PowerPC. Later I'll exlude its.
RadeonFB by Joblo. My old corrections for RadeonIGP. But the project is wrong at all. It is useful as template "How to correct IOGraphics to work with Radeon".
RadeonXF. Linux driver for R200-R400 based on RadeonFB tongue.gif . Many useful corrections to the project.
RadeonHD. Linux driver for R500-R600. It is very different driver so I don't know yet what is better: write one driver for all (if(R600){}) or make two different projects.
I also know that Linux driver for RS300 chipset is wrong cause I make my own AGPGart and compare settings. I have AMD documents about RS630 but have no informations about RS300, RS400, RS480 that is requested.

EDITED 26.05.2008
Joined project without kernel panic. Needed more corrections.
http://forum.insanelymac.com/index.php?sho...96664&st=45

For testing purpose Dong (very thanks!) create a nice driver RadeonPCI and utility RadeonDump
To use type in terminal
sudo kextload -v RadeonPCI.kext
./RadeonDump -r 0,1000 -- may be I ask you for other range
./RadeonDump -i



EDITED 21.07.2008
The new project based on OpenAti project http://openati.sf.net.
Now the driver is constructed as ATIDNRV and work together with any IONDRVSupport version.
So if it doesn't work then reboot in safe mode and delete the kext. I need your dmesg or system.log.
The significant part of codes rewritten according to RadeonXF sources and intended for any Radeon from R200 to R700(?). Needs testing.
The driver will work with ATILead.kext that inject a name "ATI,ATIPC".
To test install ATILead.kext, correct it's info.plist to your DevID
Install Ati.kext.
Try to boot and report. Try to understand why it doesn't work for you.
Sources of Ati.kext
What to change in ATILead.info.plist at posts #352 and #357.
Hoe to test at post #344

Here is Dong's test version RadeonHD
Also try and report.

At the current state its don't change resolution. It will be next step.
westwaerts
its said that 10.5.3 has ATI Radeon 3650 and 34×0 support.
Krazubu
Thank you for this Slice.
I can't help much reguarding coding since I don't have the knowledge but I'll try to do my possible on other sides as I already did.
I'll talk to the staff members about creating you your own subforum in Xlabs.

Also you can find here the official ATI docs about GPU programming, that ATI finally recently released, if you don't already have it.
http://ati.amd.com/developer/open_gpu_documentation.html
Slice
QUOTE (krazubu @ Mar 31 2008, 08:55 PM) *
Thank you for this Slice.
I can't help much reguarding coding since I don't have the knowledge but I'll try to do my possible on other sides as I already did.
I'll talk to the staff members about creating you your own subforum in Xlabs.

Also you can find here the official ATI docs about GPU programming, that ATI finally recently released, if you don't already have it.
http://ati.amd.com/developer/open_gpu_documentation.html

Yes, I got the documents. Without its I can't bring myself to revive the project.
Slice
Next step:
I got more sources about Radeon. Now I have correct procedure to read LegacyBIOS while XRadeonFB project deals only with ATOMBIOS.
CODE
Bool RADEONGetConnectorInfoFromBIOS (ScrnInfoPtr pScrn)
{
    RADEONInfoPtr info = RADEONPTR (pScrn);

    if(!info->VBIOS) return FALSE;

    if (info->IsAtomBios)
    return RADEONGetATOMConnectorInfoFromBIOS(pScrn);
    else
    return RADEONGetLegacyConnectorInfoFromBIOS(pScrn);
}
Slice
Two bad rezults:
1. IONDRVSupport compiled from the sources above gives blue screen with ATIRadeonX1600AGP while previous version works!
2. Linux driver is still wrong
CODE
    offset = RADEON_BIOS16(info->ROMHeaderStart + 0x50);
    if (offset) {
    for (i = 0; i < 4; i++) {
        entry = offset + 2 + i*2;

        if (!RADEON_BIOS16(entry)) {

Word access to odd address!

This codes is wrong too
CODE
    /* check TV table */
    if (info->InternalTVOut) {
    offset = RADEON_BIOS16(info->ROMHeaderStart + 0x32);
    if (offset) {
        if (RADEON_BIOS8(offset + 6) == 'T') {


Is there anybody point me to good documentation about Legacy Radeon VideoBIOS?

EDIT:
Possible workaround
RADEON_BIOS16(entry) -> RADEON_BIOS8(entry) and other byte access

RADEON_BIOS8(offset + 6) -> RADEON_BIOS8(offset + 1)
I check its with 3 BIOS. Seems to be good
Slice
Find differencies in INDRVSupport v1.4.3 and 1.4.4
v1.4.3
CODE
     for (i = 0, len = 0; i < intSpec->getCount(); i++)
        {
            data = (OSData *) intSpec->getObject(i);
            assert( data );
            len += data->getLength();
        }
        if (len)
            data = OSData::withCapacity( len );
        if (data)
        {
            for (i = 0; i < intSpec->getCount(); i++)
                data->appendBytes( (OSData *) intSpec->getObject(i));
       provider->setProperty( gIODTAAPLInterruptsKey, data );

v1.4.4
CODE
    data = (OSData *) intSpec->getObject(kIONDRVPCIInterruptSource);
        if (data)
            provider->setProperty( gIODTAAPLInterruptsKey, data );
Where kIONDRVPCIInterruptSource = 0
v1.4.3
CODE
if (device->getFunctionNumber())
v1.4.4
CODE
    OSNumber * num = OSDynamicCast(OSNumber, device->getProperty(kIOFBDependentIndexKey));
    if (num && (0 != num->unsigned32BitValue()))
        matched = false;
    else if ((pciDevice = OSDynamicCast(IOPCIDevice, device))
            && pciDevice->getFunctionNumber())

Only in 1.4.3
CODE
static FunctionEntry ATIUtilsFuncs[] =
    {
    // Gossamer onboard ATI
    MAKEFUNC( "ATISetMBRES", EXP(ATISetMBRES)),
    MAKEFUNC( "ATISetMonitorTermination", EXP(ATISetMonitorTermination)),
    MAKEFUNC( "ATIIsAllInOne", EXP(ATIIsAllInOne))
    };

Reseach continue
Slice
I think I don't need to rewrite IONDRVFramebuffer as joblo did. The better way is to rewrite IONDRVDevice as separate kext.

EDITED:
as ATINDRV
Slice
No any interest?
AntarcticP
Hi,
I'm really interested, because the only reason I'm still working on Tiger is that my X800XT isn't working with QE/CI at the moment and I don't have resolution change options

Thanks for trying to make a working kext !!!

AntarcticPL
justin1986
Hi,

I'm really interested too, this thread is the first thing I go look at when I start Safari.
(But we're not supposed to ask things in the X Labs, so I jus wait around)

QE/CI is the only thing I'm missing right now.

Thanks for making the effort for us!

Justin
Slice
Good, my work will be not hollow. I want to speak with programmers.
Slice
I made changes into zero project to combine best features from IONDRV v1.4.3, 1.4.4 and 1.4.5
My version have a number 1.4.42 to differ from Apple's.
For me it works.
One output from syslog
QUOTE
IONDRV: ATIM baseAddr=d0000000 rowBytes=00001000 Width=00000400 height=00000300 depth=00000020

may be useful if black or blue screen is achieved.
Thinking about more outputs to understand mechanics.
dong
Good job you done!
Actually I'm looking at these apple and linux source codes too because personally I need a working framebuffer driver with resolution change ability for my x1400 mobility. I'll take a look at your code immediately.
But what you are doing now seems not related to 3D acceleration, which means no support for QE/CI. AFAIK, ATINDRV.kext is only a framebuffer driver. Therefore, many ppl may will be disappointed by this.
Krazubu
3D acceleration is supported on almost all models from and later to ATI 9550 so it's not the main problem.
On its side, the framebuffer is not working on all models prior to X1000, partially working on almost all models between X1000 and X2000.
So this is the priority for the moment, also, dealing with 3D acceleration without having a working framebuffer wouldn't be the best way to go.

@Slice
Maybe you should update files download in the main thread too ?

little off-topic : I'm still searching on my side about X1600 efi and IOreg strings, I was thinking it would be nice to start a kind of "dictionnary thread" where we'd write each string and what we know about it. Users could test and update their findings, hopefully this could allow to dig the knowledge about it.
off-topic 2 : extended desktop on X1600 seems to be impossible simply because the wormy framebuffer (used for X1600 and other R500 powered cards) can only output a LVDS signal on the main head. This seems logical since the only mac having X1600 is the 1st macbook pro, with output 1 used for LVDS flatpanel, and output 2 for external screen, and Xserve with X1300 only has external output.. That would explain why only some rare laptop users (having a LVDS display) managed to get it. Enabling the desktop by itself is not impossible but it always ends on a black screen, confirming the fact it's probably an output "format" problem. The second head seems to be "switchable" LVDS, CRT, DVI, TV...

All this leads me to think about the fact that other framebuffers like the one for X1900 cards (which is an external card) may support all kinds of outputs on both channels. X1600 and X1900 can't be so different, I doubt ATI restarted from scratch the way its cards work on every model. There are big chances that this lowlevel stuff is common to all R500 series if not all X1000. So what could really differ between those 2 framebuffers beside some "details" ? My idea is to binary patch the sphyrna framebuffer to make it compatible with X1600. However I'm aware this is only naive theory, but if you have the documents, maybe you know those differencies and maybe it's only some memory adresses to patch here and there.
Slice
OK! I updated the topic.
About 3D acceleration. It is performed by ATIRadeonXXXX.kext that is not available in sources. Is it good enogh? I found no!
CODE
    if (info->IsIGP)
        info->mc_fb_location = INREG(RADEON_NB_TOM);
    else
#ifdef XF86DRI  -- OpenFirmware
    /* Old DRI has restrictions on the memory map */
    if ( info->directRenderingEnabled &&
         info->pKernelDRMVersion->version_minor < 10 )
        info->mc_fb_location = (mem_size - 1) & 0xffff0000U;  -- as in ATIRadeonXXXX.kext
    else
#endif

Calculation of mc_fb_location (physical address of Framebuffer) different for IGP, for OpenFirmware and for all other Radeons. But ATIRadeonXXXX.kext uses only OF variant sad.gif . Can I patch it? Yes.
Do I know exactly what to do? No! I made a test version of ATIRadeon8500 for IGP that works more or less, while original one - never.
This calculation performed twice. In ATIRadeon.kext and in IONDRVFramebuffer.kext so during debugging we can find best settings.
ATIRadeonXXXX doesn't perform screen output. It works through Framebuffer. For good 3D we need good Framebuffer. For example CallistoFB doesn't work in AGP mode.
Yes, I shall return to QE problem having good framebuffer.

Registry keys.
IONDRV uses such keys (getProperty):
CODE
getConnection()->getFramebuffer()->getProperty(kIOBacklightUserBrightnessKey))))
provider->getProperty("AAPL,boot-display")
getProperty("has-safe-sleep")
getProperty( kIODisplayEDIDKey )
getProperty(kDisplayVendorID)
getProperty(kDisplayProductID)
framebuffer->getProperty(kIOFBTransformKey) -- "IOFBTransform"
framebuffer->getProperty(gIODisplayParametersKey)
getPMRootDomain()->getProperty(kIOHibernatePreviewBufferKey)
getPMRootDomain()->getProperty(kAppleClamshellStateKey)
root->getProperty("graphic-options")
getProperty(kIOFBGammaWidthKey)
getProperty(kIOFBGammaCountKey)
getProperty(kIOFBGammaHeaderSizeKey) -- "IOFBGammaHeaderSize" and so on.
getProperty(kIOFBDependentIDKey)
device->getProperty("AAPL,phandle")
props->getProperty(kIOGraphicsPrefsParametersKey)
getProperty(kIOI2CInterfaceIDKey)
getProperty(kIOI2CBusTypeKey)
getProperty(kIOI2CTransactionTypesKey)
getProperty(kIOI2CSupportedCommFlagsKey)
framebuffer->getProperty(kIOFBI2CInterfaceInfoKey)
regEntry->getProperty("driver,AAPL,MacOS,PowerPC") -- what about Intel???
provider->getProperty(kIONDRVIgnoreKey)
getProperty(gIONameMatchedKey)
provider->getProperty("AAPL,ndrv-dev")
provider->getProperty("@0,name")
next->getProperty("device_type")
provider->getProperty("AAPL,boot-display")
nub->getProperty(kIOFBDependentIndexKey)
provider->getProperty(kIOFBHostAccessFlagsKey) -- AGP Host???
device->getProperty("IONVRAMProperty")
device->getProperty(kIOAGPCommandValueKey) -- yes, AGP supported!
getProvider()->getProperty("Ignore VBL")
nub->getProperty("AAPL,maps")
nub->getProperty("AAPL,vram-memory")
nub->getProperty("VRAM,memsize") -- as alternative to previous one
getPlatform()->getProperty("AppleExtSwitchBootState")
provider->getProperty(kAAPLDisableMSIKey)
provider->getProperty(kPropertyAAPLAddress)
provider->getProperty(gIOInterruptSpecifiersKey)
provider->getProperty(gIODTAAPLInterruptsKey)

That's all. Other settings found in ioreg are needed for other drivers.
Slice
About RadeonHD project. http://wiki.x.org/wiki/radeonhd
QUOTE
7. Known Bugs & Limitations

The following subsystems have not been implemented yet or show some limitations:

No 3D acceleration so far. 2D acceleration is implemented for R5xx only upto now. No XVideo (needs 3D engine for scaling). Still, fullscreen video is working fluently for many users.
No TV and Component connector support so far.
Dual Link DVI support is untested so far.
Panels only show native resolution.
No RandR rotation support so far.
Suspend & Resume is only tested on some hardware. Very often it just works, but your mileage may vary.
No powermanagement yet. Depending on your hardware, the fan might run at full speed.
The following known bugs have not been resolved yet (ordered by severity):

Bug 13405: Hardware cursor corruption. Haven't been able to reproduce reliably yet.
Bug 13605: MR HD 2600: Panel remains black
Some cards seem to provide broken connector tables. We're constantly fixing those. Please report if you have one.
Whiteouts on console switching under some circumstances. (Should be fixed)
Panel brightness cannot be changed because ACPI events aren't handled properly. Workaround: Switch to a different virtual terminal for that. Affects backlight on a number of laptops, e.g. from the IBM/Lenovo ThinkPad series. (Seems to be fixed in git since some time in 2008-03, needs to be verified)
With two monitors of different resolution connected both show up with the same (lower) resolution when RandR is active at startup. This seems to be a general RandR issue. Can be changed with --output <output> --auto during runtime, or with Option "PreferredMode" "<mode>" with newer Xservers (known to be buggy up to Xserver 1.4.0).

It is Linux!
dong
Yeah, I'm studying how to put radeonHD stuff in IONDRVSupport. Even in radeonHD, Rv5XX and Rv6XX are treated slightly different because of one offset in register address for them and/or something else I don't know yet.
Slice
QUOTE (dong @ Apr 17 2008, 06:05 PM) *
Yeah, I'm studying how to put radeonHD stuff in IONDRVSupport. Even in radeonHD, Rv5XX and Rv6XX are treated slightly different because of one offset in register address for them and/or something else I don't know yet.


Glad to see a developer!

I'll be absent up to 21.04.2008. Speak with you later.
Never Mind
Hiya smile.gif

Just wanted to mention that I am also very interested in this project! smile.gif I also still have: Quartz Extreme: Not Supported

Do I understand correctly that the aim of this project is to create a frame buffer that would allow for QI?

I am using Leopard 10.5.1 with a ATI Radeon X800PRO (AGP), and Callisto 008 has given me resolution and refresh rate changes. Further I've loaded ATIRadeon9700 drivers, AGPGArt & IONDRVSupport.

I am not a developer, but I can do testing, let me know if this would be useful with the above for this project.

Cheers,

N.M.
Slice
QUOTE (Never Mind @ Apr 21 2008, 12:51 PM) *
Do I understand correctly that the aim of this project is to create a frame buffer that would allow for QI?

It would be best framebuffer. sleep.gif
QUOTE
I am not a developer, but I can do testing, let me know if this would be useful with the above for this project.

You give me useful reports so welcome!
Never Mind
QUOTE (Slice @ Apr 21 2008, 01:55 PM) *
It would be best framebuffer. sleep.gif


Great, go for it! |-)

QUOTE (Slice @ Apr 21 2008, 01:55 PM) *
You give me useful reports so welcome!


Let me know what I can test, and please help me a bit with the test plan; meaning which kexts to load with it, which versions, etc.

Looking forward! smile.gif
Slice
What is the flag
CODE
        if ((data = OSDynamicCast(OSData, provider->getProperty(kIOFBHostAccessFlagsKey))))
            accessFlags = *((UInt32 *) data->getBytesNoCopy());

Any ideas?

Host means AGP controller???
dong
kIOFBHostAccessFlagsKey is defined as "IOFBHostAccessFlags" in IOGraphicsTypes.h. A simple google did not find any registry dump contains this flag.
Slice
QUOTE (dong @ Apr 22 2008, 11:35 PM) *
kIOFBHostAccessFlagsKey is defined as "IOFBHostAccessFlags" in IOGraphicsTypes.h. A simple google did not find any registry dump contains this flag.

May be this flag is reserved by Apple for a future. If so we can use it for our purpose.

Now I am ready to join projects. But some questions are still unresolved and I want to have advices what to do.
1. My RadeonIGP have shared video memory located at physical address=0x38000000. But IONDRVFramebuffer works with address=0xd0000000. Internal Radeon readdressing? How it works?
2. Radeon Register
MPP_TB_CONFIG = 0x134
used only for save and restore. Its function?
3. How many differences between R400, R500 and R600 family?
dong
QUOTE (Slice @ Apr 23 2008, 05:12 AM) *
1. My RadeonIGP have shared video memory located at physical address=0x38000000. But IONDRVFramebuffer works with address=0xd0000000. Internal Radeon readdressing? How it works?

I did a google and found this:
(II) RADEONHD(0): Mapped IO at 0x2b01de1c6000 (size 0x00010000)
(==) RADEONHD(0): Write-combining range (0xf0000000,0x8000000)
(II) RADEONHD(0): PCI FB Address (BAR) is at 0xF0000000 while card Internal
Address is 0x38000000
(II) RADEONHD(0): Mapped FB at 0x2b01de861000 (size 0x08000000)
Looks like PCI Address VS. GPU Address, but I have no idea about their detailed roles as both are Physical addresses in the eye of the device driver. Maybe DMA GART readdressing is involved in the PCI Address scheme.

QUOTE
2. Radeon Register
MPP_TB_CONFIG = 0x134
used only for save and restore. Its function?

Also by google, I found this:
> 1) If MEM_CNTL and CONFIG_MEMSIZE are not re-initialised to their power-up
> value, a BIOS bug ends up corrupting the chip's memory interface.
>
> 2) If the misnamed MPP_TB_CONFIG register is not set properly, a bug in
> the chip causes it to return zeroes for read-outs of its PCI ROM.
>
> Both issues have been seen using various Radeon cores, including R200,
> RV200, etc.

> > > MPP_TB_CONFIG was for an issue on the Radeon 7500
> > > (RV200). Unfortunately, I can't elaborate too much on what exactly it
> > > does, because it's a fix we got from ATI without much detail. The
> > > problem it fixed, though, is that without the MPP_TB_CONFIG change the
> > > BIOS ROM can't be read after the BIOS has been run.

ie., MPP_TB_CONFIG must be handled in case the card BIOS is run multiple times. Reboot is an example. Otherwise, only zero is returned when read the BIOS ROM for the second time.

QUOTE
3. How many differences between R400, R500 and R600 family?

Can't say much about this. The difference between R500 and R600 should be less when compared with R400 since at least R500 and R600 are dealt by the same linux driver although in many cases parallel functions are used to treat R500 and R600 differently.
Slice
Thank you, Dong!

I took your information.
About differencies. I shall make driver as universal. Be ready to correct it to new chips.

I begin to write final project. It takes me several days because thousand strings must be rewriten.
I can't divide project to ATIXNDRV and IONDRVFramebuffer. More easy to me make IORadeonSupport and some injector (ATILead) to customize some registry values.
dong
By looking at codes in radeonHD driver's utility folder and ATILead, I wrote a small utility for Mac to dump Radeon card BIOS ROM and IO register values in user space. I provide it here in case you don't have such a tool.

To use it, just open a terminal and type:
sudo kextload -t RadeonPCI.kext //place a kernel side thing matched to "ATY*" or "display" and response to below dump cmd
./RadeonDump -d //dump BIOS ROM to a file named as: devID.subVenID.subSysID.vga.rom
./RadeonDump -r 0x308,0x338 //dump to terminal IO register values within 0x308,0x338 or else you want

The execute files are compiled on my leopard 10.5.2. You may want to recompile them from source code.

compiled for leopard 10.5.2:Click to view attachment
compiled for tiger 10.4.8:Click to view attachment
source code:Click to view attachment

For tiger, you still need edit Info.plist to change OSBundlerequirement to your version number, ie. 8.8.1 --> 8.6.1 if you are running 10.4.6.
Slice
QUOTE (dong @ Apr 25 2008, 02:08 AM) *
By looking at codes in radeonHD driver's utility folder and ATILead, I wrote a small utility for Mac to dump Radeon card BIOS ROM and IO register values in user space. I provide it here in case you don't have such a tool.

To use it, just open a terminal and type:
sudo kextload -t RadeonPCI.kext //place a kernel side thing matched to "ATY*" or "display" and response to below dump cmd
./RadeonDump -d //dump BIOS ROM to a file named as: devID.subVenID.subSysID.vga.rom
./RadeonDump -r 0x308,0x338 //dump to terminal IO register values within 0x308,0x338 or else you want

The execute files are compiled on my leopard 10.5.2. You may want to recompile them from source code.


Very well!
May be you create new topic about RadeonPCI in the subforum?

I try to recompile it to Tiger but unsuccessful because it uses some Leo functions
QUOTE
kextload: extension /Off/RadeonPCI.kext appears to be valid
kextload: loading extension /Off/RadeonPCI.kext
19RadeonPCIUserClient is not compatible with its superclass, 12IOUserClient superclass changed?
kextload: a link/load error occured for kernel extension /Off/RadeonPCI.kext
load failed for extension /Off/RadeonPCI.kext
(run kextload with -t for diagnostic output)

I am also unsuccessful with lspci and don't know why.
Can you give me your IOUserClient class description?

One useful link about Radeon200M
http://dri.freedesktop.org/wiki/Radeon200M...goryHardware%29
dong
No specific leopard functions are used, simply need to change the build rule to use 10.4u.sdk. The post has been updated with a compiled version for tiger, which I've tested with kextload on my tiger 10.4.8 without problem. RadeonDump included is also working. If recompile it, other archs other than i386 need to be removed from cmd parameter list.
One possible problem is that I just choose the IODeviceMemory who has a size of 0x10000 as IO register memory area, but I'm not sure for this.
Slice
QUOTE (dong @ Apr 26 2008, 05:04 AM) *
No specific leopard functions are used, simply need to change the build rule to use 10.4u.sdk. The post has been updated with a compiled version for tiger, which I've tested with kextload on my tiger 10.4.8 without problem. RadeonDump included is also working. If recompile it, other archs other than i386 need to be removed from cmd parameter list.
One possible problem is that I just choose the IODeviceMemory who has a size of 0x10000 as IO register memory area, but I'm not sure for this.

I check it with my hackintosh N1. OSX 10.4.9. Works fine even with nVidia!!! biggrin.gif
CODE
0000: 55 AA 78 EB 4B 37 34 30 30 E9 4C 19 77 CC 56 49 U.x.K7400.L.w.VI
0010: 44 45 4F 20 0D 00 00 00 08 01 67 11 00 00 49 42 DEO ......g...IB
0020: 4D 20 56 47 41 20 43 6F 6D 70 61 74 69 62 6C 65 M VGA Compatible
0030: 01 00 00 00 C0 08 4C 99 30 33 2F 31 34 2F 30 36 ......L.03/14/06
0040: 00 00 00 00 00 00 00 00 00 10 00 00 00 00 00 00 ................
0050: E9 66 11 00 58 14 1F 34 FF CF EF 7F 00 10 00 80 .f..X..4.......
0060: FF FF FF 7F 00 00 00 80 22 00 A5 71 E9 13 B8 E9 ......."..q....
0070: 1A B8 50 4D 49 44 6C 00 6F 00 00 00 00 A0 00 B0 ..PMIDl.o.......
0080: 00 B8 00 C0 00 33 7E CA 9B 00 02 00 04 00 6A 21 .....3~.......j!
0090: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF ................
00A0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF ................
00B0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF ................
00C0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF ................
00D0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF ................
00E0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF ................
00F0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF ................

0100: FF FF FF FF 48 57 45 41 50 43 49 52 DE 10 D1 01 ....HWEAPCIR....
0110: 00 00 18 00 00 00 00 03 78 00 01 00 00 80 00 00 ........x.......
0120: 47 56 2D 4E 58 37 33 4C 31 32 38 44 2D 52 48 20 GV-NX73L128D-RH
0130: 46 31 20 0D 0A 00 00 00 00 00 00 00 00 00 00 00 F1 .............
0140: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0150: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0160: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0170: 00 56 65 72 73 69 6F 6E 20 20 35 2E 37 32 2E 32 .Version 5.72.2
0180: 32 2E 33 35 2E 30 36 20 0D 0A 00 43 6F 70 79 72 2.35.06 ...Copyr
0190: 69 67 68 74 20 28 43 29 20 31 39 39 36 2D 32 30 ight © 1996-20
01A0: 30 35 20 4E 56 49 44 49 41 20 43 6F 72 70 2E 0D 05 NVIDIA Corp..

But not with Radeon registers on nVidia biggrin.gif
QUOTE
it matched on name "display"
./RadeonDump.c:238: failed assertion `KERN_SUCCESS == kr'
Abort trap

It still not work in 10.4.6....
Same result as I previously have with lspi
QUOTE
kextload: extension /Off/lspcidrv.kext appears to be valid
kextload: loading extension /Off/lspcidrv.kext
kld(): /Off/lspcidrv.kext/Contents/MacOS/lspcidrv load command 2 unknown cmd field
kextload: kld_load_from_memory() failed for module /Off/lspcidrv.kext/Contents/MacOS/lspcidrv
kextload: a link/load error occured for kernel extension /Off/lspcidrv.kext
load failed for extension /Off/lspcidrv.kext
(run kextload with -t for diagnostic output)


I made the joined project IORadeonSupport but with numerous mistakes. The last one
QUOTE
/Developer/Private/jam failed with exit code 1

I understand that it is subroutine description error. But how can I find which of hundreds?
dong
QUOTE (Slice @ Apr 28 2008, 11:25 AM) *
I check it with my hackintosh N1. OSX 10.4.9. Works fine even with nVidia!!! biggrin.gif

So the BIOS of video card is loaded to the same physical address 0xc0000 no matter ati or nvidia.
QUOTE
But not with Radeon registers on nVidia biggrin.gif

Looks like nVidia IO register area is not with a size of 0x10000, but with 0x20000.
QUOTE
It still not work in 10.4.6....Same result as I previously have with lspi

I did a google on this. It may be caused by no support for UUID cmd section in mach-o execute file for 10.4.6. Add an -no_uuid link option may solve it.
QUOTE
I made the joined project IORadeonSupport but with numerous mistakes. I understand that it is subroutine description error. But how can I find which of hundreds?

Can you find any other error information other than this?Well, I found your posts on x86dev.org about lspci.
Here I attach a new kext with the -no_uuid link option and select IO area upon the size is between 0x10000 and 0x20000. Click to view attachment
You may try it with both of your hackingtoshs.

Since you had the same problem loading the userclient related kexts. Now I'm thinking why don't you upgrade to 10.4.8 or is 10.4.6 required for your specific hardware?
Slice
QUOTE (dong @ Apr 28 2008, 09:05 PM) *
Looks like nVidia IO register area is not with a size of 0x10000, but with 0x20000.

We have no purpose to read nVidia registers. We work around ATI.
QUOTE
Here I attach a new kext with the -no_uuid link option and select IO area upon the size is between 0x10000 and 0x20000.

Same problem
CODE
kextload: extension /Users/sergey/Desktop/TigerCompiled/RadeonPCI.kext appears to be valid
kextload: loading extension /Users/sergey/Desktop/TigerCompiled/RadeonPCI.kext
kld(): /Users/sergey/Desktop/TigerCompiled/RadeonPCI.kext/Contents/MacOS/RadeonPCI load command 2 unknown cmd field
kextload: kld_load_from_memory() failed for module /Users/sergey/Desktop/TigerCompiled/RadeonPCI.kext/Contents/MacOS/RadeonPCI
kextload: a link/load error occured for kernel extension /Users/sergey/Desktop/TigerCompiled/RadeonPCI.kext
load failed for extension /Users/sergey/Desktop/TigerCompiled/RadeonPCI.kext
(run kextload with -t for diagnostic output)

QUOTE
You may try it with both of your hackingtoshs.

Hack 1 at evening (home). Hack 2 at moning and midday (job).
QUOTE
Since you had the same problem loading the userclient related kexts. Now I'm thinking why don't you upgrade to 10.4.8 or is 10.4.6 required for your specific hardware?

It is really hard question. I tried to install Official ComboUpdate 10.4.8 as with hackintosh 1. All freezes at AppleACPiPlatform.kext no matter what kernel I tried to use. Old kext is not compatible with new kernel. I can't start even with -v -s.
I tried also JaS 10.4.8 PPF1, PPF2, Kalyway 10.4.10, MacDotNub 10.4.10. They are loaded (so kernel+ACPI works?) but stopped at installer. I have no more ideas how to install or upgrade my Hackintosh 2 to new system.

Return to our main problem. Here is a sources of joined project. What I did?
1. Insert Joblo's additions to IONDRVFramebuffer 1442. Only three commands support:
cscGetVideoParameters
cscGetModeTiming
cscGetNextResolution
and procedures to support the commands.
2. Correct Joblo's access to Radeon Registers and VideoBIOS (as in ATILead).
3. Large rewrite of GetConnectorsInfoFromBIOS according to Linux Project XF.
4. Add decsriptions to Radeon registers. Not all yet!
I didn't make IONDRVDevice initialization as Joblo do supposing that ATILead may do it.

Sorry, the sources contain a mistake that I didn't catch yet. May be you can help?
Slice
Probably kernel 8.4.1 that I have doesn't support kIOUCStructIStructO used in lspci and RadeonPCI.
But it supports kIOUCScalarIScalarO used in IOGraphicsFamily.
http://lists.apple.com/archives/darwin-dri...c/msg00014.html

EDITED:
Sorry, it is used in IOFramebufferUserClient.cpp so it must works.

EDITED:
Better rezult
CODE
kextload: extension /RadeonPCI.kext appears to be valid
kextload: loading extension /RadeonPCI.kext
kextload: /RadeonPCI.kext loaded successfully
kextload: loading personalities named:
kextload:     FirstPersonality
kextload: sending 1 personality to the kernel
kextload: matching started for /RadeonPCI.kext

But now RadeonDump do nothing...
It tells me about error but when all is OK no any output mellow.gif
CODE
Unable to read range:  0x100,
Usage: ./RadeonDump [-d] [-r start,end]
        -d              dump Radeon card BIOS ROM
        -r start,end    dump Radeon card IO register values in the range of [start,end]
dong
QUOTE (Slice @ Apr 29 2008, 08:56 AM) *
better rezult
But now RadeonDump do nothing...
It tells me about error but when all is OK no any output mellow.gif
CODE
Unable to read range:  0x100,
Usage: ./RadeonDump [-d] [-r start,end]
        -d              dump Radeon card BIOS ROM
        -r start,end    dump Radeon card IO register values in the range of [start,end]


Just as the usage said, there is no space between start,end otherwise it will give you this error. tongue.gif
Well, if you like dump one register each time, please download this Click to view attachment to the RadeonPCI folder and compile it by yourself. It add support to usage like: ./RadeonDump 0x100 .

I downloaded your IORadeonSupport source code and finally managed compile it under my 10.5.2. Basically, you have some redefinition problems. What I did is just moving codes back and forth between these files to avoid it. Three files in Radeon folder are removed after these as they seemed no longer needed.

Source after modifing: Click to view attachment
Compiled for tiger kexts: Click to view attachment
Slice
First of all, thank you, Dong, very much!
You bring me out of deadend. Now I can successfully compile it.
Strange, but I always need to recompile your kexts to make it loadable for my comp:
"2 unknown cmd field"... blink.gif as RadeonPCI so IORadeonSupport.
Now RadeonPCI loads fine and present in kextstat.
But RadeonDump doesn't produce output. How can I recompile it? XCode project or makefile?

IORadeonSupport.
As I see you exclude IONDRVLibraries. Rezult
CODE
kextload: extension /Off/Rad/IORadeonSupport.kext appears to be valid
kld(): Undefined symbols:
__IONDRVLibrariesFinalize
__IONDRVLibrariesInitialize
kextload: kld_load_from_memory() failed for module /Off/Rad/IORadeonSupport.kext/IORadeonSupport
kextload: a link/load error occured for kernel extension /Off/Rad/IORadeonSupport.kext

Now I recompile it and begin testing. Wait...

Yes, kernel panic sad.gif
dong
QUOTE (Slice @ Apr 30 2008, 04:19 AM) *
First of all, thank you, Dong, very much!
You bring me out of deadend. Now I can successfully compile it.
Strange, but I always need to recompile your kexts to make it loadable for my comp:
"2 unknown cmd field"... blink.gif as RadeonPCI so IORadeonSupport.

You are always welcome as this is at least something I can do to support you on this project. At present I have no idea what causes this difference, but good that you can recompile and load it.
QUOTE
Now RadeonPCI loads fine and present in kextstat.
But RadeonDump doesn't produce output. How can I recompile it? XCode project or makefile?

RadeonDump.c is a simple c source file, you just need to put it in the RadonPCI folder as it includes a header file there. If you open RadeonDump.c, the first comment tells you how to compile it in a terminal. (a normal c language compile cmd smile.gif )
QUOTE
IORadeonSupport.
As I see you exclude IONDRVLibraries. Rezult
CODE
kextload: extension /Off/Rad/IORadeonSupport.kext appears to be valid
kld(): Undefined symbols:
__IONDRVLibrariesFinalize
__IONDRVLibrariesInitialize
kextload: kld_load_from_memory() failed for module /Off/Rad/IORadeonSupport.kext/IORadeonSupport
kextload: a link/load error occured for kernel extension /Off/Rad/IORadeonSupport.kext

Now I recompile it and begin testing. Wait...

Yes, kernel panic sad.gif

I did not remember I excluded IONDRVLibraries.h. When you recompiled, did you include it back? Maybe something else caused the kernel panic.
Slice
QUOTE (dong @ Apr 30 2008, 05:38 PM) *
RadeonDump.c is a simple c source file, you just need to put it in the RadonPCI folder as it includes a header file there. If you open RadeonDump.c, the first comment tells you how to compile it in a terminal. (a normal c language compile cmd smile.gif )

OK! I really never used command line. I am not from Linux world, I am from MacOS Classic.
With Hackintosh N1 (now) I can't reach nVidia registers. All other is OK
CODE
May  1 00:22:51 sergeys-computer kernel[0]: RadeonPCI::start
May  1 00:22:51 sergeys-computer kernel[0]: Range[0] f4000000:01000000
May  1 00:22:51 sergeys-computer kernel[0]: Range[1] e0000000:10000000
May  1 00:22:51 sergeys-computer kernel[0]: Range[2] f5000000:01000000
May  1 00:22:51 sergeys-computer kernel[0]: Range@0x10 f4000000:01000000
May  1 00:22:51 sergeys-computer kernel[0]: Range@0x10 (f4000000) mapped to kernel virtual address 3399f000
May  1 00:22:51 sergeys-computer kernel[0]: ATI ROM start at 000c0000 mapped to kernel virtual address 2b484000
May  1 00:22:51 sergeys-computer kernel[0]: ROM signature is read as: 0000aa55
May  1 00:22:51 sergeys-computer kernel[0]: Config register@0x4 = 00100007
May  1 00:23:10 sergeys-computer kernel[0]: RadeonPCIUserClient::initWithTask(type 23)
May  1 00:23:10 sergeys-computer kernel[0]: RadeonPCIUserClient::start
May  1 00:23:10 sergeys-computer kernel[0]: RadeonPCIUserClient::clientMemoryForType(101)
May  1 00:23:10 sergeys-computer kernel[0]: RadeonPCIUserClient::stop

QUOTE
I did not remember I excluded IONDRVLibraries.h. When you recompiled, did you include it back? Maybe something else caused the kernel panic.

Yes, I include back IONDRVLibraries.cpp and .h and correct global->local #include. The project now compilable and loadable without problems. You'd also may improve IORadeonSupport.info.plist.
1. IOProbeScore must be higher then IONDRVSupport to have these two drivers simultaneously. I set 30000.
2. It is better to set matching
CODE
            <key>IOPCIClassMatch</key>
            <string>0x03000000&amp;0xffff0000</string>

to avoid work with 0x03800000 - second stupid head as in X1600Pro

Next problem - kernel panic. It is easy to trace. I simply insert IOLog()s at every place and look. My last stop at getting MMIO address of Radeon registers. Why? I'll trace provider->getName() and all IODeviceMemories of the provider .
Other problems follows. May be not good EDID found in BIOS or getting from I2C. May be not good I2C at all. We can compare it with Linux.
And huge future problem - correct using of Radeon Registers for different chips...
Kernel panic is a trifle.
But I have 3 days holiday.
dong
When I test with IOGraphics source code, I found all ATI acceleration kexts (as listed in Info.plist) require IONDRVSupport to load. But when I check some online vanilla IOReg dumps, IONDRVSupport seems not loaded while native ATI framebuffer driver is used instead.
I can't figure out how this is achieved.
Slice
QUOTE (dong @ May 1 2008, 02:07 AM) *
When I test with IOGraphics source code, I found all ATI acceleration kexts (as listed in Info.plist) require IONDRVSupport to load. But when I check some online vanilla IOReg dumps, IONDRVSupport seems not loaded while native ATI framebuffer driver is used instead.
I can't figure out how this is achieved.


It seems system check the presense of IONDRVSupport.kext to load accelerator but really other driver is loaded.
I have an observation that even if ATINDRV.kext is not loaded in my system it influence on whole ATI driver behaviour.
I propose that ATINDRV::probe() methods called, made some tunings and return kIOReturnUnsuccessful so the kext is not loaded but change the system wacko.gif .

IOGraphicsFamily from our project works fine but I see no difference with Apple's one. We may take into account that we can rewrite IOAccelerator class rolleyes.gif Have you ideas what to change in it?
ole2
QUOTE (Slice @ Apr 7 2008, 08:40 PM) *
I think I don't need to rewrite IONDRVFramebuffer as joblo did. The better way is to rewrite IONDRVDevice as separate kext.

EDITED:
as ATINDRV


that was my original point-out during study of IONDRVFramebuffer
it's massively using IONDRV device subclass for any hardware related issues
Slice
With returning, Ole2!

2 joanplanas
To have QE we need good Framebuffer but Framebuffer is not enough for QE.
I also want to have QE and I work.
joanplanas
if you need help to test will be attentive to the messages.

thanks!

------
HP pavilion dv5098ea
ati radeon xpress 200m
amd turion 64
Slice
Current state.
I don't like three thing:
1. Zero project IONDRVFramebuffer 1.4.42 doesn't work with IONDRVDevice while 1.4.3 does.
Result - KP at get MMIO.
2. I rewrite IOBootNDRV class to Radeon procedure.
Result - KP at ret = ndrv->getNextResolution.
It is better to create new class IORadeonNDRV (as ATINDRV). Rewrite all again?
3. I rewrite IONDRVFramebuffer class to include I2C members.
It is better to create new class.

I look at connectorsInfo output - no any sense in the digits. Needed investigations.
Slice
I am wrong
IONDRVSupport 1.4.3 doesn't work with IONDRVDevice too. So I see no mistakes in 1.4.42 zero project.
Why RadeonFB project make it?
CODE
bool
IONDRVFramebuffer::start( IOService * provider )
{
IOService * parent = 0;
OSData * data;

online = false;
IODelay(50000);

/* If we get here, we have matched to an IONDRVDevice */
do
{
// Save it for further IOReg writings,
//nub = IONDRVDevice, parent = IOPCIDevice
nub = provider;


I need not only testers (I have no alpha version yet). I need advices.

EDITED:
I can't understand yet but previously I can boot with IONDRVDevice
http://forum.insanelymac.com/index.php?sho...91042&st=63
CODE
| | | +-o display@0 <class IONDRVDevice, registered, matched, active, busy 0, retain count 7>
| | | | | {
| | | | | "IODeviceMemory" = (({"address"=0xffffffffd0000000,"length"=0x10000000}),{"offset"=0x9000,"parent"=({"address"=0x0,"length"=0x10000}),"length"=0x100},({"address"=0xffffffffc0100000,"length"=0x10000}))
| | | | | "AAPL,gray-value" = <c38c6400>
| | | | | "device_type" = <"display">
| | | | | "AAPL,gray-page" = <01000000>
| | | | | "built-in" = <>
| | | | | "AAPL,ndrv-dev" = Yes
| | | | | "IOFBDependentID" = 0x2adfb00
| | | | | "display-connect-flags" = <00000000>
| | | | | "IOFBDependentIndex" = 0x0
| | | | | "AAPL,iokit-ndrv" = <20508a27>
| | | | | "AAPL,RegEntryID" = <00e78d02ff1872fd656d69537a6c7552>
| | | | | "compatible" = <"display">
| | | | | "display-link-component-bits" = <06000000>
| | | | | "display-type" = <"LCD">
| | | | | "name" = <"display">
| | | | | }
| | | | |
| | | | +-o .Display_boot <class IONDRVFramebuffer, registered, matched, active, busy 0, retain count 10>
| | | | | {

Why not now?
Is there anybody who can successfully boot into gui with ATILead 1.2.0 and without other Radeon drivers?

I really need to use IONDRVDevice because it is provider of ATINDRV class.
Slice
Continue developement.

I was fighting with numerous memory allocation errors. Now no more kernel panics.
The driver loaded and give me... black screen. But now I can make dmesg with useful debugging info.
There are plenty of other mistakes needed to resolve.
1. I can't obtain correct EDID either from DDC or BIOS. I manually inject some EDID by ATILead.
CODE
                <key>ATI,EDID</key>
                <data>
                AP///////wBaYxFpAQEBASoNAQOAKR94Kk6VoVdMlCYc
                UFS/74CpQIGAgUBxT2FZRVkxWTEKSD9AMGKwMkBAwBMA
                mDIRAAAeAAAA/wBBMjEwMzQyMDAxOTUKAAAA/QAyVR5c
                EQAKICAgICAgAAAA/ABWUDIwMWIKICAgICAgAJk=
                </data>

2. I got correct connection info from BIOS. I have three output: internal LCD, external CRT and TVOUT. But how to use these info? Probably it is needed to create three nubs of NDRVDevices one for each connections and launch three Framebuffers with own datas.
3. I got not correct resolutions info from EDID. Some simple mistakes.

To correct these mistakes it is needed huge work but not impossible.
heng2006
To Slice,

Thank you for your hard works.
I hope some days my AGP card (ATI 9600 pro) and mainboard (Asrock 4Dual-VSTA (VIA PT880 chipset))
would work with Leopard and QE/CI.

heng2006
enzobelmont
go Slice!!!

YOU ARE THE MAN!!!
ole2
QUOTE (Slice @ May 26 2008, 09:53 AM) *
Continue developement.

I was fighting with numerous memory allocation errors. Now no more kernel panics.
The driver loaded and give me... black screen. But now I can make dmesg with useful debugging info.
There are plenty of other mistakes needed to resolve.
1. I can't obtain correct EDID either from DDC or BIOS. I manually inject some EDID by ATILead.
CODE
                <key>ATI,EDID</key>
                <data>
                AP///////wBaYxFpAQEBASoNAQOAKR94Kk6VoVdMlCYc
                UFS/74CpQIGAgUBxT2FZRVkxWTEKSD9AMGKwMkBAwBMA
                mDIRAAAeAAAA/wBBMjEwMzQyMDAxOTUKAAAA/QAyVR5c
                EQAKICAgICAgAAAA/ABWUDIwMWIKICAgICAgAJk=
                </data>

2. I got correct connection info from BIOS. I have three output: internal LCD, external CRT and TVOUT. But how to use these info? Probably it is needed to create three nubs of NDRVDevices one for each connections and launch three Framebuffers with own datas.
3. I got not correct resolutions info from EDID. Some simple mistakes.

To correct these mistakes it is needed huge work but not impossible.


according to Wikipedia:

"Some graphics card drivers have historically coped poorly with the EDID, using only its standard timing descriptors rather than its Detailed Timing Descriptors (DTDs). Even in cases where the DTDs were read, the drivers are/were still often limited by the standard timing descriptor limitation that the horizontal/vertical resolutions must be evenly divisible by 8. This means that many graphics cards cannot express the native resolutions of the most common wide screen flat panel displays and liquid crystal display televisions. The number of vertical pixels is calculated from the horizontal resolution and the selected aspect ratio. To be fully expressible, the size of wide screen display must thus be a multiple of 16×9 pixels. For 1366×768 pixel Wide XGA panels the nearest resolution expressible in the EDID standard timing descriptor syntax is 1360×765 pixels. Specifying 1368 pixels as the screen width would yield an unnatural screen height of 769.5 pixels.

Many Wide XGA panels do not advertise their native resolution in the standard timing descriptors, instead offering only a resolution of 1280×768. Some panels advertise a resolution only slightly smaller than the native, such as 1360×765. For these panels to be able to show a pixel perfect image, the EDID data must be ignored by the display driver or the driver must correctly interpret the DTD and be able to resolve resolutions whose size is not divisible by 8."

which means, EDID data may not be enough for correct display resolution recovery, but DTD should be parsed instead.
Slice
Thanks for warning. I know
CODE
    for (i = 0; i < 4; i++, block+= DETAILED_TIMING_DESCRIPTION_SIZE) {
        int first = 1;
        if (!(block[0] == 0x00 && block[1] == 0x00)) {
            get_detailed_timing(block, &mode[num]);
            if (first) {
                mode[num].flag |= FB_MODE_IS_FIRST;
                first = 0;
            }
            num++;
        }
    }
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.