From b6e057d87d7f9778f0e1913aa6d8c8443004b3e7 Mon Sep 17 00:00:00 2001 From: aoyama Date: Fri, 12 Aug 2022 13:36:19 +0000 Subject: [PATCH] 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. --- sys/arch/luna88k/dev/lunafb.c | 5 +++-- 1 file 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; -- 2.20.1