On Mon, Aug 01, 2022 at 11:58:51AM +0800, Elliot Nunn wrote: > Dear all, > > I want to give Mac OS 9 clients access to hardware cursor support, to improve > responsiveness in absolute-cursor mode. > > Would it be acceptable to add a hardware cursor interface to the VGA device? > And if so, can anyone advise on an appropriate register layout?
Certainly acceptable. Toyed with the idea, but never actually did it because in most cases it is easier to just use virtio-gpu instead ;) > +#define VBE_DISPI_INDEX_CURSOR_IMG 0xb > +#define VBE_DISPI_INDEX_CURSOR_HOTSPOT 0xc > +#define VBE_DISPI_INDEX_CURSOR_ABS 0xd There already is a qemu-specific register extension set (see pci_vga_qext_ops in hw/display/vga-pci.c). Right now it has two registers: One r/o register returning the size of the register area, and one register to get/set the frame buffer byte order. So, when adding hardware cursor support I'd strongly suggest to add the registers there. First because that is already qemu-specific, and second because handling backward compatibility is much easier then. Guests can easily figure whenever hardware cursors are supported by checking the size register and see whenever the hwcursor registers are there or not. I'd also suggest to use more verbose register names and use a separate register for each value, i.e. PCI_VGA_QEXT_REG_HWCURSOR_ENABLE PCI_VGA_QEXT_REG_HWCURSOR_VRAM_OFFSET PCI_VGA_QEXT_REG_HWCURSOR_HOTSPOT_X PCI_VGA_QEXT_REG_HWCURSOR_HOTSPOT_Y PCI_VGA_QEXT_REG_HWCURSOR_POSITION_X PCI_VGA_QEXT_REG_HWCURSOR_POSITION_Y Also define clear semantics for each register and for the cursor format. Do we want just a fixed 64x64 rgba format? If not we need more registers ... Is position the upper left corner of the image or the hotspot? take care, Gerd