Jump to content

Editing custom personalities for ATI Radeon HD[45]xx


bcc9
 Share

775 posts in this topic

Recommended Posts

Extremely helpful.

 

For most mobility cards, you can't dump video bios to file with gpu-z. But dong's old tool (also named radeondump) posted in the X Labs thread ATIFramebuffer will dump it to file.

 

This explains 1 reason why prior attempts at LVDS failed. LVDS is on port 1!

All the native FB with LVDS have LVDS on port 0

 

bash-3.2# ./radeondump < ./VBIOS/9552.0301.00E0.vga.rom 
ATOM BIOS Rom: 
SubsystemVendorID: 0x1028 SubsystemID: 0x02aa
IOBaseAddress: 0xde00
Filename: BR31245C.001
BIOS Bootup Message: 
Dell_Roberts_M92S_GDDR3 M92 GDDR3 64bit 450e/600m						   

Connector at index 0 type: VGA (1)
Connector's i2cid: 91
Connector at index 1 type: LVDS (7)
Connector's i2cid: 90

 

So the senseid values are:

VGA: (91&0xf)+1 = 2

LVDS: (90&0xf)+1=1

Link to comment
Share on other sites

I been trying for figure this stuff out for a majority of last night, but was unsuccessful to find my senseID values. I was not able to calculate them properly or doing it wrong somewhere. I must have been adding the wrong values.

 

After the radeondump v0.02 tool was posted, I was able to get this.

 

   ./radeondump < 1002_9460.rom
  ATOM BIOS Rom: 
   SubsystemVendorID: 0x174b SubsystemID: 0xe115
   IOBaseAddress: 0x0000
   Filename: E115QA1G.S02
   BIOS Bootup Message: 
  WEKIVA RV790 B790 BOARD 850E/975M										 

  Connector at index 0 type: DVI-I (2)
  Connector's i2cid: 93
  Connector at index 1 type: DVI-I (2)
  Connector's i2cid: 93
  Connector at index 2 type: VGA (1)
  Connector's i2cid: 90
  Connector at index 3 type: HDMI-A (11)
  Connector's i2cid: 91
  Connector at index 4 type: DisplayPort (10)
  Connector's i2cid: 92

Also, here is my Motmot ConnectorInfo table.

 

__ZN10MotMotInfo10createInfoEhR18PlatformParameters:
0000b838	pushl	%ebp
0000b839	movl	%esp,%ebp
0000b83b	movl	0x0c(%ebp),%ecx
0000b83e	movl	$0x0000e180,0x08(%ecx)
0000b845	movb	$0x02,0x04(%ecx)
0000b849	xorl	%edx,%edx
0000b84b	leal	(%edx,%edx,4),%eax
0000b84e	leal	0x000102e0(,%eax,4),%eax
0000b855	movl	%eax,0x0c(%ecx,%edx,4)
0000b859	incl	%edx
0000b85a	movzbl	0x04(%ecx),%eax
0000b85e	cmpl	%edx,%eax
0000b860	jg	0x0000b84b
0000b862	xorl	%eax,%eax
0000b864	leave
0000b865	ret

 

Can you elaborate a bit more on how to calculate the senseID value? And once I get this value, where do I insert the C-Code on post#1? DSDT? Thanks in advance. I would really like to get dual monitor working on my 4890. Thank you in advance.

 

Other numbers that might be usefull.

My i1386 arch offset is 151552

102e0+b855= 1BB35 = 113461 dec value

Link to comment
Share on other sites

Extremely helpful.

 

For most mobility cards, you can't dump video bios to file with gpu-z. But dong's old tool (also named radeondump) posted in the X Labs thread ATIFramebuffer will dump it to file.

For dumping ATI video bios, there is atiflash.exe

You can write this dos executable to a freedos formatted usb thumbdrive and dump the full video bios that way.

 

More simply, if you can at least boot into osx with your card, you can look at the ioregistry, and most of the video bios is present under the ATY,bin_image key.

Covert from hex to binary with xxd, and you're done. Luckily radeondump only needs something less than the first 64K of the bios to read the atom bios information.

Being able to regenerate the bios from just an ioregistry dump is pretty convenient - I was able to do this from an apple store system.

 

Oh, didn't realize there was a namespace collision. radeon_bios_decode maybe?

 

Can you elaborate a bit more on how to calculate the senseID value?

Since I claimed:

senseid = (i2cid & 0xf) +1;

 

from your dump it can be seen that your card has 4 connectors:

dual-link DVI, senseid: 4

VGA, senseid: 1

HDMI: senseid: 2

DP: senseid: 3

