Jump to content

ATI Framebuffer development


Slice
 Share

466 posts in this topic

Recommended Posts

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 ;) . 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.

IOGraphics_1442.zip

radeonFB_updated.zip

RadeonXF.zip

RadeonHD.zip

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Next step:

I got more sources about Radeon. Now I have correct procedure to read LegacyBIOS while XRadeonFB project deals only with ATOMBIOS.

Bool RADEONGetConnectorInfoFromBIOS (ScrnInfoPtr pScrn)
{
RADEONInfoPtr info = RADEONPTR (pScrn);

if(!info->VBIOS) return FALSE;

if (info->IsAtomBios)
return RADEONGetATOMConnectorInfoFromBIOS(pScrn);
else
return RADEONGetLegacyConnectorInfoFromBIOS(pScrn);
}

Link to comment
Share on other sites

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

	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

	/* 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

Link to comment
Share on other sites

Find differencies in INDRVSupport v1.4.3 and 1.4.4

v1.4.3

	 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

 	data = (OSData *) intSpec->getObject(kIONDRVPCIInterruptSource);
	if (data)
		provider->setProperty( gIODTAAPLInterruptsKey, data );

Where kIONDRVPCIInterruptSource = 0

v1.4.3

if (device->getFunctionNumber())

v1.4.4

	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

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

Reseach continue

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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!

	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 ;) . 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):

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.

Link to comment
Share on other sites

About RadeonHD project. http://wiki.x.org/wiki/radeonhd

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 --auto during runtime, or with Option "PreferredMode" "" with newer Xservers (known to be buggy up to Xserver 1.4.0).

It is Linux!

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Hiya :)

 

Just wanted to mention that I am also very interested in this project! :D 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.

Link to comment
Share on other sites

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. :angel:

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!

Link to comment
Share on other sites

It would be best framebuffer. :)

 

Great, go for it! |-)

 

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! :lol:

Link to comment
Share on other sites

What is the flag

		if ((data = OSDynamicCast(OSData, provider->getProperty(kIOFBHostAccessFlagsKey))))
		accessFlags = *((UInt32 *) data->getBytesNoCopy());

Any ideas?

 

Host means AGP controller???

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

 Share

×
×
  • Create New...