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/ic | |
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/ic')
-rw-r--r-- | sys/dev/ic/sti.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/dev/ic/sti.c b/sys/dev/ic/sti.c index 87a9fa37697..d4628e54f7a 100644 --- a/sys/dev/ic/sti.c +++ b/sys/dev/ic/sti.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sti.c,v 1.81 2021/04/29 15:12:14 kettenis Exp $ */ +/* $OpenBSD: sti.c,v 1.82 2022/07/15 17:57:26 kettenis Exp $ */ /* * Copyright (c) 2000-2003 Michael Shalayeff @@ -1114,6 +1114,11 @@ sti_ioctl(void *v, u_long cmd, caddr_t data, int flag, struct proc *p) wdf->height = scr->scr_cfg.scr_height; wdf->width = scr->scr_cfg.scr_width; wdf->depth = scr->scr_bpp; + if (scr->scr_bpp > 8) + wdf->stride = scr->sc_cfg.fb_width * 4; + else + wdf->stride = src->sc_cfg.fb_width; + wdf->offset = 0; if (scr->putcmap == NULL || scr->scr_bpp > 8) wdf->cmsize = 0; else |