And once I get this value, where do I insert the C-Code on post#1? DSDT? Thanks in advance. I would really like to get dual monitor working on my 4890. Thank you in advance.
Then you proceed with the rest of post #1 where you dump out the best matching personality table(s) and build a new one that exactly matches the 4 connectors you have. Then binary patch ATIFramebuffer with the result. Since motmot is what chameleon thinks you card should have, I'd start there, but it's obviously not going to be a complete table since it only includes 2 connectors.
Link to comment
Share on other sites

For dumping ATI video bios, there is atiflash.exe

You can write this dos executable to a freedos formatted usb thumbdrive and dump the full video bios that way.

Doesn't work, tried it months ago. Like many laptops the video bios is locked so it cannot be flashed or read.

More simply, if you can at least boot into osx with your card, you can look at the ioregistry, and most of the video bios is present under the ATY,bin_image key.

Covert from hex to binary with xxd, and you're done. Luckily radeondump only needs something less than the first 64K of the bios to read the atom bios information.

Being able to regenerate the bios from just an ioregistry dump is pretty convenient - I was able to do this from an apple store system.

Nice trick. I wanted to compare the ports with my daughters MBP, but dongs tool doesn't work on it

 

[EDIT -- most curious -- in my system -- currently using dong's FB until/unless we get Mobility Radeon working -- there is no ATY,bin_image key

 

Now I have read the 5xxx cards need to load the video bios with Chameleon and the VideoROM key in com.apple.boot.plist.

 

Could be Mobility cards with locked VBIOS have same issue & so am going to try loading my VBIOS in the same way, then retry the modified FB.]

Oh, didn't realize there was a namespace collision. radeon_bios_decode maybe?

Good choice

Link to comment
Share on other sites

Viola, all 3 ports are now working with my card...

 

Hope this helps others with non-working ports or with HDMI audio problems.

Questions/comments?

 

bcc9,

Thanks for such an excellent guide for us.

According to your theory and successful experience is it essential to use the connector-type 0x800 for HDMI audio ?

Because my MSI Hawk 5770 need a DP->HDMI convertor to get HDMI audio working by Eulemur FB which actually use the connector-type 0x800.

Is it possible to download your modified ATIFrameBuffer for us to test or verify whether it can be working for other ATI HD 5xxx cards by Uakari FB ?

Link to comment
Share on other sites

Acer Aspire 5738ZG ATI Radeon Mobility HD 4570

$ ./radeondump < 9553.0301.00E0.vga.rom 

ATOM BIOS Rom: 
SubsystemVendorID: 0x1025 SubsystemID: 0x0205
IOBaseAddress: 0x2000
Filename: BR33359D.bin
BIOS Bootup Message: 
Acer_JV50_MV_M92M2_XT_DDR3 M92 DDR3 64bit 680e/800m						 

Connector at index 0 type: LVDS (7)
Connector's i2cid: 96
Connector at index 1 type: VGA (1)
Connector's i2cid: 90
Connector at index 2 type: HDMI-A (11)
Connector's i2cid: 91

 

So...

 

LVDS (96&0xf) = 7

VGA (90&0xf) = 1

HDMI (91&0xf) = 2

Link to comment
Share on other sites

That would depend upon the capabilities of your video card. Your card's DVI ports may carry HDMI audio (but probably not). To know for sure, check your lspci output.

Borrowing from Kabyl's post:

lspci -nnvd 0x1002: | grep -B2 Subsystem

Would show you two PCI devices if your video card supports audio. The second PCI device with audio class (0403) would be the audio device. Example:

 lspci -nnvd 0x1002: | grep -B2 Subsystem
   01:00.0 VGA compatible controller [0300]: ATI Technologies Inc Redwood [Radeon HD 5670] [1002:68d8] (prog-if 00 [VGA controller])
		   Subsystem: PC Partner Limited Device [174b:e151]
   --

   01:00.1 Audio device [0403]: ATI Technologies Inc Redwood HDMI Audio [Radeon HD 5600 Series] [1002:aa60]
		   Subsystem: PC Partner Limited Device [174b:aa60]

 

Yep, the dvi carry audio since it works under windows using a dvi>hdmi adapter, and here is the

lspci -nnvd 0x1002: | grep -B2 Subsystem (Radeon HD 4850 Gainward GoldenSample) :

01:00.0 VGA compatible controller [0300]: ATI Technologies Inc RV770 [Radeon HD 4850] [1002:9442] (prog-if 00 [VGA controller])
	Subsystem: CardExpert Technology Unknown device [10b0:0801]
--
01:00.1 Audio device [0403]: ATI Technologies Inc HD48x0 audio [1002:aa30]
	Subsystem: CardExpert Technology Unknown device [10b0:aa30]

 

