VirtualBox

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 JHRobotics)

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)

svga_mouse_svn_1.patch (1.7 KB ) - added by JHRobotics 5 months ago.
Patch for 1st bug (SVN)
svga_mouse_svn_2.patch (826 bytes ) - added by JHRobotics 5 months ago.
Patch for 2nd bug (SVN)
svga_mouse_svn_3.patch (1.9 KB ) - added by JHRobotics 5 months ago.
Patch for 3rd bug (SVN)
svga_mouse_7.0.18_1.patch (1.7 KB ) - added by JHRobotics 5 months ago.
Patch for 1st bug (stable)
svga_mouse_7.0.18_2.patch (771 bytes ) - added by JHRobotics 5 months ago.
Patch for 2nd bug (stable)
svga_mouse_7.0.18_3.patch (1.8 KB ) - added by JHRobotics 5 months ago.
Patch for 3rd bug (stable)
screen1-mask-bug.png (20.8 KB ) - added by JHRobotics 5 months ago.
Problems with cursor mask
screen2-scale-bug.png (28.4 KB ) - added by JHRobotics 5 months ago.
Problems with scale
screen3-inv-emulation.png (30.3 KB ) - added by JHRobotics 5 months ago.
Text select cursor
screen4-fixed.png (28.5 KB ) - added by JHRobotics 5 months ago.
When patches are applied screenshot.
svga_mouse_svn_3b.patch (1.9 KB ) - added by JHRobotics 5 months ago.
Fixed patch for 3rd bug (SVN)

Download all attachments as: .zip

Change History (15)

by JHRobotics, 5 months ago

Attachment: svga_mouse_svn_1.patch added

Patch for 1st bug (SVN)

by JHRobotics, 5 months ago

Attachment: svga_mouse_svn_2.patch added

Patch for 2nd bug (SVN)

by JHRobotics, 5 months ago

Attachment: svga_mouse_svn_3.patch added

Patch for 3rd bug (SVN)

by JHRobotics, 5 months ago

Attachment: svga_mouse_7.0.18_1.patch added

Patch for 1st bug (stable)

by JHRobotics, 5 months ago

Attachment: svga_mouse_7.0.18_2.patch added

Patch for 2nd bug (stable)

by JHRobotics, 5 months ago

Attachment: svga_mouse_7.0.18_3.patch added

Patch for 3rd bug (stable)

by JHRobotics, 5 months ago

Attachment: screen1-mask-bug.png added

Problems with cursor mask

by JHRobotics, 5 months ago

Attachment: screen2-scale-bug.png added

Problems with scale

by JHRobotics, 5 months ago

Attachment: screen3-inv-emulation.png added

Text select cursor

by JHRobotics, 5 months ago

Attachment: screen4-fixed.png added

When patches are applied screenshot.

comment:1 by JHRobotics, 5 months ago

Description: modified (diff)

comment:2 by JHRobotics, 5 months ago

Description: modified (diff)

comment:3 by JHRobotics, 5 months ago

Description: modified (diff)

comment:4 by JHRobotics, 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.

by JHRobotics, 5 months ago

Attachment: svga_mouse_svn_3b.patch added

Fixed patch for 3rd bug (SVN)

Note: See TracTickets for help on using tickets.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette