Jump to content

Editing custom personalities for ATI Radeon HD[45]xx


bcc9
 Share

775 posts in this topic

Recommended Posts

bcc9, here is a weird one for you; the 64 bit offset for the first personality (Caretta) is not correct...
Oops, I had code to handle that case (where the load instruction that we want to use is not the last of the routine), but the check was broken as of version 0.5. Fixing.
Just out of curiosity, do you have any clue of what is this 0x00001000 connector type on Iago and Hypoprion?..

mini dvi / dp are the only ones that cross my mind...

No idea; have you checked which apple platform uses this (and what connectors it has)?
Link to comment
Share on other sites

Ok, post #1 now has a new version of ati-personality.pl: version 0.7. Changes:

  • It fixes the "caretta" personality reporting regression.
  • the wormy count was mis-reported in 10.7 - fixed.
  • -a is auto-set for 10.7 (ie the script detects the OS version and knows that 10.7 has multiple kexts to dump automatically).
  • 32-bit kext reporting now works for 10.7 (where the kexts have new compiler optimizations)

 

bcc9, one doubt i forgot; i'm assuming it's not possible to add connector info to a personality, just edit a present one...

Am i assuming correctly?

You could take a personality with the right # of connectors for your case and scribble into it whatever you want...

You might want to revise the info under IOKitPersonalities in the controller's info.plist if you're re-appropriating a personality that is much different from your hardware.

Link to comment
Share on other sites

typedef struct {

int ConnectorType; /* known values below */

#define CONNECTORTYPE_LVDS 0x00000002 /* Ie internal Low Voltage display,

such as laptop */

#define CONNECTORTYPE_DVI_DUAL 0x00000004 /* Dual link(?) DVI */

#define CONNECTORTYPE_VGA 0x00000010 /* Per mucha */

#define CONNECTORTYPE_SVIDEO 0x00000080 /* Per mucha */

#define CONNECTORTYPE_DVI 0x00000200 /* Single link DVI(?), Per azimutz */

#define CONNECTORTYPE_DP 0x00000400 /* Displayport */

#define CONNECTORTYPE_HDMI 0x00000800

 

int controlflags;

int features;

byte link_i2cid; /* Bits 0-3: i2cid

Bits 4-7: link transmitter link */

byte dac_digidx; /* Bits 0-3: link encoder number

Bits 4-7: link dac number */

byte hotplugid;

byte senseid; /* Sense line is bits 0-3

Use hw i2c flag is bit 4 */

/* i2cid = (senseid & 0xf-1)+0x90 */

/* senseid = (i2cid & 0xf) +1*/

} ConnectorInfo;

 

Hi everyone!

Where did you get this structure info from? I'm curently writing ATI framebuffer patcher witch will help you to patch FB with some GUI not terminal.

I'd like to have some info on controlflags constants and some info about where can I find other values for this structure for patching?

 

UPD

 

As soon as I've posted this - I found solution using google (You couldn't trust me but I searched about 3-4 days before!).

 

If you're interested in some of theese values - download and read this RTF document

Link to comment
Share on other sites

Where did you get this structure info from?

The information I provided in post #1 comes from study of the driver code, the io registry, the linux ATI driver source code, and to a lesser extent, some plain old testing. Also some two system remote gdb sessions to verify things. It takes quite a lot of work to come up with this stuff and translate it into higher level information.

 

Still I think it's premature to make a newbie utility out of this information with some of the blanks left unfilled.

Link to comment
Share on other sites

Oops, I had code to handle that case (where the load instruction that we want to use is not the last of the routine), but the check was broken as of version 0.5. Fixing.

Hi bcc9, sorry for the delay. Script is fine now.

 

No idea; have you checked which apple platform uses this (and what connectors it has)?

About the 0x00001000 connector type, i only took a look around Mactracker and Apple site; got only suspictions.

Will take a look at ioreg's with time, to see if i can get confirmations. We also have a new connector around, Thunderbolt.

 

You could take a personality with the right # of connectors for your case and scribble into it whatever you want...

You might want to revise the info under IOKitPersonalities in the controller's info.plist if you're re-appropriating a personality that is much different from your hardware.

Ok, confirms some stuff i was thinking.

 

Thanks for all the work; nice tools, very useful info :(

Will keep you posted, if i find anything useful; i only began scratching the surface regarding this stuff.

 

If you're interested in some of theese values - download and read this RTF document

Hi Matafonoff.. your rtf did help me to fill in some blanks.. thanks :)

