|
From: | BALATON Zoltan |
Subject: | Re: [Qemu-devel] Question about hardware cursor in VGA |
Date: | Wed, 6 Mar 2019 14:50:36 +0100 (CET) |
User-agent: | Alpine 2.21.9999 (BSF 287 2018-06-16) |
On Wed, 6 Mar 2019, Gerd Hoffmann wrote:
On Wed, Mar 06, 2019 at 12:48:59AM +0100, BALATON Zoltan wrote:On Tue, 5 Mar 2019, Gerd Hoffmann wrote:Use dpy_cursor_define().I've done that but it's not working very well. The mouse pointer is quite jumpy with this and there are some problems updating the pointer image when the guest changes image data in video ram without changing registers. (LikeWhen using a relative pointing device (i.e. mouse instead of tablet) you also need dpy_mouse_set(), to update the host mouse position when the guest moves the cursor sprite around.
Sure, I figured that out otherwise the mouse pointer would not move.
Is it possible to figure where the cursor hotspot is?
Not sure what you mean. I call dpy_mouse_set() on writing the reg that contains mouse position. Hot spot is always top left of sprite (or I don't know where it's set). I'll submit a v5 after adding some more checks to make it a bit safer then you can have a look.
least doing hw cursor like this works somewhat but I note that the other version with cursor_invalidate and cursor_draw_line callbacks worked much smoother, alas I've found that cannot work with shared_surface.There is a VGAComminState->force_shadow ...
Yes, but that would also make things slower so I like to keep advantage of shared_surface and try to fix the jumpy mouse we get with define_cursor instead if possible.
should be? (Also note that draw_line callback could do complement pixels but that's not possible with dpy_cursor_define.)Yep, dpy_cursor_define is designed for the way modern hardware handles hardware cursors, to allow it being used as hardware cursor on the host. cirrus has a few modes which modern hardware can't do, thats why it doesn't use dpy_cursor_define. Has ati cursor a complement pixel mode too?
Yes, this part dates back to first ATI VGA chips is seem and has the 2 bit Windows mouse encoding (fg, bg, transparent, complement) but we can probably live without that if it gives us faster display for a few bad pixels in mouse pointer.
Regards, BALATON Zoltan
[Prev in Thread] | Current Thread | [Next in Thread] |