The card has 3 ports :

dual-link DVI, senseid: 3

9 pin DIN (s-video), senseid: ?

dual-link DVI, senseid: 4

 

So, according to your finds i have to overwrite bytes on a personality with 3 ports : dvi at port 0 with senseid=3, s-video at port 1 with unknown senseid and dvi at port 0 with senseid=4 but it seems the second port (s-video) doesn't have I2CID:

 

ATOM BIOS Rom: 
  SubsystemVendorID: 0x10b0 SubsystemID: 0x0801
  IOBaseAddress: 0x0000
  Filename: 48501170.234
  BIOS Bootup Message: 
 ATI RADEON HD4800 SERIES												 

 Connector at index 0 type: DVI-I (2)
 Connector's i2cid: 92
 Connector at index 1 type: DVI-I (2)
 Connector's i2cid: 92
 Connector at index 2 type: 9 pin DIN (9)
 Connector at index 4 type: DVI-I (2)
 Connector's i2cid: 93
 Connector at index 5 type: DVI-I (2)
 Connector's i2cid: 93

 

 

I remember the s-video, vga and dvi ports used to work on my old HD3850 under 10.5.8 using Megalodon Framebuffer

so i had a look to Megalodon :

 

It uses 3 different connectors on 3 ports :

movb $0x03

addl $0x00010cc0 (60800)

 

offset_for_segment = 61624

start_address_for_segment = 60800

155648+61624+68800-60800 = 225272

 

0000000 00 02 00 00 14 00 00 00 00 00 00 00 00 01 01 11 > What type of connector ? LVDS (?)

0000010 04 00 00 00 16 00 00 00 00 00 00 00 00 10 02 12 > DVi

0000020 80 00 00 00 02 00 00 00 04 00 00 00 00 10 00 00 > What type of connector ?

 

We can see the dvi connector at port 1 but what are port 0 and port 2 connectors ? S-video and vga ?

 

Thx again for this great work bcc9 :)

Link to comment
Share on other sites

Acer Aspire 5738ZG ATI Radeon Mobility HD 4570

$ ./radeondump < 9553.0301.00E0.vga.rom 

ATOM BIOS Rom: 
SubsystemVendorID: 0x1025 SubsystemID: 0x0205
IOBaseAddress: 0x2000
Filename: BR33359D.bin
BIOS Bootup Message: 
Acer_JV50_MV_M92M2_XT_DDR3 M92 DDR3 64bit 680e/800m						 

Connector at index 0 type: LVDS (7)
Connector's i2cid: 96
Connector at index 1 type: VGA (1)
Connector's i2cid: 90
Connector at index 2 type: HDMI-A (11)
Connector's i2cid: 91

 

So...

 

LVDS (96&0xf) = 7

VGA (90&0xf) = 1

HDMI (91&0xf) = 2

 

After this I've tried to mod Vervet personality

 

	000000 00 02 00 00 14 00 00 00 00 01 00 00 00 00 06 07 LDVS port*
000010 00 04 00 00 00 04 00 00 00 01 00 00 12 04 04 01 VGA port**
000020 00 08 00 00 00 02 00 00 00 01 00 00 22 05 05 02 HDMI port
000030 00 08 00 00 00 02 00 00 00 01 00 00 22 05 05 05

*Suposed to be LDVS code.

**I think that is DVI code, but there isn't any VGA example.

 

The result of this:

 

- Laptop's screen: I've got a black screen but it seems to be detected with correct resolution 1366x768.

- VGA's screen: It doesn't work. I don't know if something happens like laptop's screen.

- HDMI's screen: For first time works! It's detected with correct resolution 1440x900.

 

And happens a strange thing. The screens are switched. In Preference Panel if I change the resolution of HDMI monitor changes in the Laptop and when I change the resolution of Laptop's screen changes in HDMI.

 

In Ioregistryexplorer I can see only 2 "Frambuffer" loaded. The both are Vervet and 0 seems to have Laptop's screen information and 1 of HDMI.

 

I want try other framebuffers supposedly to be more friendly to 4000 series like Peregrine, Motmot, Flicker, etc

Link to comment
Share on other sites

Yep, the dvi carry audio since it works under windows using a dvi>hdmi adapter, and here is the

lspci -nnvd 0x1002: | grep -B2 Subsystem (Radeon HD 4850 Gainward GoldenSample) :

Great, then you should be able to get it to work. You may have to change the connector-type from DVI to HDMI for the port you have the adapter on before it'd pass audio. Remember also to inject the requisite hda-gfx strings to turn on the HDMI audio support.

