Jump to content

ATI Framebuffer development


Slice
 Share

466 posts in this topic

Recommended Posts

I still have no good connectionsInfo from BIOS (linux procedure is wrong) and can't get EDID neither from BIOS nor from I2C. Any other ideas or sources?

I found this: http://www.defyne.org/dvb/driver.html

Take a look at the "Generic I²C interfaces" part, maybe it can be used.

I also found the source link from its forum: http://rapidshare.com/files/100821938/dvb.zip.html

The I2C souce is located in folder "driver".

 

Dong, can you modify RadeonPCI to read I2C? Just copy I2C routines from RadeonFB and make Client "./RadeonDump -i bus,addr,length". Hex output to screen.

I'll take a look at it to see if I can do anything here.

 

Bad, bad, bad...

I got black screen even if I comment out all RadeonFB additions. So the project is damaged at basis. :dev:

Return to initials. But all my corrections in Radeon's procedures are actual.

I'm stucking at the very beginning too, whenever a struct variable with protocol defined in radeonHD header file is initialized or visited in my RadeonX1000.cpp, I got a kernel panic even without doing anything else. Did not figure out any clue yet.

 

Edited:

Well, I found a very interesting thing. A hot reboot will always cause the kernel panic but if I power off and boot, sometimes no kernel panic. What could be the problem?

Link to comment
Share on other sites

Take a look at the "Generic I²C interfaces" part, maybe it can be used.

I also found the source link from its forum:

The I2C souce is located in folder "driver".

I have different linux sources and even MacOSX sources. Thanks for other one.

Wow! I see sources of PhilipsSAA7146! My TVTuner is 7133. Some new chance!

Now I need testing variants. I need ./RadeonDump

I'll take a look at it to see if I can do anything here.

You need to call

IONDRVFramebuffer::doI2CRequest(

but may be change class to something else

and also include all dependencies.

Joblo use

req.replyTransactionType = kIOI2CSimpleTransactionType

I think it is an error, we need kIOI2CDDCciReplyTransactionType

I'm stucking at the very beginning too, whenever a struct variable with protocol defined in radeonHD header file is initialized or visited in my RadeonX1000.cpp, I got a kernel panic even without doing anything else. Did not figure out any clue yet.

 

Edited:

Well, I found a very interesting thing. A hot reboot will always cause the kernel panic but if I power off and boot, sometimes no kernel panic. What could be the problem?

The problem is in dynamic memory allocation. RadeonFB uses IOMalloc in internal procedure. So variables created temporary and randomly destroyed or pointer attached to wrong address. In my latest sources I change many of these errors. Now I have no KP.

Link to comment
Share on other sites

Now I need testing variants. I need ./RadeonDump

You need to call

IONDRVFramebuffer::doI2CRequest(

but may be change class to something else

and also include all dependencies.

I put these codes in RadeonDump.c and changed some functions with user space version. Don't know if it will cause any unexpected results. I just failed to dump any I2C data. You may play with it.

RadeonDump.c.zip

Joblo use

req.replyTransactionType = kIOI2CSimpleTransactionType

I think it is an error, we need kIOI2CDDCciReplyTransactionType

I saw you did not has I2CReadDDCciData yet, thus I did not take care of it.

The problem is in dynamic memory allocation. RadeonFB uses IOMalloc in internal procedure. So variables created temporary and randomly destroyed or pointer attached to wrong address. In my latest sources I change many of these errors. Now I have no KP.

Did you mean IOMalloc in an static function will cause such problem?

Link to comment
Share on other sites

Just a side question maybe a little bit offtopic. In another thread I read that in the very first stages of the 10.5 generation GL/QE/CI worked with old cards. Is this true?

 

If so, what if the problem would not be the drivers itself but instead the whole GL/CI/QE framwork system, which could be rewritten at a later point of the beta development to match new requirements?

Link to comment
Share on other sites

In phoronix forums there is an thread called "Ask ATI devs" there are ati devs answering to linux users.

May be you can help us with the parley? I want to get Radeon R3xx-R4xx registers description from ATI-AMD company. For example I2C registers.

 

I put these codes in RadeonDump.c and changed some functions with user space version. Don't know if it will cause any unexpected results. I just failed to dump any I2C data. You may play with it.

 

I saw you did not has I2CReadDDCciData yet, thus I did not take care of it.

OK! It is a great help for me. I will play.

EDITED: O, no! It can't be performed from user space! Because we must operate with Radeon registers.

Yes, Dong! You are great programmer! ;) The RadeonDump works and I can play with different methods without reboot!

Not successful yet. Timeouts! Or registers is not DDC registers. :)

