Want to play with graphics drivers a bit to understand how it all works on low level, and so far found that PCIgraphics.card contain hardcoded list of supported graphics cards (by name of *.chip files or by vendor/ids value?) and adding any new card which not in, can be done or by creating new xxxx.card, or by patching PCIGraphics.card. That correct ?
I just grep on strings inside of PCIgraphics.card, and found those:
So, like anything else is out and if i want to add any new vendor/id/driver-name i need to create own *.card file or patch PCIgraphics.card , right ?
What is interesting, is that PCIGraphics.card does not have RadeonRX.chip string, so that mean RadeonHd there only for supporting "lite" version of the driver which come with the OS4 installation.
I disassembly RadeonRX driver, and found that it do have 2 resident tags : RadeonRX.chip main code, and RXCardPatch cold-start resident. RXCardPatch runs early, and have high priority, so it scan/build RadeonRX card info, and then opens PCIGraphics.card , get its main interface and via SetMethod() replace FindCard() and InitCard(). Then, when time come and PCIGraphics.card runs, it's already patched and do what need to do.
So, the way to add any new card which is not in PCIGraphics.card is probably that one, right ?
If description generated by AI on your link is correct then you do it exactly same way as radeonrx : patching pcigraphics by setmethod. I also see you alreade restructure private boardinfo structures, that nice :)
Btw, is your virtuogpu fast in 2d in compare with any other emulated card ?
@kas1e I don’t know if this will be useful, but I’ve just remembered something… Falke tried to do something along these lines using AI. He couldn’t get a new graphics card to initialise via PCIGraphics.card He created a separate virtovga.card. The graphics card did initialise and was visible in the system, but it couldn’t be started.
@jorg wrote about an entry in p96config in the bootloader and loading a new driver from there. I don’t think that worked. screen - > https://ibb.co/bRybTDvc
@smarkusg The way how Falke did is pure vibe coding, the way how Derfs do is more looks like real programming even with help of AI : i check the logs of repo , and he did quite lot of work for 2 months : he does same as if me does it : disassembly RadeonRX, disasembly PCIGraphics.card, disassembly graphics.library, then used all the opensources variants of all possible related drivers (even no directly os4 ones), and he fully reconstruct private BoardInfo structure which is "closed sourced".
Also, he go the way how RadeonRX driver do : create 2 residents in one binary, one which patch PCIGraphics.card via setmethod so to add "gate" to add more cards to the PCIgraphics.card together with usage of full stuff from PCIgraphics.card, and another resident is actual code.
Just compiled your driver and tested it on qemu under debian 13, the mouse pointer appears briefly with a bluish tint, then dissapears as soon as i click or move it, never to be seen again. Tried both Virtio-gpu and virtio-gpu-gl,with same result. I am using pegasos 2 version.CPU is AMD Ryzen 3 7320C with Radeon Graphics.
@Ami603 This is the first public release. I tested it on my Asahi Linux ARM64 Fedora 44 Wayland system QEMU-11 and didn't have any issues with mouse colors. Sometimes the mouse/pointer freezes up strangely—just right-click and it works fine again.. Settings I’m using: I have all transparency and shadow options for compositing turned off. Overall, the one major issue I’ve noticed is that with compositing disabled, the driver runs terribly slow—really slow—and there are errors with proper color rendering and window display. But this is just a demo/beta version. It’s normal for it to behave this way and have bugs.
You see RadeonHD.chip in PCIGraphics.card, because I initially started adding its PCI IDs to PCIGraphics.card. I initially had permission to distribute PCIGraphics.card with the driver, but that got revoked. So, I switched to patching the FindCard function.
There's a bit of a trick to getting it working while still allowing other cards to work. But, it allows us to add any graphics to the system, without having to replace PCIGraphics.card, or wait for Hyperion to release an update with new PCI IDs.
So some progress to share. At the moment i simple support very old and dumb AGP based NVIDIA card (so i test it on pegasos2), named NVIDIA GeForce2 MX-400 NV11 64MB.
As reference i use Noveau drirver from linux, and Derfss's reconstruction of the Picasso96 chip driver internal interface: the one which is private and not shared with public across SDK.
So far, that what i have now (as always open image in new tab for full size):