So, according to your finds i have to overwrite bytes on a personality with 3 ports : dvi at port 0 with senseid=3, s-video at port 1 with unknown senseid and dvi at port 0 with senseid=4 but it seems the second port (s-video) doesn't have I2CID:

The port order in the ConnectorInfo table doesn't have to match the port order in your atom bios. Mine did not at least. However the senseid has to match up.

 

Now in your HD3850 example, you could figure out exactly which table entries are being used by which connector by dumping the ioregistry repeatedly with different connectors plugged in.

0000000 00 02 00 00 14 00 00 00 00 00 00 00 00 01 01 11 > What type of connector ? LVDS (?)
This one is not LVDS because the connector type ix 0x00000200 not 0x00000002=LVDS
0000020 80 00 00 00 02 00 00 00 04 00 00 00 00 10 00 00 > What type of connector ?
This one is probably s-video, notice that the senseid byte is 0.
Thx again for this great work bcc9 smile.gif
Thanks, I'm still waiting for the success stories :)
Link to comment
Share on other sites

It's still not working but I managed to get rid of the sound assertion :

 

Sound assertion "0 == hdaGfxCandidate" failed in "/SourceCache/AppleHDA/AppleHDA-184.4.3/AppleHDAController/AppleHDAController.cpp" at line 980 goto Exit

 

But now i have this error in log when i plug the hdmi display :

 

kernel	EDID CEA Extension Detailed Timing Descriptor Count & Attributes not valid for audio: 0xFFFFFFB1 (bit 6 is false)

 

post-290278-1299185018_thumb.jpg

 

 

continuing tests...

Link to comment
Share on other sites

It's still not working but I managed to get rid of the sound assertion :

 

Sound assertion "0 == hdaGfxCandidate" failed in "/SourceCache/AppleHDA/AppleHDA-184.4.3/AppleHDAController/AppleHDAController.cpp" at line 980 goto Exit

You get that when you don't have both hda-gfx strings inserted correctly. You need one for the device at PCI slotfunction 0 (GFX0) and one at PCI slotfunction 1 (HDAU).
Link to comment
Share on other sites

Ok, i thought it was good but my dsdt edit must {censored}, here it is :

 

		  Device (P0P2)
		{
			Name (_ADR, 0x00010000)
			Device (GFX0)
			{
				Name (_ADR, Zero)
				Method (_DSM, 4, NotSerialized)
				{
					Store (Package (0x02)
						{
							"hda-gfx", 
							Buffer (0x0A)
							{
								"onboard-1"
							}
						}, Local0)
					DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
					Return (Local0)
				}
			}

			Device (HDAU)
			{
				Name (_ADR, One)
				OperationRegion (HDAH, PCI_Config, Zero, 0x40)
				Field (HDAH, ByteAcc, NoLock, Preserve)
				{
					VID0,   16, 
					DID0,   16
				}

				Method (_DSM, 4, NotSerialized)
				{
					If (LEqual (Arg0, Buffer (0x10)
							{
								/* 0000 */	0xC6, 0xB7, 0xB5, 0xA0, 0x18, 0x13, 0x1C, 0x44, 
								/* 0008 */	0xB0, 0xC9, 0xFE, 0x69, 0x5E, 0xAF, 0x94, 0x9B
							}))
					{
						If (LNotEqual (And (VID0, 0xFFFF), 0xFFFF))
						{
							Store (Package (0x02)
								{
									"hda-gfx", 
									Buffer (0x0A)
									{
										"onboard-1"
									}
								}, Local0)
							DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
							Return (Local0)
						}
					}

					Return (0x80000002)
				}
			}
		}

post-290278-1299187356_thumb.jpg

Link to comment
Share on other sites

