Jump to content

ATI Framebuffer development


  • Please log in to reply
465 replies to this topic

#101
Slice

Slice

    InsanelyMacaholic

  • Local Moderators
  • 3,202 posts
  • Gender:Male
  • Location:Moscow
One of my attempt
I2CWrite deviceAddress OK timeout=0
I2CWriteData 1
I2CReadData finished err=1
 doI2CRequest 1
0x0000: 00000000000000000000000000000000
0x0010: 00000000000000000000000000000000
0x0020: 00000000000000000000000000000000
0x0030: 00000000000000000000000000000000
0x0040: 00000000000000000000000000000000
0x0050: 00000000000000000000000000000000
0x0060: 00000000000000000000000000000000
0x0070: 00000000000000000000000000000000

Try this one

Attached Files



#102
Pericles Silva

Pericles Silva

    InsanelyMac Protégé

  • Members
  • PipPip
  • 54 posts
  • Gender:Male
  • Location:Rio Grande do Sul - Brasil

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?



Ok... i install RadeonPCI and ATILead.kext. Now, system boot up and appears in System Properties 256mb lol lol lol lol
Now, what i have to do?
Here is what appears in Graphic/Monitors

Radeon XPRESS 200M (PCIE):

Modelo do Grupo de Circuitos Integrados: Radeon XPRESS 200M (PCIE)
Tipo: Monitor
Barramento: PCI
VRAM (Total): 256 MB
Fornecedor: ATI (0x1002)
ID do Dispositivo: 0x5975
ID da Revisão: 0x0000
Versão do Driver EFI: 01.00.068
Monitores:
LCD Colorido:
Resolução: 1280 x 800 @ 60 Hz
Profundidade: Cor de 32 bits
Core Image: Software
Monitor Principal: Sim (Yes)
Espelho: Desligado (Off)
On-line: Sim (Yes)
Quartz Extreme: Não Compatível (Not Compatible)
QuartzGL: Compatível (Compatible)

#103
Slice

Slice

    InsanelyMacaholic

  • Local Moderators
  • 3,202 posts
  • Gender:Male
  • Location:Moscow

Ok... i install RadeonPCI and ATILead.kext. Now, system boot up and appears in System Properties 256mb lol lol lol lol
Now, what i have to do?
Here is what appears in Graphic/Monitors

Radeon XPRESS 200M (PCIE):

Modelo do Grupo de Circuitos Integrados: Radeon XPRESS 200M (PCIE)
Tipo: Monitor
Barramento: PCI
VRAM (Total): 256 MB
Fornecedor: ATI (0x1002)
ID do Dispositivo: 0x5975
ID da Revisão: 0x0000
Versão do Driver EFI: 01.00.068
Monitores:
LCD Colorido:
Resolução: 1280 x 800 @ 60 Hz
Profundidade: Cor de 32 bits
Core Image: Software
Monitor Principal: Sim (Yes)
Espelho: Desligado (Off)
On-line: Sim (Yes)
Quartz Extreme: Não Compatível (Not Compatible)
QuartzGL: Compatível (Compatible)

This is OK except QE/CI.
What about testing of
./RadeonDump ?

#104
justin1986

justin1986

    InsanelyMac Protégé

  • Members
  • Pip
  • 8 posts
I'm about to test at least RadeonPCI and AtiLead as well (and if those work well, Radeondump)
Like Pericles I have X200M PCIE (5975).


Am I right in thinking I should disable Callisto for this?

#105
Pericles Silva

Pericles Silva

    InsanelyMac Protégé

  • Members
  • PipPip
  • 54 posts
  • Gender:Male
  • Location:Rio Grande do Sul - Brasil
I'm using Callisto003 Fixed, and i don't disable nothing. Just put the RadeonPci and ATILead (changing the IOPCIFamily version), loaded and voilá.

Now, i will learn how to make the RadeonDump

Tnahks for all!

#106
Slice

Slice

    InsanelyMacaholic

  • Local Moderators
  • 3,202 posts
  • Gender:Male
  • Location:Moscow

