Opened 5 months ago
Last modified 5 months ago
#22096 new defect
VMSVGA/VBoxSVGA: Accelerated cursor bugs
Reported by: | JHRobotics | Owned by: | |
---|---|---|---|
Component: | GUI | Version: | VirtualBox-7.0.18 |
Keywords: | VMSVGA cursor | Cc: | JHRobotics |
Guest type: | all | Host type: | all |
Description (last modified by )
Hello, when I try to use SVGA commands for mouse acceleration, I found following bugs:
1) When is used SVGA_CMD_DEFINE_CURSOR
command (cursor is defined by AND and XOR mask), cursor is draw wrongly and “White colour” (AND=1, XOR=0) is drawing as transparent.
(screenshot screen1-mask-bug.png).
Investigation of problem led me to that mask is calculated but not used and also QT probably haven’t multiplatform way how to perform classical AND and XOR blit, so I suggest converting all cursors to image with alpha mask (VBox it already doing for all non 1bpp cursors). Only one drawback is that in this way we cannot handle colour inverse (usually used by text selection cursor) for these cases I suggest using grey colour so cursor is visible on both black na white.
2) When screen is scaled cursor is keeps in scale of host system – for example when you have 150% DPI the cursor has 150% regardless to virtual screen scale setting. Also, virtual screen scale settings have no effect to cursor size.
(screenshot screen2-scale-bug.png).
3) When I write 0
to FIFO FIFO SVGA_FIFO_CURSOR_ON
registry (and update SVGA_FIFO_CURSOR_COUNT
reg), the cursor should disappear, but it doesn't.
I also attached patches for these bugs for SVN and for stable version. Bugs also appears with official driver from VMWare (you must set display to VMSVGA and VRAM around 24 MB or lower).
Cursor acceleration is pretty important for fast rendering, because with SW cursor you have to synchronously erase it before rendering operation and blit it back after it.
Screenshot when my patches are applied: screen4-fixed.png. Screenshot with emulation of inverse: screen3-inv-emulation.png.
Best regards
JH
Attachments (11)
Change History (15)
by , 5 months ago
Attachment: | svga_mouse_svn_1.patch added |
---|
comment:1 by , 5 months ago
Description: | modified (diff) |
---|
comment:2 by , 5 months ago
Description: | modified (diff) |
---|
comment:3 by , 5 months ago
Description: | modified (diff) |
---|
comment:4 by , 5 months ago
OK, patch 3 needed some tweaking:
a) we also need to show cursor not only hide – it wasn't obvious, because Windows always load new cursor when they want reenable hidden.
b) when new cursor is loaded, new cursor is visible but (*pfLastVisible)
is still remain false, so when fVisible
is false, it is required to unconditionally erase the cursor to make sure that is definitely invisible. I don’t expect performance problems here, because is not likely that driver will storm the HW with “disable cursor” requirements.
Modified patch (svga_mouse_svn_3b.patch) attached, also applicable on release (offset -135 lines).
I also forgot to mention, that all my patches are under MIT license.
Patch for 1st bug (SVN)