Now lets take a specific example, the Uakari personality. In UakariInfo::createInfo we see 1 addl instruction, it reads (I'm looking using 10.6.6 driver code as an example from here on):

0000d472 addl $0x000111c0,%eax

and for the number of connectors,

0000d467 movb $0x04,0x03(%ecx)

 

I lost here. When I did $ otool -arch i386 -vt ATIFramebuffer | c++filt | grep createInfo I only could see UakariInfo::createInfo(unsigned char, PlatformParameters&):. Where did you find the addl?

Link to comment
Share on other sites

I lost here. When I did $ otool -arch i386 -vt ATIFramebuffer | c++filt | grep createInfo I only could see UakariInfo::createInfo(unsigned char, PlatformParameters&):. Where did you find the addl?

 

i got the same thing.. Until i typed in the following command. make sure your using the appropriate arch. i1386 is 32bits. x84_64 is 64bit

 

otool -arch x86_64 -vt ATIFramebuffer | tee filename.txt

this allows the results to be written to a text file. The txt file will be in the same location as your ATIFramebuffer file. Once you get your file, you can open it with any text editor and search for Uakari. Find your profile underneath.

 

Hope this helps.

 

Link to comment
Share on other sites

Hi bcc9,

 

Thank you for the brilliant guide. I tried on my notebook (Dell Studio 1557 with HD4570). I was able to get the external monitor which is connected to HDMI port detected but for some reason there is no output. The monitor act like there is no signal to it. In System Profiler & IORegistryExplorer, I can see the monitor is properly detected at @0. I'm using peregrine personality. The monitor is full HD LCD. Do you have any idea why there is no output?

 

 

EDIT: Sorry. I forgot to post relevant information. I'm going to post it in a couple of minutes.

 

EDIT 2: Looks like I got QE/CI on the external monitor. I can see the water effect with Dashboard. Unfortunately no output on the external monitor, only can see it via VNC.

Link to comment
Share on other sites

i got the same thing.. Until i typed in the following command. make sure your using the appropriate arch. i1386 is 32bits. x84_64 is 64bit

 

otool -arch x86_64 -vt ATIFramebuffer | tee filename.txt

this allows the results to be written to a text file. The txt file will be in the same location as your ATIFramebuffer file. Once you get your file, you can open it with any text editor and search for Uakari. Find your profile underneath.

 

Hope this helps.

 

Thank you!! Now I can see the addl, movb, etc.

 

But it looks like I'm doing something wrong, when I edit a framebuffer found by me doesn't work :\

 

Hi bcc9,

 

Thank you for the brilliant guide. I tried on my notebook (Dell Studio 1557 with HD4570). I was able to get the external monitor which is connected to HDMI port detected but for some reason there is no output. The monitor act like there is no signal to it. In System Profiler & IORegistryExplorer, I can see the monitor is properly detected at @0. I'm using peregrine personality. The monitor is full HD LCD. Do you have any idea why there is no output?

 

 

EDIT: Sorry. I forgot to post relevant information. I'm going to post it in a couple of minutes.

 

EDIT 2: Looks like I got QE/CI on the external monitor. I can see the water effect with Dashboard. Unfortunately no output on the external monitor, only can see it via VNC.

 

Not bad at all, at least you have QE/CI, maybe editing the framebuffer you can have signal. What have you done?

Link to comment
Share on other sites

Not bad at all, at least you have QE/CI, maybe editing the framebuffer you can have signal. What have you done?

I did the same as you did except I use Peregrine personality.

 

My HD4570 connections:-

ATOM BIOS Rom: 
SubsystemVendorID: 0x1028 SubsystemID: 0x02bd
IOBaseAddress: 0x0000
Filename: BR034783.006
BIOS Bootup Message: 
BR034783-006 M92 DDR3 64bit 500e/800m									   

Connector at index 0 type: VGA (1)
Connector's i2cid: 95
Connector at index 1 type: HDMI-A (11)
Connector's i2cid: 91
Connector at index 2 type: LVDS (7)
Connector's i2cid: 90

VGA: senseid = (95 & 0xf) + 1 = 6

HDMI-A: senseid = (91 & 0xf) + 1 = 2

LVDS: senseid = (90 & 0xf) + 1 = 1

 

Peregrine initialization routine:-

otool -arch i386 -vt ATIFramebuffer | c++filt

PeregrineInfo::createInfo(unsigned char, PlatformParameters&):
0000d3fe	pushl	%ebp
0000d3ff	movl	%esp,%ebp
0000d401	movl	0x0c(%ebp),%ecx
0000d404	movl	$0x0000eccc,0x08(%ecx)
0000d40b	movb	$0x02,0x03(%ecx)
0000d40f	xorl	%edx,%edx
0000d411	movl	%edx,%eax
0000d413	shll	$0x04,%eax
0000d416	addl	$0x00010f40,%eax
0000d41b	movl	%eax,0x0c(%ecx,%edx,4)
0000d41f	incl	%edx
0000d420	movzbl	0x03(%ecx),%eax
0000d424	cmpl	%edx,%eax
0000d426	jg	0x0000d411
0000d428	xorl	%eax,%eax
0000d42a	leave
0000d42b	ret

ConnectorInfo address = 0x00010f40

 

lipo -detailed_info ATIFramebuffer

Fat header in: ATIFramebuffer
fat_magic 0xcafebabe
nfat_arch 2
architecture x86_64
cputype CPU_TYPE_X86_64
cpusubtype CPU_SUBTYPE_X86_64_ALL
offset 4096
size 149936
align 2^12 (4096)
architecture i386
cputype CPU_TYPE_I386
cpusubtype CPU_SUBTYPE_I386_ALL
offset 155648
size 148908
align 2^12 (4096)

File offsets for the FAT binary (i386 arch) = 155648

 

otool -arch i386 -l ATIFramebuffer

Section
 sectname __const
  segname __TEXT
  addr 0x0000ed80
  size 0x00002430
offset 61624
 align 2^5 (32)
reloff 83612
nreloc 1298
 flags 0x00000000
reserved1 0
reserved2 0
Section
 sectname __literal4
  segname __TEXT
  addr 0x000111b0
  size 0x00000004
offset 70888
 align 2^2 (4)
reloff 0
nreloc 0
 flags 0x00000003
reserved1 0
reserved2 0

ConnectorInfo address (0x00010f40) is in the range (address 0x0000ed80, size 0x00002430 : range between 0x0000ed80 & 0x000111b0). Offset for this segment is 61624.

 

OFFSET_TO_PEREGRINE_CONNECTIONS_TABLE = 155648 + 61624 + 0x00010f40 - 0x0000ed80

225912 = 155648 + 61624 + 69440 - 60800

 

dd if=ATIFramebuffer of=/tmp/peregrine bs=1 skip=225912 count=64

od -Ax -tx1 /tmp/peregrine

0000000	00  02  00  00  04  02  00  00  00  00  00  00  02  01  04  05
0000010	00  04  00  00  00  01  00  00  00  00  00  00  20  00  02  02
0000020	02  00  00  00  40  00  00  00  09  01  00  00  02  01  00  03
0000030	02  00  00  00  00  01  00  00  09  01  00  00  20  01  02  02
0000040

 

Patched the Peregrine connections table in ATIFramebuffer file at offset 0x37278 (225912 in decimal).

od -Ax -tx1 /tmp/peregrine

0000000	00  04  00  00  00  04  00  00  00  01  00  00  12  04  04  06	 (VGA)
0000010	00  08  00  00  00  02  00  00  00  01  00  00  22  05  05  02	 (HDMI-A)
0000020	00  02  00  00  14  00  00  00  00  01  00  00  00  00  06  01	 (LVDS)
0000030	02  00  00  00  00  01  00  00  09  01  00  00  20  01  02  02
0000040

 

Results:-

1) Still no output at external monitor which connected to HDMI port.