I'm about to test at least RadeonPCI and AtiLead as well (and if those work well, Radeondump)
Like Pericles I have X200M PCIE (5975).
Am I right in thinking I should disable Callisto for this?

No, ATILead may replace CallistoHAL.kext but you need Callisto.kext.
Or you may disable Callisto at all and use IONDRVSupport.kext (without resolution switch yet).

I'm using Callisto003 Fixed, and i don't disable nothing. Just put the RadeonPci and ATILead (changing the IOPCIFamily version), loaded and voilá.

Now, i will learn how to make the RadeonDump

Tnahks for all!

Download RadeonDumpS from post 101.
type in terminal
./RadeonDumpS -d
-- to make your BIOS dump. The new binary file will appears at your folder. You can look inside in it by HexEdit or BBEdit. If you are not developer the file is not needed to you.

./RadeonDumpS -r 120,160
-- you see values of Radeon chip registers 120..160. It may be requested for test purpose.

./RadeonDumpS -i 0,a0,200
-- it is attempt to get EDID. I want to know your result.
you can try also
x,a0,y where
x=0 or 1
y=1,2,10,20,40,80,100,200,400,800,4000,8000,4000000 or else
values 4 and 8 are dangerous!

2 Dong
What is happen if you eject your real EDID into Callisto?
Are you interested in QE/CI problem?

#107
ole2

ole2

    InsanelyMac Geek

  • Members
  • PipPipPipPip
  • 180 posts
  • Gender:Male
  • Location:Grenoble, France

RadeonPCI, and RadeonDump variants post 79, 86, 87


following link is for Leo/XCode 3.0 based project, it's not buildable under Tiger/XCode 2.4
please provide proper project source
Ole2

#108
Slice

Slice

    InsanelyMacaholic

  • Local Moderators
  • 3,202 posts
  • Gender:Male
  • Location:Moscow
This is my tiger's working version

Attached Files



#109
ole2

ole2

    InsanelyMac Geek

  • Members
  • PipPipPipPip
  • 180 posts
  • Gender:Male
  • Location:Grenoble, France
polar-bears-computer:~/Projects/framebuffer polarbear$ sudo kextload -v test/RadeonPCI.kext
kextload: kext /System/Library/Extensions/AppleThermal.kext is not valid
kextload: extension test/RadeonPCI.kext appears to be valid
kextload: loading extension test/RadeonPCI.kext
kextload: test/RadeonPCI.kext loaded successfully
kextload: loading personalities named:
kextload: FirstPersonality
kextload: sending 1 personality to the kernel
kextload: matching started for test/RadeonPCI.kext
polar-bears-computer:~/Projects/framebuffer polarbear$ ls
RadeonDumpS buildKext-sourceIncompatibility.png
RadeonDumpS.zip kextGuess.txt
RadeonPCI kextloadBeforeDump.txt
RadeonPCI.kext.zip loadingKext-precompiledTiger-2ndTrial.rtf
RadeonPCI_source.zip loadingKext-precompiledTigerOne.rtf
TigerCompiled radeonDump.txt
TigerCompiled.zip test
polar-bears-computer:~/Projects/framebuffer polarbear$ ./RadeonDumpS -d

Found a device of class RadeonPCI
it matched on name "display"
polar-bears-computer:~/Projects/framebuffer polarbear$ ./RadeonDumpS -r 120,160

Found a device of class RadeonPCI
it matched on name "display"
0x0120: 0x00000000
0x0124: 0x00000000
0x0128: 0x00000000
0x012C: 0x00000000
0x0130: 0x00800000
0x0134: 0x00007000
0x0138: 0x00000000
0x013C: 0x00000000
0x0140: 0x00000000
0x0144: 0x00000000
0x0148: 0x00000000
0x014C: 0x00000000
0x0150: 0x00000000
0x0154: 0x00000000
0x0158: 0x00000000
0x015C: 0x00000000
0x0160: 0x00000000
polar-bears-computer:~/Projects/framebuffer polarbear$ ./RadeonDumpS -i 0,a0,200

