Inform 8bpp capability on 8bpp framebuffer in
authoraoyama <aoyama@openbsd.org>
Sat, 5 Aug 2023 00:34:19 +0000 (00:34 +0000)
committeraoyama <aoyama@openbsd.org>
Sat, 5 Aug 2023 00:34:19 +0000 (00:34 +0000)
WSDISPLAYIO_GETSUPPORTEDDEPTH ioctl.

This is needed to use recent updated wsfb(4) driver in 8bpp mode.
We can use 1bpp X server on 8bpp framebuffer by 'startx -- -depth 1'.

Tested by me.

sys/arch/luna88k/dev/lunafb.c

index cc41a0e..072b1b2 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: lunafb.c,v 1.31 2022/11/06 13:01:22 aoyama Exp $ */
+/* $OpenBSD: lunafb.c,v 1.32 2023/08/05 00:34:19 aoyama Exp $ */
 /* $NetBSD: lunafb.c,v 1.7.6.1 2002/08/07 01:48:34 lukem Exp $ */
 
 /*-
@@ -260,7 +260,11 @@ omfbioctl(void *v, u_long cmd, caddr_t data, int flag, struct proc *p)
                return omsetcmap(sc, (struct wsdisplay_cmap *)data);
 
        case WSDISPLAYIO_GETSUPPORTEDDEPTH:
-               *(u_int *)data = WSDISPLAYIO_DEPTH_1;
+               if (dc->dc_depth == 8)
+                       *(u_int *)data =
+                           WSDISPLAYIO_DEPTH_8 | WSDISPLAYIO_DEPTH_1;
+               else
+                       *(u_int *)data = WSDISPLAYIO_DEPTH_1;
                break;
 
        case WSDISPLAYIO_SETGFXMODE: