svn commit: r346747 - head/lib/libvgl
Bruce Evans
bde at FreeBSD.org
Fri Apr 26 14:44:21 UTC 2019
Author: bde
Date: Fri Apr 26 14:44:20 2019
New Revision: 346747
URL: https://svnweb.freebsd.org/changeset/base/346747
Log:
Remove save/restore of the crtc and gdc registers when showing and
hiding the mouse cursor. The showing and hiding is often done
asynchronously in a not very safe signal handler, but the state of
these registers and much more is protected from the signal handler
in a better way by deferring mouse signals while the state is in use.
Modified:
head/lib/libvgl/mouse.c
Modified: head/lib/libvgl/mouse.c
==============================================================================
--- head/lib/libvgl/mouse.c Fri Apr 26 14:15:58 2019 (r346746)
+++ head/lib/libvgl/mouse.c Fri Apr 26 14:44:20 2019 (r346747)
@@ -108,18 +108,11 @@ VGLMousePointerShow()
byte buf[MOUSE_IMG_SIZE*MOUSE_IMG_SIZE*4];
VGLBitmap buffer =
VGLBITMAP_INITIALIZER(MEMBUF, MOUSE_IMG_SIZE, MOUSE_IMG_SIZE, buf);
- byte crtcidx, crtcval, gdcidx, gdcval;
int pos;
if (!VGLMouseVisible) {
INTOFF();
VGLMouseVisible = 1;
- if (VGLModeInfo.vi_mem_model != V_INFO_MM_DIRECT) {
- crtcidx = inb(0x3c4);
- crtcval = inb(0x3c5);
- gdcidx = inb(0x3ce);
- gdcval = inb(0x3cf);
- }
buffer.PixelBytes = VGLDisplay->PixelBytes;
__VGLBitmapCopy(&VGLVDisplay, VGLMouseXpos, VGLMouseYpos,
&buffer, 0, 0, MOUSE_IMG_SIZE, MOUSE_IMG_SIZE);
@@ -130,12 +123,6 @@ VGLMousePointerShow()
VGLDisplay->PixelBytes);
__VGLBitmapCopy(&buffer, 0, 0, VGLDisplay,
VGLMouseXpos, VGLMouseYpos, MOUSE_IMG_SIZE, MOUSE_IMG_SIZE);
- if (VGLModeInfo.vi_mem_model != V_INFO_MM_DIRECT) {
- outb(0x3c4, crtcidx);
- outb(0x3c5, crtcval);
- outb(0x3ce, gdcidx);
- outb(0x3cf, gdcval);
- }
INTON();
}
}
@@ -143,25 +130,11 @@ VGLMousePointerShow()
void
VGLMousePointerHide()
{
- byte crtcidx, crtcval, gdcidx, gdcval;
-
if (VGLMouseVisible) {
INTOFF();
VGLMouseVisible = 0;
- if (VGLModeInfo.vi_mem_model != V_INFO_MM_DIRECT) {
- crtcidx = inb(0x3c4);
- crtcval = inb(0x3c5);
- gdcidx = inb(0x3ce);
- gdcval = inb(0x3cf);
- }
__VGLBitmapCopy(&VGLVDisplay, VGLMouseXpos, VGLMouseYpos, VGLDisplay,
VGLMouseXpos, VGLMouseYpos, MOUSE_IMG_SIZE, MOUSE_IMG_SIZE);
- if (VGLModeInfo.vi_mem_model != V_INFO_MM_DIRECT) {
- outb(0x3c4, crtcidx);
- outb(0x3c5, crtcval);
- outb(0x3ce, gdcidx);
- outb(0x3cf, gdcval);
- }
INTON();
}
}
More information about the svn-src-head
mailing list