Found a device of class RadeonPCI
it matched on name "display"
Start I2C dump 0,a0,200
Test reg=0198, mask=200 addr=a0
Test I2C clock disable clk output
Test I2C clock init pause 0,-26
Test I2C clock wait 0 pause 1,-524077
Test I2C clock wait 1 pause 0,-26
Test I2C clock wait 0 pause 1,-33
Test I2C clock wait 1 pause 0,-22
Test bus
Test bus
1 data 0
1 clk 0
Test 1 passed
2 clk 0
Test 2 passed
3 data 0
3 clk 0
Test 3 passed
4 data 0
Test 4 passed
Test 5 timeout=0
5 data 0
5 clk 0
I2CWrite deviceAddress OK timeout=0
I2CWriteData 1
I2CRead data Err timeout=5
I2CRead data Err timeout=5
I2CRead data Err timeout=5
I2CRead data Err timeout=5
I2CRead data Err timeout=5
I2CRead data Err timeout=5
I2CRead data Err timeout=5
I2CRead data Err timeout=5
I2CRead data Err timeout=5
I2CRead data Err timeout=5
I2CReadData finished err=0
doI2CRequest 0
polar-bears-computer:~/Projects/framebuffer polarbear$

#110
dong

dong

    InsanelyMac Sage

  • Retired Developers
  • 366 posts
  • Gender:Male

2 Dong
What is happen if you eject your real EDID into Callisto?
Are you interested in QE/CI problem?

To make it clear, Callisto is like something you try to do (based on the linux source you select), it's only for old ATI cards.

For x1300/x1400 mobility cards, the vanilla ATI framebuffer driver can not be used as it lacks the ability to detect our panel LCD. With IONDRVSupport, our laptop boot with a fixed resolution which can not be changed at run time.

My goal is create a Callisto countpart for x1300/x1400 mobiltiy by using linux RadeonHD source.

Now, as you know, the EDID is read and available resolutions did show in Display preference.
The kenel panic did not happen again after I found out it came from some IOLog's bad format.
Linux switch_resolution function can also be called without problem.
Things left for me is to find out how to provide correct information of the new resolution to the system.
My initial several tries failed with the screen becoming a mesh after changed to a new resolution.
Need to get more information on this.

#111
Slice

Slice

    InsanelyMacaholic

  • Local Moderators
  • 3,202 posts
  • Gender:Male
  • Location:Moscow
I still can't get EDID neither in MacOSX nor in Windows. May be I shall inject some EDID and continue work with it. Linux sources is not very good. I have no switch resolution in Ubuntu. Moreover Linux DDC method is not work for me. Problems...

Upload please
./RadeonPCI -r 0,1000 >registers.txt

From Ole2 I see strange @148=0, @14c=0

#112
ole2

ole2

    InsanelyMac Geek

  • Members
  • PipPipPipPip
  • 180 posts
  • Gender:Male
  • Location:Grenoble, France

New progress!


not for me yet:

