summaryrefslogtreecommitdiff
path: root/sys/arch/armv7/omap/omdisplay.c
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2022-07-15 17:57:28 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2022-07-15 17:57:28 +0000
commit3f47b93dce7330e346a8c804cc4a76cc4069f84d (patch)
tree8df0e9b525b0b79b6c4af50dc7538c9940812896 /sys/arch/armv7/omap/omdisplay.c
parenta293620c322495162cd11778c11d765cda80455b (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/arch/armv7/omap/omdisplay.c')
-rw-r--r--sys/arch/armv7/omap/omdisplay.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/arch/armv7/omap/omdisplay.c b/sys/arch/armv7/omap/omdisplay.c
index c554c331b0c..e80a2218421 100644
--- a/sys/arch/armv7/omap/omdisplay.c
+++ b/sys/arch/armv7/omap/omdisplay.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: omdisplay.c,v 1.9 2021/10/24 17:52:27 mpi Exp $ */
+/* $OpenBSD: omdisplay.c,v 1.10 2022/07/15 17:57:25 kettenis Exp $ */
/*
* Copyright (c) 2007 Dale Rahn <drahn@openbsd.org>
*
@@ -596,6 +596,11 @@ omdisplay_ioctl(void *v, u_long cmd, caddr_t data, int flag, struct proc *p)
wsdisp_info->height = sc->sc_geometry->height;
wsdisp_info->width = sc->sc_geometry->width;
wsdisp_info->depth = 16; /* XXX */
+ if (scr != NULL)
+ wsdisp_info->stride = scr->rinfo.r_stride;
+ else
+ wsdisp_info->stride = 0;
+ wsdisp_info->offset = 0;
wsdisp_info->cmsize = 0;
break;