Jump to content

ATI Framebuffer development


  • Please log in to reply
465 replies to this topic

#81
Slice

Slice

    InsanelyMacaholic

  • Local Moderators
  • 2,953 posts
  • Gender:Male
  • Location:Moscow

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.

#82
Phoenix23

Phoenix23

    InsanelyMac Protégé

  • Members
  • Pip
  • 7 posts

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.insanel...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.

#83
Krazubu

Krazubu

    InsanelyMac Legend

  • Retired
  • 874 posts
Phoenix23 : Framebuffer for pre-X1000 boards never worked, being on old version or not, the driver has allways been PPC only. OpenGL support is an other problem, which is not the concern here yet.

#84
enzobelmont

enzobelmont

    InsanelyMac Geek

  • Members
  • PipPipPip
  • 168 posts

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.

done.




waiting for reply.

#85
dong

dong

    InsanelyMac Sage

  • Retired Developers
  • 366 posts
  • Gender:Male

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.

#86
Slice

Slice

    InsanelyMacaholic

  • Local Moderators
  • 2,953 posts
  • Gender:Male
  • Location:Moscow

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.

Attached Files



#87
dong

dong

    InsanelyMac Sage

  • Retired Developers
  • 366 posts
  • Gender:Male
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.
Attached File  RadeonDump.c.zip   5.62KB   28 downloads

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

#88
Slice

Slice

    InsanelyMacaholic

  • Local Moderators
  • 2,953 posts
  • Gender:Male
  • Location:Moscow
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 ));
	}


#89
dong

dong

    InsanelyMac Sage

  • Retired Developers
  • 366 posts
  • Gender:Male

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.

#90
Slice

Slice

    InsanelyMacaholic

  • Local Moderators
  • 2,953 posts
  • Gender:Male
  • Location:Moscow

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.

#91
Slice

Slice

    InsanelyMacaholic

  • Local Moderators
  • 2,953 posts
  • Gender:Male
  • Location:Moscow
Dong!
I have new idea.
Make ./RadeonDump -c -- getConnectorInfo

#92
Slice

Slice

    InsanelyMacaholic

  • Local Moderators
  • 2,953 posts
  • Gender:Male
  • Location:Moscow
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

#93
Slice

Slice

    InsanelyMacaholic

  • Local Moderators
  • 2,953 posts
  • Gender:Male
  • Location:Moscow
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.

#94
Slice

Slice

    InsanelyMacaholic

  • Local Moderators
  • 2,953 posts
  • Gender:Male
  • Location:Moscow
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.

#95
dong

dong

    InsanelyMac Sage

  • Retired Developers
  • 366 posts
  • Gender:Male

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.

#96
Pericles Silva

Pericles Silva

    InsanelyMac Protégé

  • Members
  • PipPip
  • 54 posts
  • Gender:Male
  • Location:Rio Grande do Sul - Brasil
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!

#97
Phoenix23

Phoenix23

    InsanelyMac Protégé

  • Members
  • Pip
  • 7 posts

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?

#98
Slice

Slice

    InsanelyMacaholic

  • Local Moderators
  • 2,953 posts
  • Gender:Male
  • Location:Moscow

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?

Attached Files



#99
Slice

Slice

    InsanelyMacaholic

  • Local Moderators
  • 2,953 posts
  • Gender:Male
  • Location:Moscow

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

#100
Phoenix23

Phoenix23

    InsanelyMac Protégé

  • Members
  • Pip
  • 7 posts

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





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

© 2014 InsanelyMac  |   News  |   Forum  |   Downloads  |   OSx86 Wiki  |   Mac Netbook  |   PHP hosting by CatN  |   Designed by Ed Gain  |   Logo by irfan  |   Privacy Policy