Welcome to Darwin!
polar-bears-computer:~ polarbear$ cd Projects/framebuffer/
polar-bears-computer:~/Projects/framebuffer polarbear$ less RadeonDump.c
polar-bears-computer:~/Projects/framebuffer polarbear$ cp RadeonDump.c RadeonPCI
polar-bears-computer:~/Projects/framebuffer polarbear$ cd RadeonPCI
polar-bears-computer:~/Projects/framebuffer/RadeonPCI polarbear$ less RadeonDump.c
polar-bears-computer:~/Projects/framebuffer/RadeonPCI polarbear$ cc ./RadeonDump.c -o ./RadeonDump -framework IOKit -framework CoreFoundation -Wno-four-char-constants -Wall -g -arch i386
polar-bears-computer:~/Projects/framebuffer/RadeonPCI polarbear$ ls -l
total 160
drwxr-xr-x 3 polarbea polarbea 102 Apr 17 14:53 English.lproj
-rw-r--r-- 1 polarbea polarbea 1482 Apr 24 19:45 Info.plist
-rwxr-xr-x 1 polarbea polarbea 33072 Jun 26 18:36 RadeonDump
-rw------- 1 polarbea polarbea 17131 Jun 26 18:35 RadeonDump.c
-rw-r--r-- 1 polarbea polarbea 4905 Apr 24 13:47 RadeonPCI.cpp
-rw-r--r-- 1 polarbea polarbea 1579 Apr 22 23:29 RadeonPCI.h
drwxr-xr-x 7 polarbea polarbea 238 Jun 26 16:41 RadeonPCI.xcodeproj
-rw-r--r-- 1 polarbea polarbea 754 Apr 24 13:48 RadeonPCIShared.h
-rw-r--r-- 1 polarbea polarbea 3420 Apr 22 23:29 RadeonPCIUserClient.cpp
drwxr-xr-x 5 polarbea polarbea 170 Jun 26 16:37 build
polar-bears-computer:~/Projects/framebuffer/RadeonPCI polarbear$ ./RadeonDump -i
polar-bears-computer:~/Projects/framebuffer/RadeonPCI polarbear$ sudo kextload ../
.DS_Store RadeonPCI.kext.zip kextloadBeforeDump.txt
7942.0000.0000.vga.rom RadeonPCI_source.zip loadingKext-precompiledTiger-2ndTrial.rtf
RadeonDump.c TigerCompiled loadingKext-precompiledTigerOne.rtf
RadeonDump.c.zip TigerCompiled.zip radeonDump.txt
RadeonDumpS buildKext-sourceIncompatibility.png test
RadeonDumpS.zip executionResult-radeonDump-v1.rtf
RadeonPCI kextGuess.txt
polar-bears-computer:~/Projects/framebuffer/RadeonPCI polarbear$ sudo kextload ../test/RadeonPCI.kext
Password:
kextload: ../test/RadeonPCI.kext loaded successfully
polar-bears-computer:~/Projects/framebuffer/RadeonPCI polarbear$ ./RadeonDump -i
Found a device of class RadeonPCI: IOService:/AppleACPIPlatformExpert/PCI0@0/AppleACPIPCI/AGP@1/IOPCI2PCIBridge/VGA@5/RadeonPCI
it matched on name "display"
Start I2C dump
Read EDID at bus 0 failed
Read EDID at bus 1 failed
Read EDID at bus 2 failed
polar-bears-computer:~/Projects/framebuffer/RadeonPCI polarbear$

#113
Slice

Slice

    InsanelyMacaholic

  • Local Moderators
  • 3,202 posts
  • Gender:Male
  • Location:Moscow
May be it is interesting for our investigation for switch resolution
[codebox]loc_14532: ; CODE XREF: __ZN13ATIRadeon850025set_display_mode_and_vramEv+47Cj
test byte ptr [ebx+9Ah], 1
jz loc_146C2
cmp dword ptr [ebx+0CCh], 1
jbe loc_146C2
mov edx, [ebx+634h]
mov ecx, [edx+3F8h] //RADEON_CRTC2_GEN_CNTL
mov eax, ecx
and eax, 0F00h //RADEON_CRTC2_PIX_WIDTH_MASK (0xf << 8)
shr eax, 8
mov [ebp+var_2C], eax
mov byte ptr [ebx+66Ch], 0
mov esi, [edx+324h] //RADEON_CRTC2_OFFSET
and esi, 7FFFFFFh
mov eax, [edx+32Ch] //RADEON_CRTC2_PITCH
and eax, 7FFh
shl eax, 3
mov [ebp+var_38], eax
test ecx, 2000000h
jz loc_1485B
mov eax, [ebp+var_2C]
test eax, eax
jz loc_1485B
cmp esi, [ebx+9Ch]
jnb loc_1485B
mov eax, [edx+300h] //CRTC2_H_TOTAL_DISP
mov edx, [edx+308h] //RADEON_CRTC2_V_TOTAL_DISP
and edx, 0FFF0000h //RADEON_CRTC2_V_DISP (0x07ff << 16)
shr edx, 10h
and eax, 1FF0000h //RADEON_CRTC2_H_DISP (0x01ff << 16)
shr eax, 10h
lea eax, ds:8[eax*8]
mov [ebp+var_24], eax
add edx, 1
and cl, 2
setnz byte ptr [ebx+66Eh]
cmp [ebp+var_2C], 5
jz loc_14AA6
[/codebox]
And all others codes