void IONDRVFramebuffer::setDDCData( IOIndex connectIndex, UInt32 value  )
{
val = INREG(rinfo->i2c[connectIndex].ddc_reg) & ~(VGA_DDC_DATA_OUT_EN);

I found in AMD document about RV630 that I2C/DDC registers are not the same as Joblo used.

It is a question. Is Joblo's method good for R300 and we need to write other method for R600? Or the method is wrong at all?

If so I don't know how to be with R200-R500. May be manually create EDID based on Windows's information.

Did you mean IOMalloc in an static function will cause such problem?

We have a mixture of C static functions and C++ classes. It is a problem for dymanic memory allocation. It is better to make all procedure inside classes. Compare my last sources with previous one and find differencies in using variables. (I use BBedit to compare).

But I didn't make good classes yet.

Now I will to write all Radeon additions to one class IORadeonDRV. But I can't make this class as separate kext. I can only make it inside IONDRVSuppor.kext cause I can't understand how to do.

 

Just a side question maybe a little bit offtopic. In another thread I read that in the very first stages of the 10.5 generation GL/QE/CI worked with old cards. Is this true?

 

If so, what if the problem would not be the drivers itself but instead the whole GL/CI/QE framwork system, which could be rewritten at a later point of the beta development to match new requirements?

We are not Apple's developers so we don't know this point. We only try to create new driver. As for me I work under Tiger.

Link to comment
Share on other sites

We are not Apple's developers so we don't know this point. We only try to create new driver. As for me I work under Tiger.

 

I know and I'm just curious what exactly may have changed that causes the drivers not working as they did in previouse Tiger versions. What made me think about it was actually this post, which seems to be the latest work around for older ATI cards in Tiger 10.4.8 and up.

 

http://forum.insanelymac.com/index.php?showtopic=43829

 

He not only changed the drivers but the whole OpenGL.Framework too. Maybe this is just stupid and he messed up with the drivers and the whole OpenGL.Framework changing is just unessential at all. Since I do use Leo instead of Tiger I can't try it myself I just gave it a thought.

Link to comment
Share on other sites

I found in AMD document about RV630 that I2C/DDC registers are not the same as Joblo used.

It is a question. Is Joblo's method good for R300 and we need to write other method for R600? Or the method is wrong at all?

If so I don't know how to be with R200-R500. May be manually create EDID based on Windows's information.

I will try to play with R5XX registers with procedures in radeonHD source code.

We have a mixture of C static functions and C++ classes. It is a problem for dymanic memory allocation. It is better to make all procedure inside classes. Compare my last sources with previous one and find differencies in using variables. (I use BBedit to compare).

But I didn't make good classes yet.

Now I will to write all Radeon additions to one class IORadeonDRV. But I can't make this class as separate kext. I can only make it inside IONDRVSuppor.kext cause I can't understand how to do.

Edited:

Seems to be other problem in my case. The memory allocation is actually doing well with linux code.

Link to comment
Share on other sites

I will try to play with R5XX registers with procedures in radeonHD source code.

Look my comments in attached file

Instead, I have to use below codes in OSX.

RHDPtr RHDGetRec(void)
{
RHDPtr rhdPtr = IONew(RHDRec, 1);
return rhdPtr;
}

In the linux driver, there are a lot of usage of the previous one, I doubt that's why I got kernel panic easily when using those codes without paying attention to it yet.

It is namely situation that I hate. Pointer created in stack may be loosed after return. I prefer to allocate memory only in outer procedures. Or only for internal use.

 

My stop is still at EDID. I do numerous attempts to get EDID from DDC. I rewrite RadeonDump according to I2C specification.

Then I try to reverse I2C bus ( 1 0) :blink: Why I know that Radeon chip output=1 correspond to +5V on bus and monitor understand it as logical 1 or 0? After the reverse I got some result:

now I have response only from register 0x60. That is different response from different registers!

This register correspond to my BIOS tracing in which I have only one DDC connect namely with the register.

In my sources I randomly change syntax

./RadeonDumpS -i reg,addr,size

for example 60,a0,80 - all values are Hex.

Try! May be someone would be more successful with the variant.

RadeonDumpS.zip

Link to comment
Share on other sites

New progress!

I managed to use RadeonDump to get EDID on my thinkpad T60 from user space.

MyLenovo:RadeonPCI dong$ ./RadeonDump -i
Found a device of class RadeonPCI: IOService:/AppleACPIPlatformExpert/PCI0@0/AppleACPIPCI/AGP@1/IOPCI2PCIBridge/VID@0/RadeonPCI
it matched on name "display"
Start I2C dump
Read EDID at bus 0 failed
Read EDID at bus 1 failed
EDID at bus 2:
0x0000: 00FFFFFFFFFFFF0030AE224000000000
0x0010: 2D100103801D1578EA6F959C544C8726
0x0020: 21505421080081800101010101010101
0x0030: 010101010101302A7820511A10403070
0x0040: 13001FD71000001825237820511A1040
0x0050: 307013001FD7100000180000000F0090
0x0060: 43329043280F010030649055000000FE
0x0070: 004C5444313431454E39420A20200035

Like I have mentioned, the source code in radeonHD is applied and it really works! :)