Link to comment
Share on other sites

Is it normal for VGA shown as always connected while nothing is connected to the VGA port?

 

357rsr6.jpg

 

bgqo7r.jpg

My HD5470 BIOS dump as follow:

PCI ID: 1002:68e0

Connector at index 0

Type [@offset 45058]: LVDS (7)

Encoder [@offset 45062]: INTERNAL_UNIPHY (0x1e)

i2cid [@offset 45132]: 0x93, OSX senseid: 0x4

Connector at index 1

Type [@offset 45068]: HDMI-A (11)

Encoder [@offset 45072]: INTERNAL_UNIPHY1 (0x20)

i2cid [@offset 45155]: 0x90, OSX senseid: 0x1

Connector at index 2

Type [@offset 45078]: VGA (1)

Encoder [@offset 45082]: INTERNAL_KLDSCP_DAC1 (0x15)

i2cid [@offset 45182]: 0x97, OSX senseid: 0x8

 

and the patched "Eulemur" Framebuffer that I use for this card, QE/CI enabled and works fine:

0000000 02 00 00 00 40 00 00 00 09 01 00 00 12 01 00 04

0000010 00 08 00 00 00 02 00 00 00 01 00 00 20 00 01 01

0000020 10 00 00 00 10 00 00 00 00 00 00 00 10 10 02 08

Link to comment
Share on other sites

Is it normal for VGA shown as always connected while nothing is connected to the VGA port?

Don't think so; if nothing is connected it should show "Status: No Display Connected".

Maybe something needs to be changed on this line:

0000020 10 00 00 00 10 00 00 00 00 00 00 00 10 10 02 08 ...!?

Link to comment
Share on other sites

Maybe something needs to be changed on this line:

0000020 10 00 00 00 10 00 00 00 00 00 00 00 10 10 02 08 ...!?

In fact, I have test a few changes on the above line before this post and no help, that's why I asked... While remote connect with VNC I can actually see 2 desktops from the client side, and drag things between them works...

Link to comment
Share on other sites

In fact, I have test a few changes on the above line before this post and no help, that's why I asked... While remote connect with VNC I can actually see 2 desktops from the client side, and drag things between them works...

Weird stuff... i'm out of answers ;) i still didn't had time to play with changing personality connectors.

Also, i just found a weird thing while looking for another fb for you to try (Eulemur is not a laptop fb);

Nomascus show 5 ports on 10.6.7 drivers and only 4 on 10.6.8 ??? :rolleyes:

 

bcc9, when/if you read this, can you check if it's a ati-personality.pl glitch or...

Nomascus is the only one with this diff.

Link to comment
Share on other sites

bcc9, when/if you read this, can you check if it's a ati-personality.pl glitch or...

Nomascus is the only one with this diff.

