How to add a virtual graphics processor in Qemu?

I was wondering how to add a virtual GPU to Qemu? I was told that this is due to the addition of a new graphics output module that uses OpenGL?

+4
source share
1 answer

You are probably referring to the creation of virtual hardware, a kernel, qemu for an Android emulator for creating OpenGL graphics

The very first thing I suggest you do is read the source code, as the commands of already implemented virtual graphics adapters turn into graphic output. Then you should rewrite this to use OpenGL commands instead. With this, you must literally invent a new virtual graphics processor for the guest system. I did not even try to imitate the GeForce or Radeon. In any case, GeForces is not officially documented.

qemu does not provide a real API for implementing the GPU. Of course, this uses some internal API used to implement VESA and S3 emulations, but the new GPU will require repeating this again.

The virtual hardware must offer some I / O to transmit paint commands and data. In theory, you could pass the full OpenGL commands. However, OpenGL is hardware agnostic, while you are actually implementing hardware, so you have to find some balance there. Then in qemu you must implement this virtual hardware to execute the rendering commands.

Finally, you must implement drivers for this virtual hardware, which will include adding a new driver to Mesa and creating a driver for Xorg.

+4
source

All Articles