Skip to content

adding support for gpu cursor

When a graphics adapter a scheme is opened it checks if the method cursor_support returns true. If so it creates a cursor resource for all VTs. When a write for a cursor arrives, the active VT is updated with a cursor image. The read was updated so Orbital can open the display file and get a response if a gpu cursor is supported. For this purpose cursror_support was added and implemented in both vesad and virtio-gpu, as well as cursor_setup and handle_cursor, but only implemented for virtio-gpu. The Cursor type was also added to keep track of ids for cursor resources as well as their sgl.

There is a move_cursor function which moves the cursor and update_cursor function which updates the cursor image as well as move the cursor. A minor issue is that on a Ctr+Alt+G key combination to release the cursor, the cursor disappears. Grabbing the cursor again does not make it reappear, unless there is an event that makes Orbital send a new cursor image to the gpu (i.e. update_cursor is called). This seems to be a known issue in QEMU with absolute position cursors, for both SDL and GTK. To mitigate this, a timer is set in Orbital to have the cursor update its image on every second. This still causes the cursor to disappear when released, but once grabbed and moved inside the VM it reappears after a second.

Edited by Dimitar Gjorgievski

Merge request reports

Loading