Feel free to check the assembly yourself (if you run my script with -v -v it'll show you the whole subroutine to look at).

I checked 10.7 and the nomascus routine is initializing the connector count with 4.

 

My radeon HD card doesn't have VGA and I don't have any mobile radeon hardware so that's about all I can add.

Link to comment
Share on other sites

Feel free to check the assembly yourself (if you run my script with -v -v it'll show you the whole subroutine to look at).

bcc9, i don't have your knowledge when it comes to that stuff; i will do what you suggest but...

All i wanted was to confirm the accuracy of those results.

Link to comment
Share on other sites

My patched Eulemur is complete different from the original... I use it for modification because Chameleon use it as the default framebuffer for ATI 5470M

You can use AtiConfig key to specify another FB; and if you get to the conclusion that another FB is indeed better for your card, we'll change it on the booter.

Link to comment
Share on other sites

You can use AtiConfig key to specify another FB; and if you get to the conclusion that another FB is indeed better for your card, we'll change it on the booter.

Originally I tested my card only got display with "Eulemur" (even unmodified) and that's why I requested ^Andy^ here some time ago to create a "boot" for me, some how it became Chameleon default for HD5470M... I know there is another HD5470M variant only works with the default "Hoolock" and I still cannot figure out why because connectors type of "Hoolock" is completely unmatch with HD5470M and my card got a blank screen with it.

Link to comment
Share on other sites

Indeed, the default on Chameleon for your dev id is Eulemur, tied to this subsys id/ven: 04561028 ... is it your's?

^Andy^ helped while Kabyl was testing the new ATi code, so it's natural that the info ended up on the code, if not by your self?!

Well, if you want to talk a bit more about this, show up on this topic.

From now on, i'm just a normal user on this site; no time to be on so many places at the same time.

Will give Chameleon related support only on Voodoo forums/forge and irc :)

 

Stay safe...

Link to comment
Share on other sites

Thanks, bcc9. Great post!

 

This topic was instrumental in fixing my problems with Lion detecting two connected displays when I only have one. If anyone's interested the steps I took to replace Eulemur entirely with a modified Vervet personality for my MSI R5770 Hawk, you can see them here.

Link to comment
Share on other sites

Thanks, glad it's helping everyone customize their video layouts.

After installing Lion, applying the similar methods and patching my EAH 5850 in Asus P5QPRO can get HDMI and DVI ports active at the same time only. However, another MSI 5770 Hawk in Asus P6TSE can use any two of these 3 (DP, HDMI and DVI) ports with working HDMI audio now. Thanks again ! The key issue is using a DP-->HDMI active convertor to activate the DP port with its HDMI audio. By the way can you get your 3 ports active at the same time as in SL 10.6.6/10.6.7 ?

Link to comment
Share on other sites

I'm in the same boat as jsl above. I have a Sapphire 5850 using Uakari on 10.7, and no signal is sent over displayport. Both the DVI ports work, not quite sure about HDMI. ActiveFlags says 0x400 when it's connected.

 

Displayport section from bios dump:

Connector at index 0

Type [@offset 44852]: DisplayPort (10)

Encoder [@offset 44856]: INTERNAL_UNIPHY2 (0x21)

i2cid [@offset 44980]: 0x90, OSX senseid: 0x1

 

Uakari line for displayport:

00 04 00 00 00 04 00 00 00 71 00 00 12 04 04 01

 

I've tried all of the controlflags listed in mucha's post (0x0100, 0x0104, 0x0304, 0x0604, 0x0400) as well as setting the features to 0x00 and 0x01 (although I did those with controlflags at 0x0400 the whole time).

 

The senseid looks to be correct as well. Any suggestions?!

post-702820-1311237110_thumb.png

Link to comment
Share on other sites

I'm in the same boat as jsl above. I have a Sapphire 5850 using Uakari on 10.7, and no signal is sent over displayport. Both the DVI ports work, not quite sure about HDMI. ActiveFlags says 0x400 when it's connected.

 

Displayport section from bios dump:

Connector at index 0

Type [@offset 44852]: DisplayPort (10)

Encoder [@offset 44856]: INTERNAL_UNIPHY2 (0x21)

i2cid [@offset 44980]: 0x90, OSX senseid: 0x1

 

Uakari line for displayport:

00 04 00 00 00 04 00 00 00 71 00 00 12 04 04 01

 

I've tried all of the controlflags listed in mucha's post (0x0100, 0x0104, 0x0304, 0x0604, 0x0400) as well as setting the features to 0x00 and 0x01 (although I did those with controlflags at 0x0400 the whole time).

 

The senseid looks to be correct as well. Any suggestions?!

Please try the following for your Uakari:

00 04 00 00 04 06 00 00 00 71 00 00 12 04 04 01 (DP -->HDMI audio)

 

Mine is working with a DP-->HDMI monitor but can not get HDMI port working at the same time.

That means one of the following is working for my EAH 5850:

(1) HDMI and DVI

(2) DP-->HDMI and DVI

Link to comment
Share on other sites

Please try the following for your Uakari:

00 04 00 00 04 06 00 00 00 71 00 00 12 04 04 01 (DP -->HDMI audio)

 

Mine is working with a DP-->HDMI monitor but can not get HDMI port working at the same time.

That means one of the following is working for my EAH 5850:

(1) HDMI and DVI

(2) DP-->HDMI and DVI

 

I tried that but it didn't change much AFAIK.

Link to comment
Share on other sites

Does anyone know how to get a working framebuffer injection with 2x video cards installed? I can get fully working video using one 5770, but when I install the second card I get a grey screen. I have one monitor connected by HDMI which works with the Uakari framebuffer when a single card is installed.

 

With Uakari framebuffer loaded the connector type is detected as a single link DVI? (00 02) in ioreg even though it's a HDMI connection. So with one card installed I hex edited the Vervet framebuffer to have the correct senseid of my HDMI port added to the single link DVI port in the Vervet personality and I get full video with automatic Vervet loading at boot. However as soon as I install the other 5770, I get a grey screen and no framebuffer personalities work.

 

I know I am being vague with details, but I'm wondering if it's something as simple as the senseid's getting changed when two cards are installed or something? I can provide more details if a deeper fix is needed. Thanks.

Link to comment
Share on other sites

The problem:

Under OSX the ATI driver uses a hard-coded set of personalities to define some of the video card's capabilities, most notably the connector layout. This is sufficient to support the limited number of configurations that Apple ships, but leads to non-working monitors (black displays) in many hackintosh configurations. Users have limited success & limited functionality by simply guessing which hard-coded personality best matches their video card.

 

Some prerequisites:

  • Installation of OSX Developer tools (for examining personalities with otools)
  • Somewhat working install of ATI radeon HD[45]xx card with Kabyl's chameleon branch: http://www.insanelymac.com/forum/index.php?showtopic=231768
  • Understanding of hex editing
  • Ability to troubleshoot by looking at ioregistry, understanding how to test ATI personalities using ATIConfig

There are currently 26 ATI framebuffer personalities defined in ATIFramebuffer's Info.plist.

Each of these personalities defines a set of hard-coded information about the video card hardware. One of the key pieces that gets defined is the connector information, known as ConnectorInfo within the ATI driver.

There is one ConnectorInfo structure for every potential connector that may be plugged into a video card. (Dual link DVI ports still count as a single ConnectorInfo). Each personality defines a table of these ConnectorInfo structures.

 

The ConnectorInfo structure can be represented as the following 16 byte structure, in C code:

 

typedef struct {
		  int ConnectorType;	/* known values below */
#define CONNECTORTYPE_LVDS	0x00000002	/* Ie internal Low Voltage display,
		   		   such as laptop */
#define CONNECTORTYPE_DVI_DUAL	  0x00000004	/* Dual link(?) DVI */
#define CONNECTORTYPE_VGA	  0x00000010	/* Per mucha */
#define CONNECTORTYPE_SVIDEO	0x00000080	/* Per mucha */
#define CONNECTORTYPE_DVI	0x00000200	/* Single link DVI(?), Per azimutz */
#define CONNECTORTYPE_DP	  0x00000400	/* Displayport */
#define CONNECTORTYPE_HDMI	0x00000800

		  int controlflags;
		  int features;
		  byte link_i2cid;	/* Bits 0-3: i2cid
					 Bits 4-7: link transmitter link */
		  byte dac_digidx;	/* Bits 0-3: link encoder number
					 Bits 4-7: link dac number */
		  byte hotplugid;
		  byte senseid;	/* Sense line is bits 0-3
					Use hw i2c flag is bit 4 */
		  /* i2cid = (senseid & 0xf-1)+0x90 */
		  /* senseid = (i2cid & 0xf) +1*/
	  } ConnectorInfo;

where integers are represented in intel little-endian byte order, and bit 0 is the LSB.

 

Lets take a look at the driver's 32-bit code for seting up the ConnectorInfo.

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

gives you the list of the 26 initialization routines.

For all personalities, the initialization routine sets the connector count and a pointer to a static array of ConnectorInfo.

 

I've written a script which will parse the personality initialization routines for you and calculate the effective address of the ConnectorInfo table, as well as the number of table entries. The script currently outputs information for all personalities found in the ATI Framebuffer kext.

Usage:

perl ati-personality.pl

to output 32-bit kext information, or

perl ati-personality.pl -x

to output 64-bit kext information

for 10.7 and 10.6.7 2011 MBPs, the ATI kexts have been revised, use:

perl ati-personality.pl -a

to get the connectorinfo from their new locations.

 

See finding-patch-address.txt in the attached zip file for instructions if you wish to calculate the effective address & disk address yourself by hand.

I have installed Xcode 4 and followed your guide as the above.

But in Lion GM I found that "ati-personality.pl -a" just get the same as "ati-personality.pl" which is 32 bit while "ati-personality.pl -x" is 64 bit I think.

So am I right or wrong ?

Link to comment
Share on other sites

in Lion GM I found that "ati-personality.pl -a" just get the same as "ati-personality.pl" which is 32 bit while "ati-personality.pl -x" is 64 bit I think.

So am I right or wrong ?

Per the release notes for version 0.7 of the script (post 452):

-a is auto-set for 10.7 (ie the script detects the OS version and knows that 10.7 has multiple kexts to dump automatically).

I'll update this in post #1 (it's quite a chore maintaining the guide, btw) [done]

 

The -x switch behaves as documented.

Link to comment
Share on other sites

 Share

×
×
  • Create New...