2) Checked using VNC, QE/CI are enabled because I can see the "water effect" with Dashboard. Correct/full resolution detected.

 

post-125711-1299273555_thumb.jpg

post-125711-1299273538_thumb.jpg

post-125711-1299273521_thumb.jpg

Link to comment
Share on other sites

I did the same as you did except I use Peregrine personality.

 

My HD4570 connections:-

ATOM BIOS Rom: 
SubsystemVendorID: 0x1028 SubsystemID: 0x02bd
IOBaseAddress: 0x0000
Filename: BR034783.006
BIOS Bootup Message: 
BR034783-006 M92 DDR3 64bit 500e/800m									   

Connector at index 0 type: VGA (1)
Connector's i2cid: 95
Connector at index 1 type: HDMI-A (11)
Connector's i2cid: 91
Connector at index 2 type: LVDS (7)
Connector's i2cid: 90

VGA: senseid = (95 & 0xf) + 1 = 6

HDMI-A: senseid = (91 & 0xf) + 1 = 2

LVDS: senseid = (90 & 0xf) + 1 = 1

 

Peregrine initialization routine:-

otool -arch i386 -vt ATIFramebuffer | c++filt

PeregrineInfo::createInfo(unsigned char, PlatformParameters&):
0000d3fe	pushl	%ebp
0000d3ff	movl	%esp,%ebp
0000d401	movl	0x0c(%ebp),%ecx
0000d404	movl	$0x0000eccc,0x08(%ecx)
0000d40b	movb	$0x02,0x03(%ecx)
0000d40f	xorl	%edx,%edx
0000d411	movl	%edx,%eax
0000d413	shll	$0x04,%eax
0000d416	addl	$0x00010f40,%eax
0000d41b	movl	%eax,0x0c(%ecx,%edx,4)
0000d41f	incl	%edx
0000d420	movzbl	0x03(%ecx),%eax
0000d424	cmpl	%edx,%eax
0000d426	jg	0x0000d411
0000d428	xorl	%eax,%eax
0000d42a	leave
0000d42b	ret

ConnectorInfo address = 0x00010f40

 

lipo -detailed_info ATIFramebuffer