#114
dong

dong

    InsanelyMac Sage

  • Retired Developers
  • 366 posts
  • Gender:Male

not for me yet:

Your card does not fall in R5XX.
Try again with this that for both R5xx and R6xx except RS620, RS690: Attached File  RadeonDump.c.zip   8.76KB   12 downloadsNothing new here, just add in R6xx source.

may be it is interesting for our investigation for switch resolution

Not familiar with assembly. :(

#115
Slice

Slice

    InsanelyMacaholic

  • Local Moderators
  • 3,202 posts
  • Gender:Male
  • Location:Moscow

Not familiar with assembly. :(

It is very simple
mov eax,[edx+224h] means
eax=INREG(0x224) ;)
I can upload to you diassembled sources of ATIRadeonX1000.kext if you want.
It may be helpful to look what registers uses ATI instead of Linux sources.
And I can give some comments...

#116
dong

dong

    InsanelyMac Sage

  • Retired Developers
  • 366 posts
  • Gender:Male

It is very simple
mov eax,[edx+224h] means
eax=INREG(0x224) :D
I can upload to you diassembled sources of ATIRadeonX1000.kext if you want.
It may be helpful to look what registers uses ATI instead of Linux sources.
And I can give some comments...

Well, I guess you picked a wrong object to dig for switch resolution information. Stuff like ATIRadeonX1000.kext and ATIRadeon8500.kext are acceleration modules. All ATI framebuffer drivers are located in ATINDRV.kext/Contents/Plugins/. ATIRNDRV.kext maybe a new one for this.

#117
Slice

Slice

    InsanelyMacaholic

  • Local Moderators
  • 3,202 posts
  • Gender:Male
  • Location:Moscow

Well, I guess you picked a wrong object to dig for switch resolution information. Stuff like ATIRadeonX1000.kext and ATIRadeon8500.kext are acceleration modules. All ATI framebuffer drivers are located in ATINDRV.kext/Contents/Plugins/. ATIRNDRV.kext maybe a new one for this.

Yes, you are right
useful codes

#118
Krazubu

Krazubu

    InsanelyMac Legend

  • Retired
  • 874 posts
Framebuffer code for pre X1000 boards isn't present, but as I had told in an older post, I suspect it's directly embedded inside the ROM, so if that might be usefull with disassembly, I join the ROM of an ATI 9200 (codename bugsy) and ATI 9800XT (codename Elan).
Also, if you need a brief list of the current plugins I made one here (latest ones are missing).

Attached Files



#119
Slice

Slice

    InsanelyMacaholic

  • Local Moderators
  • 3,202 posts
  • Gender:Male
  • Location:Moscow

Framebuffer code for pre X1000 boards isn't present, but as I had told in an older post, I suspect it's directly embedded inside the ROM, so if that might be usefull with disassembly, I join the ROM of an ATI 9200 (codename bugsy) and ATI 9800XT (codename Elan).

Is it PowerPC ROMs? Is so I can't apply its.
If Intel then why it can contain Apple's framebuffer?
For PowerPC there are low-end ATI framebuffer drivers in folder AppleNDRV in extensions. And also it contain "ATI ROM Update". Don't know how it works because PowerPC only.

#120
Krazubu

Krazubu

    InsanelyMac Legend

  • Retired
  • 874 posts
Yeah PPC, however the GPU registers or things like this should be "tracable" too (I guess IDA pro can disassemble this). If you open it with a kext or hex editor, you'll see many similiarities in the ROM and the nowadays used plugins. I checked in intel ROMs too, and they don't have this stuff (hence my conclusion about the framebuffer being stored in the ROM)





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