Add more luna88k-specific initialization to use color wscons and
monochrome X server both. Now OpenBSD/luna88k kernel supports color wscons on 4/8bpp frame buffer, but X server only supports 1bpp (monochrome) for now. So change `pseudo' depth by WSDISPLAYIO_SETGFXMODE ioctl while X server is running.
This commit is contained in:
parent
5104442c40
commit
8722ac84a6
@ -1,4 +1,4 @@
|
|||||||
/* $OpenBSD: wsfb_driver.c,v 1.30 2013/07/15 13:23:17 aoyama Exp $ */
|
/* $OpenBSD: wsfb_driver.c,v 1.31 2014/01/15 11:15:59 aoyama Exp $ */
|
||||||
/*
|
/*
|
||||||
* Copyright © 2001-2012 Matthieu Herrb
|
* Copyright © 2001-2012 Matthieu Herrb
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
@ -531,6 +531,22 @@ WsfbPreInit(ScrnInfoPtr pScrn, int flags)
|
|||||||
strerror(errno));
|
strerror(errno));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Quirk for LUNA: now X supports 1bpp only, so force to set 1bpp */
|
||||||
|
if (fPtr->wstype == WSDISPLAY_TYPE_LUNA) {
|
||||||
|
struct wsdisplay_gfx_mode gfxmode;
|
||||||
|
gfxmode.width = fPtr->info.width;
|
||||||
|
gfxmode.height = fPtr->info.height;
|
||||||
|
gfxmode.depth = fPtr->info.depth = 1;
|
||||||
|
|
||||||
|
if (ioctl(fPtr->fd, WSDISPLAYIO_SETGFXMODE, &gfxmode) == -1) {
|
||||||
|
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
|
||||||
|
"ioctl WSDISPLAY_SETGFXMODE: %s\n",
|
||||||
|
strerror(errno));
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Allocate room for saving the colormap.
|
* Allocate room for saving the colormap.
|
||||||
*/
|
*/
|
||||||
@ -1335,6 +1351,21 @@ WsfbRestore(ScrnInfoPtr pScrn)
|
|||||||
/* Clear the screen. */
|
/* Clear the screen. */
|
||||||
memset(fPtr->fbmem, 0, fPtr->fbmem_len);
|
memset(fPtr->fbmem, 0, fPtr->fbmem_len);
|
||||||
|
|
||||||
|
/* Quirk for LUNA: Restore default depth. */
|
||||||
|
if (fPtr->wstype == WSDISPLAY_TYPE_LUNA) {
|
||||||
|
struct wsdisplay_gfx_mode gfxmode;
|
||||||
|
gfxmode.width = fPtr->info.width;
|
||||||
|
gfxmode.height = fPtr->info.height;
|
||||||
|
gfxmode.depth = 0; /* set to default depth */
|
||||||
|
|
||||||
|
if (ioctl(fPtr->fd, WSDISPLAYIO_SETGFXMODE, &gfxmode) == -1) {
|
||||||
|
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
|
||||||
|
"ioctl WSDISPLAY_SETGFXMODE: %s\n",
|
||||||
|
strerror(errno));
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Restore the text mode. */
|
/* Restore the text mode. */
|
||||||
mode = WSDISPLAYIO_MODE_EMUL;
|
mode = WSDISPLAYIO_MODE_EMUL;
|
||||||
if (ioctl(fPtr->fd, WSDISPLAYIO_SMODE, &mode) == -1) {
|
if (ioctl(fPtr->fd, WSDISPLAYIO_SMODE, &mode) == -1) {
|
||||||
|
Loading…
Reference in New Issue
Block a user