Fat header in: ATIFramebuffer
fat_magic 0xcafebabe
nfat_arch 2
architecture x86_64
cputype CPU_TYPE_X86_64
cpusubtype CPU_SUBTYPE_X86_64_ALL
offset 4096
size 149936
align 2^12 (4096)
architecture i386
cputype CPU_TYPE_I386
cpusubtype CPU_SUBTYPE_I386_ALL
offset 155648
size 148908
align 2^12 (4096)

File offsets for the FAT binary (i386 arch) = 155648

 

otool -arch i386 -l ATIFramebuffer

Section
 sectname __const
  segname __TEXT
  addr 0x0000ed80
  size 0x00002430
offset 61624
 align 2^5 (32)
reloff 83612
nreloc 1298
 flags 0x00000000
reserved1 0
reserved2 0
Section
 sectname __literal4
  segname __TEXT
  addr 0x000111b0
  size 0x00000004
offset 70888
 align 2^2 (4)
reloff 0
nreloc 0
 flags 0x00000003
reserved1 0
reserved2 0

ConnectorInfo address (0x00010f40) is in the range (address 0x0000ed80, size 0x00002430 : range between 0x0000ed80 & 0x000111b0). Offset for this segment is 61624.

 

OFFSET_TO_PEREGRINE_CONNECTIONS_TABLE = 155648 + 61624 + 0x00010f40 - 0x0000ed80

225912 = 155648 + 61624 + 69440 - 60800

 

dd if=ATIFramebuffer of=/tmp/peregrine bs=1 skip=225912 count=64

od -Ax -tx1 /tmp/peregrine

0000000	00  02  00  00  04  02  00  00  00  00  00  00  02  01  04  05
0000010	00  04  00  00  00  01  00  00  00  00  00  00  20  00  02  02
0000020	02  00  00  00  40  00  00  00  09  01  00  00  02  01  00  03
0000030	02  00  00  00  00  01  00  00  09  01  00  00  20  01  02  02
0000040

 

Patched the Peregrine connections table in ATIFramebuffer file at offset 0x37278 (225912 in decimal).

od -Ax -tx1 /tmp/peregrine

0000000	00  04  00  00  00  04  00  00  00  01  00  00  12  04  04  06	 (VGA)
0000010	00  08  00  00  00  02  00  00  00  01  00  00  22  05  05  02	 (HDMI-A)
0000020	00  02  00  00  14  00  00  00  00  01  00  00  00  00  06  01	 (LVDS)
0000030	02  00  00  00  00  01  00  00  09  01  00  00  20  01  02  02
0000040

 

Results:-

1) Still no output at external monitor which connected to HDMI port.

2) Checked using VNC, QE/CI are enabled because I can see the "water effect" with Dashboard. Correct/full resolution detected.

 

post-125711-1299273555_thumb.jpg

post-125711-1299273538_thumb.jpg

post-125711-1299273521_thumb.jpg

 

I think that Peregrine has only 2 Ports.

 

I've tried with stock Peregrine, and any display was detected (logic because any port match xD), I connected my phone via VNC but QE/CI wasn't working, maybe because any display was detected.

Link to comment
Share on other sites

Thanks, I'm still waiting for the success stories :D

Well, Mobility cards are difficult, no one has gotten them to work. I've been trying for 1 1/2 years off and on.

I think this is a tremendous step. But I am thinking we still have a ways to go for mobility cards.

 

One issue is there is tremendous variation in how mobility cards are connected to displays.

I am wondering if we could get more info by examining the atom bios, as we are really guessing how to set bits 2-14 right now.

 

Both the Linux driver and dong's radeonhd.kext get info from the atombios to connect -- Apple's framebuffer obviously does not -- perhaps we can manually enter this info somehow. Or perhaps mobility cards are not possible.

Link to comment
Share on other sites

bcc9,

Thanks for such an excellent guide for us.

According to your theory and successful experience is it essential to use the connector-type 0x800 for HDMI audio ?

