aboutsummaryrefslogtreecommitdiff
path: root/lib/libvgl
diff options
context:
space:
mode:
authorBruce Evans <bde@FreeBSD.org>2019-04-20 20:29:03 +0000
committerBruce Evans <bde@FreeBSD.org>2019-04-20 20:29:03 +0000
commit80b4b86eb3c69c4a14ef8fcb657628852a2d6e1e (patch)
tree507990249adaf45bec3b9b8025bc9ae7a18b10c2 /lib/libvgl
parent03accca747856df1590c2b1f92ebcc43b0431c1e (diff)
downloadsrc-80b4b86eb3c69c4a14ef8fcb657628852a2d6e1e.tar.gz
src-80b4b86eb3c69c4a14ef8fcb657628852a2d6e1e.zip
Notes
Diffstat (limited to 'lib/libvgl')
-rw-r--r--lib/libvgl/main.c11
-rw-r--r--lib/libvgl/mouse.c40
-rw-r--r--lib/libvgl/simple.c17
3 files changed, 48 insertions, 20 deletions
diff --git a/lib/libvgl/main.c b/lib/libvgl/main.c
index df52de6c10fd..3b5ac8e955df 100644
--- a/lib/libvgl/main.c
+++ b/lib/libvgl/main.c
@@ -93,7 +93,8 @@ struct vt_mode smode;
size[2] = VGLOldVInfo.font_size;;
ioctl(0, KDRASTER, size);
}
- ioctl(0, KDDISABIO, 0);
+ if (VGLModeInfo.vi_mem_model != V_INFO_MM_DIRECT)
+ ioctl(0, KDDISABIO, 0);
ioctl(0, KDSETMODE, KD_TEXT);
smode.mode = VT_AUTO;
ioctl(0, VT_SETMODE, &smode);
@@ -176,7 +177,7 @@ VGLInit(int mode)
if (VGLDisplay == NULL)
return -2;
- if (ioctl(0, KDENABIO, 0)) {
+ if (VGLModeInfo.vi_mem_model != V_INFO_MM_DIRECT && ioctl(0, KDENABIO, 0)) {
free(VGLDisplay);
return -3;
}
@@ -370,7 +371,8 @@ VGLCheckSwitch()
VGLSwitchPending = 0;
if (VGLOnDisplay) {
- ioctl(0, KDENABIO, 0);
+ if (VGLModeInfo.vi_mem_model != V_INFO_MM_DIRECT)
+ ioctl(0, KDENABIO, 0);
ioctl(0, KDSETMODE, KD_GRAPHICS);
ioctl(0, VGLMode, 0);
VGLCurWindow = 0;
@@ -531,7 +533,8 @@ VGLCheckSwitch()
munmap(VGLDisplay->Bitmap, VGLAdpInfo.va_window_size);
ioctl(0, VGLOldMode, 0);
ioctl(0, KDSETMODE, KD_TEXT);
- ioctl(0, KDDISABIO, 0);
+ if (VGLModeInfo.vi_mem_model != V_INFO_MM_DIRECT)
+ ioctl(0, KDDISABIO, 0);
ioctl(0, VT_RELDISP, VT_TRUE);
VGLDisplay->Bitmap = VGLBuf;
VGLDisplay->Type = MEMBUF;
diff --git a/lib/libvgl/mouse.c b/lib/libvgl/mouse.c
index 0a2ebe5dadb6..8dc429a932c3 100644
--- a/lib/libvgl/mouse.c
+++ b/lib/libvgl/mouse.c
@@ -111,10 +111,12 @@ VGLMousePointerShow()
if (!VGLMouseVisible) {
INTOFF();
VGLMouseVisible = 1;
- crtcidx = inb(0x3c4);
- crtcval = inb(0x3c5);
- gdcidx = inb(0x3ce);
- gdcval = inb(0x3cf);
+ if (VGLModeInfo.vi_mem_model != V_INFO_MM_DIRECT) {
+ crtcidx = inb(0x3c4);
+ crtcval = inb(0x3c5);
+ gdcidx = inb(0x3ce);
+ gdcval = inb(0x3cf);
+ }
__VGLBitmapCopy(VGLDisplay, VGLMouseXpos, VGLMouseYpos,
&VGLMouseSave, 0, 0, MOUSE_IMG_SIZE, MOUSE_IMG_SIZE);
bcopy(VGLMouseSave.Bitmap, buffer.Bitmap,
@@ -128,10 +130,12 @@ VGLMousePointerShow()
}
__VGLBitmapCopy(&buffer, 0, 0, VGLDisplay,
VGLMouseXpos, VGLMouseYpos, MOUSE_IMG_SIZE, MOUSE_IMG_SIZE);
- outb(0x3c4, crtcidx);
- outb(0x3c5, crtcval);
- outb(0x3ce, gdcidx);
- outb(0x3cf, gdcval);
+ if (VGLModeInfo.vi_mem_model != V_INFO_MM_DIRECT) {
+ outb(0x3c4, crtcidx);
+ outb(0x3c5, crtcval);
+ outb(0x3ce, gdcidx);
+ outb(0x3cf, gdcval);
+ }
INTON();
}
}
@@ -144,16 +148,20 @@ VGLMousePointerHide()
if (VGLMouseVisible) {
INTOFF();
VGLMouseVisible = 0;
- crtcidx = inb(0x3c4);
- crtcval = inb(0x3c5);
- gdcidx = inb(0x3ce);
- gdcval = inb(0x3cf);
+ if (VGLModeInfo.vi_mem_model != V_INFO_MM_DIRECT) {
+ crtcidx = inb(0x3c4);
+ crtcval = inb(0x3c5);
+ gdcidx = inb(0x3ce);
+ gdcval = inb(0x3cf);
+ }
__VGLBitmapCopy(&VGLMouseSave, 0, 0, VGLDisplay,
VGLMouseXpos, VGLMouseYpos, MOUSE_IMG_SIZE, MOUSE_IMG_SIZE);
- outb(0x3c4, crtcidx);
- outb(0x3c5, crtcval);
- outb(0x3ce, gdcidx);
- outb(0x3cf, gdcval);
+ if (VGLModeInfo.vi_mem_model != V_INFO_MM_DIRECT) {
+ outb(0x3c4, crtcidx);
+ outb(0x3c5, crtcval);
+ outb(0x3ce, gdcidx);
+ outb(0x3cf, gdcval);
+ }
INTON();
}
}
diff --git a/lib/libvgl/simple.c b/lib/libvgl/simple.c
index 3879ace8576d..1da02746c529 100644
--- a/lib/libvgl/simple.c
+++ b/lib/libvgl/simple.c
@@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$");
#include <signal.h>
#include <sys/fbio.h>
+#include <sys/kbio.h>
#include <sys/endian.h>
#include "vgl.h"
@@ -551,6 +552,8 @@ VGLRestorePalette()
{
int i;
+ if (VGLModeInfo.vi_mem_model == V_INFO_MM_DIRECT)
+ return;
outb(0x3C6, 0xFF);
inb(0x3DA);
outb(0x3C8, 0x00);
@@ -571,6 +574,8 @@ VGLSavePalette()
{
int i;
+ if (VGLModeInfo.vi_mem_model == V_INFO_MM_DIRECT)
+ return;
outb(0x3C6, 0xFF);
inb(0x3DA);
outb(0x3C7, 0x00);
@@ -591,6 +596,8 @@ VGLSetPalette(byte *red, byte *green, byte *blue)
{
int i;
+ if (VGLModeInfo.vi_mem_model == V_INFO_MM_DIRECT)
+ return;
for (i=0; i<256; i++) {
VGLSavePaletteRed[i] = red[i];
VGLSavePaletteGreen[i] = green[i];
@@ -615,6 +622,8 @@ VGLSetPalette(byte *red, byte *green, byte *blue)
void
VGLSetPaletteIndex(byte color, byte red, byte green, byte blue)
{
+ if (VGLModeInfo.vi_mem_model == V_INFO_MM_DIRECT)
+ return;
VGLSavePaletteRed[color] = red;
VGLSavePaletteGreen[color] = green;
VGLSavePaletteBlue[color] = blue;
@@ -630,11 +639,15 @@ VGLSetPaletteIndex(byte color, byte red, byte green, byte blue)
void
VGLSetBorder(byte color)
{
+ if (VGLModeInfo.vi_mem_model == V_INFO_MM_DIRECT && ioctl(0, KDENABIO, 0))
+ return;
VGLCheckSwitch();
inb(0x3DA);
outb(0x3C0,0x11); outb(0x3C0, color);
inb(0x3DA);
outb(0x3C0, 0x20);
+ if (VGLModeInfo.vi_mem_model == V_INFO_MM_DIRECT)
+ ioctl(0, KDDISABIO, 0);
}
void
@@ -642,7 +655,11 @@ VGLBlankDisplay(int blank)
{
byte val;
+ if (VGLModeInfo.vi_mem_model == V_INFO_MM_DIRECT && ioctl(0, KDENABIO, 0))
+ return;
VGLCheckSwitch();
outb(0x3C4, 0x01); val = inb(0x3C5); outb(0x3C4, 0x01);
outb(0x3C5, ((blank) ? (val |= 0x20) : (val &= 0xDF)));
+ if (VGLModeInfo.vi_mem_model == V_INFO_MM_DIRECT)
+ ioctl(0, KDDISABIO, 0);
}