CheeseBees wrote:
Thank you guys. I’d like to know however if VBE uses my actual gpu or just a vga controller
Could you clarify this a bit, please?
If you mean, "If I don't use pass-through, will the emulated Cirrus or Generic SVGA systems behave the same as the RX560, and be programmed the same way?", then the answer is no. Those emulate a different sort of system, one which doesn't have a GPU in the modern sense at all.
The GPU presumably
gets used, by QEMU emulation (because the
RX560, like most modern cards, does all graphics handling using the GPU), but you wouldn't be programming it directly with this option.
As I said earlier, you may want to use this mode as a 'practice run' before trying to write a
Polaris driver, but you would still need to write the Polaris driver later.
If the question is, "If I use pass-through (or am running on the hardware directly in some other way) and I write a driver for the Polaris GPU that uses the firmware routines defined in the VESA BIOS Extensions standard, would it be using the GPU?" The answer is, "yes, but not directly". The VBE were originally defined for hardware that was drastically different, and vastly simpler, than the GPU-based hardware of today.
As I understand it, any modern graphics processor will run an emulation layer for VBE services at the firmware level (whether running as 'bare metal' or not - the emulation is entirely at the GPU level, not related to virtualization at the system level). While a GPU-based card for a PC can be programmed using the VBE routines exclusively - pretty much all will have some level of VBE support, but may not fully implement the standard - it limits you to what the VBE standard defines.
More importantly, few cards have more than minimal support for the 32-bit VESA BIOS, meaning that the only part of the VBE you can count on being present is the real mode functions. Thus, you would either have to write a V86 mode handler in order to use the 16-bit real mode code, which may not even be feasible on a modern UEFI motherboard like yours.
Furthermore, if you are writing a 32-bit or 64-bit system (which I presume you are), then for any 32-bit VBE extensions that are present, you would need to have the necessary interrupt vectors imported into your own interrupt tables at start-up in order to be able to use them.
However, all is not lost; where firmware is concerned, the VBE is just the lowest common denominator. The RX560 itself has a separate firmware, and its own firmware API to call it, separate from the VBE. You would need the
documentation from AMD to use it, and it would be specific to compatible AMD graphics systems (that is to say,
Polaris-based discrete cards, and maybe
Vega-based ones depending on how far they took backwards compatibility; I don't know if their APU systems have the same firmware or not, but since you aren't using one, it's moot for now), but it would give you the tools you need, and more importantly, would serve as a window into the GPU itself which could be used for writing a driver.
Unfortunately, most of the docs on the AMD page I mentioned are for older GPUs, though I would expect that at least some of it still applies to the Polaris series GPUs;
this PDF is the most recent, and from the quick glance at I took, it does seem to indirectly apply to Polaris/Arctic Islands (as it covers
Graphics Core Next gen. 3, AKA Volcanic Islands and Pirate Islands, which is the model used in the immediate predecessors to the Polaris GPUs - Polaris is backwards-compatible with it). The
GPUopen site should have additional information as well, though how useful it would be isn't clear. Regarding VFIO,
this PDF may be useful as well.