diff options
author | Kenji Aoyama <aoyama@cvs.openbsd.org> | 2013-07-15 13:23:18 +0000 |
---|---|---|
committer | Kenji Aoyama <aoyama@cvs.openbsd.org> | 2013-07-15 13:23:18 +0000 |
commit | 3a2a61063bb13507d6208279c6b7a501cd8fb92c (patch) | |
tree | f5379ce4b6613ec2491ff7aad55d9df4ba0d707b /driver | |
parent | b4f39054fecc9c1ed59eb10c005f2af4d127baf6 (diff) |
Add monochrome X server support for luna88k.
Some luna88k specific quirks are needed in
driver/xf86-video-wsfb/src/wsfb_driver.c for now.
ok matthieu@
Diffstat (limited to 'driver')
-rw-r--r-- | driver/Makefile | 7 | ||||
-rw-r--r-- | driver/xf86-video-wsfb/src/wsfb_driver.c | 23 |
2 files changed, 22 insertions, 8 deletions
diff --git a/driver/Makefile b/driver/Makefile index 6b70be272..a8dab04a1 100644 --- a/driver/Makefile +++ b/driver/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.54 2013/03/16 01:24:43 aoyama Exp $ +# $OpenBSD: Makefile,v 1.55 2013/07/15 13:23:17 aoyama Exp $ INPUT_DRV_DEFAULT= \ xf86-input-keyboard \ @@ -26,7 +26,7 @@ INPUT_DRV_landisk= INPUT_DRV_loongson= ${INPUT_DRV_DEFAULT} -INPUT_DRV_luna88k= +INPUT_DRV_luna88k= ${INPUT_DRV_DEFAULT} INPUT_DRV_macppc= ${INPUT_DRV_COMMON} @@ -82,7 +82,8 @@ VIDEO_DRV_landisk= VIDEO_DRV_loongson= \ xf86-video-wsfb -VIDEO_DRV_luna88k= +VIDEO_DRV_luna88k= \ + xf86-video-wsfb VIDEO_DRV_macppc= \ xf86-video-ati xf86-video-mach64 xf86-video-nv xf86-video-r128 \ diff --git a/driver/xf86-video-wsfb/src/wsfb_driver.c b/driver/xf86-video-wsfb/src/wsfb_driver.c index 752b1c14c..d0d556ee8 100644 --- a/driver/xf86-video-wsfb/src/wsfb_driver.c +++ b/driver/xf86-video-wsfb/src/wsfb_driver.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wsfb_driver.c,v 1.29 2013/05/12 13:06:25 matthieu Exp $ */ +/* $OpenBSD: wsfb_driver.c,v 1.30 2013/07/15 13:23:17 aoyama Exp $ */ /* * Copyright © 2001-2012 Matthieu Herrb * All rights reserved. @@ -235,6 +235,7 @@ typedef struct { int fd; /* File descriptor of open device. */ struct wsdisplay_fbinfo info; /* Frame buffer characteristics. */ int linebytes; /* Number of bytes per row. */ + int wstype; /* wsdisplay type. */ unsigned char* fbstart; unsigned char* fbmem; size_t fbmem_len; @@ -397,7 +398,7 @@ static Bool WsfbPreInit(ScrnInfoPtr pScrn, int flags) { WsfbPtr fPtr; - int defaultDepth, depths, flags24, wstype; + int defaultDepth, depths, flags24; const char *dev; char *mod = NULL, *s; const char *reqSym = NULL; @@ -427,7 +428,7 @@ WsfbPreInit(ScrnInfoPtr pScrn, int flags) if (fPtr->fd == -1) { return FALSE; } - if (ioctl(fPtr->fd, WSDISPLAYIO_GTYPE, &wstype) == -1) { + if (ioctl(fPtr->fd, WSDISPLAYIO_GTYPE, &(fPtr->wstype)) == -1) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "ioctl WSDISPLAY_GTYPE: %s\n", strerror(errno)); @@ -495,7 +496,7 @@ WsfbPreInit(ScrnInfoPtr pScrn, int flags) fPtr->info.depth, flags24)) return FALSE; - if (wstype == WSDISPLAY_TYPE_PCIVGA) { + if (fPtr->wstype == WSDISPLAY_TYPE_PCIVGA) { /* Set specified mode. */ if (pScrn->display->modes != NULL && pScrn->display->modes[0] != NULL) { @@ -579,7 +580,7 @@ WsfbPreInit(ScrnInfoPtr pScrn, int flags) if (pScrn->depth > 8) { rgb zeros = { 0, 0, 0 }, masks; - switch (wstype) { + switch (fPtr->wstype) { case WSDISPLAY_TYPE_SUN24: case WSDISPLAY_TYPE_SUNCG12: case WSDISPLAY_TYPE_SUNCG14: @@ -736,6 +737,10 @@ WsfbPreInit(ScrnInfoPtr pScrn, int flags) pScrn->virtualY = fPtr->info.height; pScrn->displayWidth = pScrn->virtualX; + /* Quirk for LUNA's framebuffer */ + if (fPtr->wstype == WSDISPLAY_TYPE_LUNA) + pScrn->displayWidth = fPtr->linebytes * 8; + /* Set the display resolution. */ xf86SetDpi(pScrn, 0, 0); @@ -915,6 +920,14 @@ WsfbScreenInit(SCREEN_INIT_ARGS_DECL) fPtr->fbstart = fPtr->fbmem; + /* + * LUNA's framebuffer seems to have 64 dot (8 byte) offset. + * This might be able to be changed in kernel lunafb driver, + * but current setting was pulled from 4.4BSD-Lite2/luna68k. + */ + if (fPtr->wstype == WSDISPLAY_TYPE_LUNA) + fPtr->fbstart += 8; + if (fPtr->shadowFB) { fPtr->shadow = calloc(1, pScrn->virtualX * pScrn->virtualY * pScrn->bitsPerPixel/8); |