Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
103 user(s) are online (58 user(s) are browsing Forums)

Members: 0
Guests: 103

more...

Support us!

Headlines

 
  Register To Post  

GART patch for RadeonRX on SAM460
Home away from home
Home away from home


See User information
@All

So I have successfully created a patch that enables GART in RadeonRX 2.12 on the Sam460 (only the Sam460; the 440
is not supported for now).

Grab it here: https://kas1e.mikendezign.com/aos4/mesa/sam460_rx212_gart_patch.zip

The only supported version is RadeonRX 2.12 on the Sam460. Only two variants of 2.12 are supported:

- release version of 2.12 driver (size 1.772.772)
- debug version of 2.12 driver (size 1.901.344)

The placement order in the Kicklayout doesn’t matter: its cold-start priority is +66,so it runs before RadeonRX’s
RXCardPatch, which has priority +65.

To be sure that it works, you should see this line on the serial when the patch runs and correctly activated:

VESAOK
sam460_rx212_gart_patch
RadeonRX 2.12 Sam460 GART patch v1.4 active (RadeonRX 2.12 public build)
RadeonRX (2): Identified the chipset as: blablabla



Don’t expect big improvements, but at least some. Here are some relevant results showing what you may expect:


Tests done on my SAM460LE + RadeonRX 560 2GB:

.
                        
GART        no GART


Irrlciht Engine
:

02.Quake3Map :           39            33
03.CustomScene
:        1139           816
04.Movement
:            280           212
07.CollisionL            28            25
08.SpecialFx 
(shadows)   31            31
08.SpecialFx 
(no shad.)  75            68
09.MeshViewer            54            43
11.PerPixelLighting     111            91
18.SplitScreen           11            10


Spencer
:                 23            21

Departure               
~80           ~40
Felix WorkShop        12
-13          9-10  


Mesa shaders
:

Bridge:                  20           19
Cave Diving              64           60
CubeLines               200          200
Doom E1M1               199          180
ED209                    16           16
Happy Jumping            24           23
Insect                   14           14
Polyhedral               29           28
Raymarching              53           49
Seascape                 65           61
Snail                    20           19


GlMark2                 643          487




Now if someone want technical details how it done, there is:


As you may know, Radeon RX already contains GART support for other machines, so the core functionality was there;
but its Sam460 path is off and lacks the required platform-specific handling. Of course, we can’t simply enable
it, as doing so safely requires the correct Sam460 specific initialization (thanks to Max for sharing necessary
information), proper memory attributes, CPU/GPU cache synchronization and a few small driver corrections.

So, to enable it, the patch does not modify the real binary, but instead patches it in memory. All changes remain
active until reboot, while the actual driver file remains unchanged. I had to patch the necessary allocation and
cache-management paths to redirect them to my own hooks (mostly with a one instruction change). The hooks then
continue into the original functions while adding the required memory and cache handling.And while this may sound
complicated, it is still simpler than replacing the whole memory manager.

Technically speaking, this is what happen when you load this .kmod patch:

-- Verifies the exact RadeonRX2.12 (resident version number, few insructions match and required memory mappings)

-- Patches private RadeonRX funcs by installing hooks in its GART allocs, mapping, and cache-management paths.

-- The hooks provide the missing Sam460-specific handling:

- When RadeonRX allocates GART-related memory,the hook lets the original allocation complete and then applies
the correct memory attributes to the actual allocated range.
- When memory ownership moves between the CPU and GPU, the hooks perform the required cache flushes,invalida-
tions, and synchronization and then preserve the original RadeonRX operations and return control to the
driver afterward.

-- Finally, using the Sam460 MMU setup information provided by Max, the module sets the required PPC460EX MMU
control bit and opens RadeonRX’s existing GART gate. RadeonRX then continues its normal initialization using
its own GART allocator and memory manager.

One of the trickiest parts of creating the patch was modifying RadeonRX’s loaded executable code because its code
pages are protected by the MMU. They are readable and executable but not writable, so attempting to replace an
instruction directly causes a DSI exception, even in supervisor mode..

