summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorKenji Aoyama <aoyama@cvs.openbsd.org>2022-08-12 13:36:20 +0000
committerKenji Aoyama <aoyama@cvs.openbsd.org>2022-08-12 13:36:20 +0000
commitbfa0919b6d8400e745b440c872c27eb4dfabd548 (patch)
tree27ddf717667ceb63ff0428077e27f13382485735 /sys
parent05b3a2262134a71922d19fbd04565a7611d81c37 (diff)
Fix to work 1bpp Xorg server again on 1bpp framebuffer hardware.
Recent xenocara wsfb driver can treat LUNA's framebuffer "offset", but it requires one more page by mmap() when we use offset. Noticed and tested on nono emulator with 1bpp setting.
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/luna88k/dev/lunafb.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/arch/luna88k/dev/lunafb.c b/sys/arch/luna88k/dev/lunafb.c
index 7f0e2e60d38..b2730131ef4 100644
--- a/sys/arch/luna88k/dev/lunafb.c
+++ b/sys/arch/luna88k/dev/lunafb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lunafb.c,v 1.29 2022/07/15 17:57:26 kettenis Exp $ */
+/* $OpenBSD: lunafb.c,v 1.30 2022/08/12 13:36:19 aoyama Exp $ */
/* $NetBSD: lunafb.c,v 1.7.6.1 2002/08/07 01:48:34 lukem Exp $ */
/*-
@@ -301,7 +301,8 @@ omfbmmap(void *v, off_t offset, int prot)
if (offset >= 0 && offset < OMFB_SIZE)
cookie = (paddr_t)(trunc_page(dc->dc_videobase) + offset);
#else
- if (offset >= 0 && offset < dc->dc_rowbytes * dc->dc_ht * hwplanebits)
+ if (offset >= 0 &&
+ offset < dc->dc_rowbytes * dc->dc_ht * hwplanebits + PAGE_SIZE)
cookie = (paddr_t)(trunc_page(OMFB_FB_RADDR) + offset);
#endif
return cookie;