Thanks Slice for your idea to test it in RadeonDump, I did not think of it before.

RadeonDump.c.zip

 

I have a dumb question, how do I know which bus line I am at in the IONDRVFramebuffer class code environment?

Link to comment
Share on other sites

Five :)

And what about Dell?

I don't know yet what is happen with my radeon. May be I need to use GPIO_MASK... which is not used anywhere?

I have a dumb question, how do I know which bus line I am at in the IONDRVFramebuffer class code environment?

1. GetConnectionInfo as I already do in previous project. It is intended for any Radeon and any BIOS.

2. Look at basis

bool IODisplay::start( IOService * provider )
{
IOFramebuffer *	framebuffer;
UInt32		connectFlags;
OSData *		edidData;
EDID *		edid;
UInt32		vendor = 0;
UInt32		product = 0;

if (!super::start(provider))
	return (false);

if (!fConnection)
	// as yet unmatched display device (ADB)
	return (true);

framebuffer = fConnection->getFramebuffer();
assert( framebuffer );

fConnection->getAttributeForConnection( kConnectionFlags, &connectFlags);
setProperty( kIODisplayConnectFlagsKey, &connectFlags, sizeof( connectFlags ));

edidData = OSDynamicCast( OSData, getProperty( kIODisplayEDIDKey ));
if (!edidData)
{
	readFramebufferEDID();
	edidData = OSDynamicCast( OSData, getProperty( kIODisplayEDIDKey ));
}

Link to comment
Share on other sites

Five :)

And what about Dell?

I don't know yet what is happen with my radeon. May be I need to use GPIO_MASK... which is not used anywhere?

 

Do not have a chance to test it on Dell as my wife is using it all the time with WinXP. Anyway, X600 is not in R5XX, but R3XX. Guess I need check source in xf86-video-ati-6.8.0, another linux driver that covers all radeon cards.

 

Looks like you are using software I2C, but radeonHD is using hardware I2C through these GPIO_MASK registers.

Link to comment
Share on other sites

Do not have a chance to test it on Dell as my wife is using it all the time with WinXP.

I can wait

Anyway, X600 is not in R5XX, but R3XX. Guess I need check source in xf86-video-ati-6.8.0, another linux driver that covers all radeon cards.

I already use these sources. No success

Looks like you are using software I2C, but radeonHD is using hardware I2C through these GPIO_MASK registers.

Yes, you are more happy. I need to use software I2C and I hope it would works.

My variant RadeonDumpS is for R200-R400 and may be beyond. Needed to check.

Link to comment
Share on other sites

Software I2C doesn't work in user space because of undertermined timeouts.

I make

old = clock();
usleep(anyvalue);
now = clock();
printf("...", now - old);

and got 0 or any other values

Link to comment
Share on other sites

Stop. ;)

I tested GPIO registers bit by bit in any sequence. I have good timings.

I have no response from I2C bus. Like non-DDC monitor.

Go to search other possibility to read EDID or compose it from other infos.

Link to comment
Share on other sites

I am looking into Radeon Mobility Radeon 9000 driver for Windows XP :) Partially clear.