The CPU in Sam460 uses 2 TLB translation spaces called TS0 and TS1. They are two separate sets of physical memory
address mappings that the CPU can select independently for execution and data access. And on Sam460, the RadeonRX
driver address is mapped in both spaces as follows:

TS1driver address → physical pagereadable/executablenot writablenormal protected AmigaOS mapping
  TS0
same address   → same physical pagereadable/writable/executablelow-level supervisor mapping


As expected,when I tried to write through TS1,which is not writable,it naturally caused a DSI. But I still needed
to modify the instructions used through TS1, because those are RadeonRX’s executable code.

Since I found that TS0 maps the same physical memory, is writable, and has matching cache attributes,this gave me
an idea: while the patch code is running, instruction execution remains in TS1, while data access is temporarily
switched to TS0 only to write each replacement instruction (usually a branch to one of our hooks).

I.e.:

Normally:       instructions=TS1data=TS1
During write
:   instructions=TS1data=TS0
After write
:    instructions=TS1data=TS1


Before each write, the module verifies the expected original instruction through the normal TS1 mapping and then
after writing the replacement through the writable TS0 mapping, it restores data access to TS1 and synchronizes
the data and instruction caches, so the CPU executing through TS1 sees the modified instruction. It then checks
the result through the normal protected mapping and banana!

So give it a go plz, and report your finding.

And if you like it , remember that driver itself were done by Hans, and necessary SAM460 adaptation information
were provided by Max, i only hack and slash the memory.


Thanks!

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: GART patch for RadeonRX on SAM460
Quite a regular
Quite a regular


See User information
Not a Sam460 user, but Спасибо !

One day I will be able to donate to you again, and that donation will be large!
Keep on doing what you are doing "I´m not a coder" ! ;)


Edited by khayoz on 2026/9/5 3:45:08
Edited by khayoz on 2026/9/5 3:47:11
Edited by khayoz on 2026/9/5 5:56:25
1989-> A500, A600, A3000, A4000, A1200, CD32, µA1, PegII, A1XE, CDTV, Amy/416D79, A1X5000, Vampire 500 V2+, Vampire 600 V2, Amy-ITX, Denise ITX, Apollo V4SA, A1X5000/40 <-2026
Go to top
Re: GART patch for RadeonRX on SAM460
Just can't stay away
Just can't stay away


See User information
Great stuff Roman.
And people said "it's not possible on Sam460"

Hint, I have a R7-240

Philippe 'Elwood' FERRUCCI
Sam460ex 1.10 Ghz
http://elwoodb.free.fr
Go to top
Re: GART patch for RadeonRX on SAM460
Just popping in
Just popping in


See User information
@kas1e

Roman you're the KING ! Only to know could you explain why so "little" gain with GART enabled on sam460 vs other platforms that gain more and more fps ?

TNX indeed!

Sam 460EX, 2Gb Ram, Radeon R7 250, AmigaOS4.1 FE
A4000 PPC604@233, Mediator
A1200 PPC603@160, Mediator
uA1 G3@800, 512 Mb [sold]
Go to top
Re: GART patch for RadeonRX on SAM460
Just popping in
Just popping in


See User information
@kas1e
thank you for your fantastic job and the support of aos4 and my sam460ex.
the result of your gart patch is!

glmark2:
without gart patch: ca.660
with your gart patch: ca.715

rx550 4gb

Go to top
Re: GART patch for RadeonRX on SAM460
Just can't stay away
Just can't stay away


See User information
@kas1e
THXaLOT man!!!!

works fine here. SAM460ex + RX550

GART: glmark2 Score: 670
NO GART: glmark2 Score: 525

EDIT1: maybe you can talk/share_code to Hans author of radeonRX, so he can implement it on driver.


Edited by jabirulo on 2026/9/5 10:22:19
Edited by jabirulo on 2026/9/5 10:25:26
AOS4.1/SAM460ex/PPC460EX-1155MHZ/2048MB/RadeonRX550/HDD/DVDRW
Go to top
Re: GART patch for RadeonRX on SAM460
Just can't stay away
Just can't stay away


