qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: VGA hardware cursor query


From: Gerd Hoffmann
Subject: Re: VGA hardware cursor query
Date: Mon, 15 Aug 2022 13:56:57 +0200

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]