I found inside two group of procedures for I2C. One is hardware I2C like Dong does but with registers 90, 94, 98. Other is software I2C like Joblo's method but with registers 198, 1a0, 1a4, 1a8. But I can't trace all settings and only can suppose masks for read Data and Clock.

Now I have new hope to get EDID from my configuration.

 

I ask for testers to try RadeonPCI and RadeonDump. I want to know other successful stories.

Link to comment
Share on other sites

II found inside two group of procedures for I2C. One is hardware I2C like Dong does but with registers 90, 94, 98. Other is software I2C like Joblo's method but with registers 198, 1a0, 1a4, 1a8. But I can't trace all settings and only can suppose masks for read Data and Clock.

Now I have new hope to get EDID from my configuration.

 

xf86DDC.c/xf86i2c.c also contains the same two way only that no registers are mentioned there as it's just a general implemention.

Link to comment
Share on other sites

People, just to say: if you need a tester, here i am. I have a Acer Aspire 5040, running Leopard 10.5.3, with Radeon X200M Inside. I can set 256mb memory im BIOS, but appears only 48mb in System Properties. I'm using Callisto 003 Fixed to manage the full screen (1280 x 800).If i can help in someone, please, let me know! Thanks for the all hard working people!

P.S: My device info shows 1002 and 5975... if this help someone... using LSPCI from OSX86Tools

Thanks!

Link to comment
Share on other sites

I ask for testers to try RadeonPCI and RadeonDump. I want to know other successful stories.

 

Since you and dong are working both on some sort of different versions of RadeonDump, the code is still in progress and I don't realy have a clue what your changes in the different stages are, any chance of a compiled/build version?

 

Since I'm running a RV370 my best guess for now would be, to use the dong version (RadeonDump) rather than yours (RadeonDumpS), build it and take a look if it's propably getting some output. Right?

Link to comment
Share on other sites

People, just to say: if you need a tester, here i am. I have a Acer Aspire 540, running Tiger 10.5.3, with Radeon X200M Inside. I can set 256mb memory im BIOS, but appears only 48mb in System Properties. I'm using Callisto 003 Fixed to manage the full screen (1280 x 800).If i can help in someone, please, let me know! Thanks for the all hard working people!

P.S: My device info shows 1002 and 5975... if this help someone... using LSPCI from OSX86Tools

Thanks!

Test, please, ATILead,

RadeonPCI, and RadeonDump variants post 79, 86, 87

 

Windows driver have 4 methods for DDC

1. Hardware I2C with regs 90,94,98

2. Software I2C with regs 198,19c,1a0,1a4 data mask 200, clock 400

3. Software I2C with regs 198,19c,1a0,1a4 data mask 4000, clock 8000

4. Software I2C with regs 1a8,1ac,1b0,1b4 data mask 4000000, clock 8000000

I have all information except initializations. I am still not successful.

May be some mistake in my codes?

RadeonDumpS.c.zip

Link to comment
Share on other sites

Since you and dong are working both on some sort of different versions of RadeonDump, the code is still in progress and I don't realy have a clue what your changes in the different stages are, any chance of a compiled/build version?

 

Since I'm running a RV370 my best guess for now would be, to use the dong version (RadeonDump) rather than yours (RadeonDumpS), build it and take a look if it's propably getting some output. Right?

Dong version is for R500 and my version is for R200-R400.

So you need

kextload -v RadeonPCI.kext

./RadeonDumpS -i x,y,z

x = 0 or 1 -- two I2C buses

y=a0 -- device adrress for EDID

z=1,2,20,200,4000,4000000 -- bit mask for data line

with z=4 or 10 I got brightness play :)

with z=80 I got random numbers generator

Link to comment
Share on other sites

Dong version is for R500 and my version is for R200-R400.

So you need

kextload -v RadeonPCI.kext

./RadeonDumpS -i x,y,z

x = 0 or 1 -- two I2C buses

y=a0 -- device adrress for EDID

z=1,2,20,200,4000,4000000 -- bit mask for data line

with z=4 or 10 I got brightness play ;)

with z=80 I got random numbers generator

 

Thanks for the Info, RadeonPCI.kext is loading as it should, still would need a compiled version of RadeonDumpS for 10.5.1, since I don't got XCode3 :/ Any other compiler that could help me out instead, 1.1GB download for just one file to compile *outch* :P

Link to comment
Share on other sites

 Share

×
×
  • Create New...