See User information
Can someone verify that with SAM460 GARTpatch enabled and using Oddyses v1.23 r5 and visiting https://amigaworld.net/ then a crash/GR shows up in JS engine?

TiA

AOS4.1/SAM460ex/PPC460EX-1155MHZ/2048MB/RadeonRX550/HDD/DVDRW
Go to top
Re: GART patch for RadeonRX on SAM460
Home away from home
Home away from home


See User information
@Javier
Quote:

EDIT1: maybe you can talk/share_code to Hans author of radeonRX, so he can implement it on driver.


As i say in other thread, Hans aleady have done this in beta version of RadeonRX 1.5 year ago. It wasn't released by AEON for unknown reasons, and probably will not, that why i create my own patch. If Mattew will ever release what already done, my gart-patch will be of no needs.

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: GART patch for RadeonRX on SAM460
Quite a regular
Quite a regular


See User information
@jabirulo

Does for me, just tested.
I normally have JS set as default so no idea what it would have done without the patch.
I will test it now.

Update 1 - Works fine without the patch.

Update 2 - It also affects Odyssey 3.1, on that site.
Unable to open 'https://www.amigaworld.net/'.
Error 60:SSL peer certificate or SSH remote key was not ok

Update 3 - Works fine with Ibrowse 3.0

Cheers


Edited by TiredOfLife on 2026/9/5 11:57:35
Edited by TiredOfLife on 2026/9/5 12:08:34
Go to top
Re: GART patch for RadeonRX on SAM460
Just can't stay away
Just can't stay away


See User information
Edited : I'm a dumb..., I forgot to copy the patch in /Kickstart...

Sorry, working flawlessly now :)

--
AmigaONE X1000 and Radeon RX 560
Sam460 and Radeon RX 560
MiST
FPGA Replay + 060 DB
Go to top
Re: GART patch for RadeonRX on SAM460
Just can't stay away
Just can't stay away


See User information
@ElwoodQuote:
Hint, I have a R7-240


Which is the slowest Radeon HD card you can put in you Sam460.

You should find a Radeon RX 560 (a minima).

As Kas1e said, don't except miracles with GART enabled, it remains a Sam460.

I even find things slower with the patch.

Settlers II looses some FPS and the demo Felix seems slower than without the patch (but it may be me, i will have to make some tests with and without).

ChaosTheory work very nicely BTW.

A huse THANK YOU to Kas1e (and Max)!


Edited by K-L on 2026/9/5 14:08:12
--
AmigaONE X1000 and Radeon RX 560
Sam460 and Radeon RX 560
MiST
FPGA Replay + 060 DB
Go to top
Re: GART patch for RadeonRX on SAM460
Just can't stay away
Just can't stay away


See User information
@kas1e

ok, didn't understand why if GART already done/enabled on beta radeonRX why not yet released (or to beatesters).

Go to top
Re: GART patch for RadeonRX on SAM460
Just popping in
Just popping in


See User information
@kas1e

Thank you!

Go to top
Re: GART patch for RadeonRX on SAM460
Just popping in
Just popping in


See User information
@jabirulo

Probably because Matthew is fed up with everybody attacking him and AmigaKit.

I wrote a couple of mails to them, asking for a specific product support, never got an answer. He must be really fed up. Or he has some health issues?

I do wish him the best.

Maybe the OS4 faction is not profitable anymore and he searches a quiet exit? Oh one could go on speculating for a good 10 minutes!

Go to top
Re: GART patch for RadeonRX on SAM460
Just can't stay away
Just can't stay away


See User information
@Tuvok

You know, this is a hooby for most of us, we do things oon our spare/free time or when willing to do.

maybe just too many stuff on his desk and he has no time.

Few developers and too many things to do!.

Go to top
Re: GART patch for RadeonRX on SAM460
Just can't stay away
Just can't stay away


See User information
@jabirulo

replting to myself, is not 100% always, but just noticed that I get such creah/GR when GART pacth enabled. Maybe is juts pure luck!!!

Go to top

  Register To Post

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project