diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2022-07-15 17:57:28 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2022-07-15 17:57:28 +0000 |
commit | 3f47b93dce7330e346a8c804cc4a76cc4069f84d (patch) | |
tree | 8df0e9b525b0b79b6c4af50dc7538c9940812896 /sys/dev/wscons/wsdisplay.c | |
parent | a293620c322495162cd11778c11d765cda80455b (diff) |
Implement support for framebuffers that don't start on a page boundary.
This happens on the new 14" and 16" Macbook Pro where we deliberately use
a framebuffer that skips the first few lines to avoid "the notch".
The offset of the first pixel is added to struct wsdisplay_fbinfo. The
stride is added as well, mirroring the value returned by the
WSDISPLAYIO_LINEBYTES ioctl, such that we can retire that one in the
future. A compat ioctl is implemented to help the transition. The compat
code will be removed after OpenBSD 7.3 has been released.
ok miod@
Diffstat (limited to 'sys/dev/wscons/wsdisplay.c')
-rw-r--r-- | sys/dev/wscons/wsdisplay.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/sys/dev/wscons/wsdisplay.c b/sys/dev/wscons/wsdisplay.c index b86602e2895..cc6f1008497 100644 --- a/sys/dev/wscons/wsdisplay.c +++ b/sys/dev/wscons/wsdisplay.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wsdisplay.c,v 1.148 2022/07/08 21:29:20 miod Exp $ */ +/* $OpenBSD: wsdisplay.c,v 1.149 2022/07/15 17:57:27 kettenis Exp $ */ /* $NetBSD: wsdisplay.c,v 1.82 2005/02/27 00:27:52 perry Exp $ */ /* @@ -1302,6 +1302,25 @@ wsdisplay_driver_ioctl(struct wsdisplay_softc *sc, u_long cmd, caddr_t data, { int error; +#if defined(OpenBSD7_1) || defined(OpenBSD7_2) || defined(OpenBSD7_3) + if (cmd == WSDISPLAYIO_OGINFO) { + struct wsdisplay_ofbinfo *oinfo = + (struct wsdisplay_ofbinfo *)data; + struct wsdisplay_fbinfo info; + + error = (*sc->sc_accessops->ioctl)(sc->sc_accesscookie, + WSDISPLAYIO_GINFO, (caddr_t)&info, flag, p); + if (error) + return error; + + oinfo->height = info.height; + oinfo->width = info.width; + oinfo->depth = info.depth; + oinfo->cmsize = info.cmsize; + return (0); + } +#endif + error = ((*sc->sc_accessops->ioctl)(sc->sc_accesscookie, cmd, data, flag, p)); /* Do not report parameters with empty ranges to userland. */ |