There is code in ATISupport that explicitly checks the connector type against 0x800 before considering that the display is HDMI. (Failing that it also checks for an hdmi dongle to decide whether the port is usable as hdmi.

 

In practice I had working video with my hdmi display with the wrong connector type, but I couldn't get HDMI audio to hotplug without revising the ConnectorInfo entry to actually be for an HDMI port.

I haven't actually tried all combinations however.

Also I see no such test for displayport, so I suspect audio could work over displayport without the connector type mapping properly.

Because my MSI Hawk 5770 need a DP->HDMI convertor to get HDMI audio working by Eulemur FB which actually use the connector-type 0x800.

Is it possible to download your modified ATIFrameBuffer for us to test or verify whether it can be working for other ATI HD 5xxx cards by Uakari FB ?

Well I don't want to get in the business of maintaining patched ATIFramebuffers, but I could upload the 64 byte uakari table I'm currently using. But basically I already gave that info in post #1 in hex...

 

000000 00 02 00 00 14 00 00 00 00 01 00 00 00 00 06 07 LDVS port*

3 posts now have matched LVDS against 00 02 00 00 in the binary, but I wrote that LVDS is 0x00000002 (in host/little endian byte order), which represented as a byte stream is:

02 00 00 00 not 00 02 00 00

Am I missing something? Where did you get this entry from?

- HDMI's screen: For first time works! It's detected with correct resolution 1440x900.
Horray, so sounds like the first partial success case, no?
Link to comment
Share on other sites

Well I don't want to get in the business of maintaining patched ATIFramebuffers, but I could upload the 64 byte uakari table I'm currently using. But basically I already gave that info in post #1 in hex....

Your guide and contribution are highly appreciated.

Your choice and decision are also respected.

I just hope to get your patched ATIFramebuffers (64 byte uakari table you're currently using) for a reference to comparison and verification.

Thanks for your help.

Link to comment
Share on other sites

Ok, i thought it was good but my dsdt edit must {censored}, here it is :
We could fill an entire thread just on DSDT editing. I think it would be easier to just patch chameleon to inject the necessary hda-gfx strings along with the rest of the ATI strings. In the meantime...

 

So that DSDT patch looks OK to me, but in general whether it actually is or not depends upon the PCI bus address for the PCI bridge that the ATI card is plugged into, which can be motherboard (and motherboard pci-e slot) dependent.

You can check with lspci -nnvt to verify the address for the bridge, for example on my system:

% lspci -nnvt
-[0000:00]-+-00.0  Intel Corporation 82G33/G31/P35/P31 Express DRAM Controller [8086:29c0]
	   +-01.0-[01]--+-00.0  ATI Technologies Inc Redwood [Radeon HD 5670] [1002:68d8]
	   |			\-00.1  ATI Technologies Inc Redwood HDMI Audio [Radeon HD 5600 Series] [1002:aa60]
...

shows that DSDT Device with address 0x00010000 is in fact the right match for the parent device of GFX0 in my case.

 

You can verify whether you got the right match by looking for the hda-gfx strings in the right places in your ioregistry (where GFX0 shows the hda-gfx string and the other injected ATY nodes under the same matched device).

Looks like you did that and your HDAU node came out right, you're just missing the hotplugged AppleHDAEngineOutputDP node under AppleHDADriver.

 

Presumably hotplugging is not working in your case because of your EDID failure. Are you using a static EDID, an av receiver or what?

Link to comment
Share on other sites

can you please post a "before" and "after" screenshot of the graphics window?

Before the framebuffer patch, any monitor connected to either VGA or HDMI is not detected, including internal monitor. Not even "Status: No Display Connected" message.

Link to comment
Share on other sites

I lost here. When I did $ otool -arch i386 -vt ATIFramebuffer | c++filt | grep createInfo I only could see UakariInfo::createInfo(unsigned char, PlatformParameters&):. Where did you find the addl?

Wow, so my post #1 was meant more to document my findings and "teach you how to fish", not to be a precise A to Z of exactly what to type for all steps.

It actually didn't occur to me that someone would run otool without knowing how to view all the output.

 

As the first baby step towards automating all of this, here's a perl script that'll just dump out all the personality initialization functions from your ATIFramebuffer kext. ati_personality.pl.0.1.zip

This script can be extended to automatically find the address&count information we're looking for. I'm not used to perl so I haven't written that yet ;)

Update: new version here http://www.insanelymac.com/forum/index.php...t&p=1649793

which does parse the assembly language instructions for you.

Usage:

   % perl ati-personality.pl

 

EDIT 2: Looks like I got QE/CI on the external monitor. I can see the water effect with Dashboard. Unfortunately no output on the external monitor, only can see it via VNC.
I'm confused what this means. The external monitor is detecting a signal (not going into power saving mode) but remains black, right? When you press f12 you see dashboard on the otherwise black external monitor?

 

I must admit I don't have my HDMI port working perfectly - it works for me at 1366x768 to my plasma, and at 1920x1200 to my 30" monitor, but not at 1600x1200 to an older monitor (black screen in that case). In the failure case, the monitor is identified right under 'system_profiler SPDisplaysDataType', I can adjust the resolution from the menu bar (with system preferences-> display->show displays in menu bar), but still no effect.

 

I think there might be some hard coded monitor timing info in the driver getting in the way, above and beyond the ConnectorInfo...

Link to comment
Share on other sites

 Share

×
×
  • Create New...