summaryrefslogtreecommitdiff
path: root/sys/dev/sbus
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/dev/sbus
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/dev/sbus')
-rw-r--r--sys/dev/sbus/agten.c4
-rw-r--r--sys/dev/sbus/bwtwo.c4
-rw-r--r--sys/dev/sbus/cgsix.c4
-rw-r--r--sys/dev/sbus/cgthree.c4
-rw-r--r--sys/dev/sbus/cgtwelve.c4
-rw-r--r--sys/dev/sbus/mgx.c4
-rw-r--r--sys/dev/sbus/rfx.c4
-rw-r--r--sys/dev/sbus/tvtwo.c4
-rw-r--r--sys/dev/sbus/vigra.c4
-rw-r--r--sys/dev/sbus/zx.c4
10 files changed, 30 insertions, 10 deletions
diff --git a/sys/dev/sbus/agten.c b/sys/dev/sbus/agten.c
index 03a8fe0c79c..5fa76a2fa8c 100644
--- a/sys/dev/sbus/agten.c
+++ b/sys/dev/sbus/agten.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: agten.c,v 1.12 2022/03/13 13:34:54 mpi Exp $ */
+/* $OpenBSD: agten.c,v 1.13 2022/07/15 17:57:26 kettenis Exp $ */
/*
* Copyright (c) 2002, 2003, Miodrag Vallat.
* All rights reserved.
@@ -237,6 +237,8 @@ agten_ioctl(void *dev, u_long cmd, caddr_t data, int flags, struct proc *p)
wdf->height = sc->sc_sunfb.sf_height;
wdf->width = sc->sc_sunfb.sf_width;
wdf->depth = sc->sc_sunfb.sf_depth;
+ wdf->stride = sc->sc_sunfb.sf_linebytes;
+ wdf->offset = 0;
wdf->cmsize = (sc->sc_sunfb.sf_depth == 8) ? 256 : 0;
break;
case WSDISPLAYIO_LINEBYTES:
diff --git a/sys/dev/sbus/bwtwo.c b/sys/dev/sbus/bwtwo.c
index e81f50222b7..ef130106359 100644
--- a/sys/dev/sbus/bwtwo.c
+++ b/sys/dev/sbus/bwtwo.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bwtwo.c,v 1.20 2022/03/13 13:34:54 mpi Exp $ */
+/* $OpenBSD: bwtwo.c,v 1.21 2022/07/15 17:57:27 kettenis Exp $ */
/*
* Copyright (c) 2002 Jason L. Wright (jason@thought.net)
@@ -225,6 +225,8 @@ bwtwo_ioctl(v, cmd, data, flags, p)
wdf->height = sc->sc_sunfb.sf_height;
wdf->width = sc->sc_sunfb.sf_width;
wdf->depth = sc->sc_sunfb.sf_depth;
+ wdf->stride = sc->sc_sunfb.sf_linebytes;
+ wdf->offset = 0;
wdf->cmsize = 0;
break;
case WSDISPLAYIO_LINEBYTES:
diff --git a/sys/dev/sbus/cgsix.c b/sys/dev/sbus/cgsix.c
index 2f5adfefb3c..9b4e8e669e4 100644
--- a/sys/dev/sbus/cgsix.c
+++ b/sys/dev/sbus/cgsix.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cgsix.c,v 1.61 2022/03/13 13:34:54 mpi Exp $ */
+/* $OpenBSD: cgsix.c,v 1.62 2022/07/15 17:57:27 kettenis Exp $ */
/*
* Copyright (c) 2001 Jason L. Wright (jason@thought.net)
@@ -270,6 +270,8 @@ cgsix_ioctl(void *v, u_long cmd, caddr_t data, int flags, struct proc *p)
wdf->height = sc->sc_sunfb.sf_height;
wdf->width = sc->sc_sunfb.sf_width;
wdf->depth = sc->sc_sunfb.sf_depth;
+ wdf->stride = sc->sc_sunfb.sf_linebytes;
+ wdf->offset = 0;
wdf->cmsize = 256;
break;
case WSDISPLAYIO_LINEBYTES:
diff --git a/sys/dev/sbus/cgthree.c b/sys/dev/sbus/cgthree.c
index 000fa09c4be..612720a5c29 100644
--- a/sys/dev/sbus/cgthree.c
+++ b/sys/dev/sbus/cgthree.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cgthree.c,v 1.46 2022/03/13 13:34:54 mpi Exp $ */
+/* $OpenBSD: cgthree.c,v 1.47 2022/07/15 17:57:27 kettenis Exp $ */
/*
* Copyright (c) 2001 Jason L. Wright (jason@thought.net)
@@ -282,6 +282,8 @@ cgthree_ioctl(void *v, u_long cmd, caddr_t data, int flags, struct proc *p)
wdf->height = sc->sc_sunfb.sf_height;
wdf->width = sc->sc_sunfb.sf_width;
wdf->depth = sc->sc_sunfb.sf_depth;
+ wdf->stride = sc->sc_sunfb.sf_linebytes;
+ wdf->offset = 0;
wdf->cmsize = 256;
break;
case WSDISPLAYIO_LINEBYTES:
diff --git a/sys/dev/sbus/cgtwelve.c b/sys/dev/sbus/cgtwelve.c
index f8f61c48376..a09a46aa78d 100644
--- a/sys/dev/sbus/cgtwelve.c
+++ b/sys/dev/sbus/cgtwelve.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cgtwelve.c,v 1.11 2022/03/13 13:34:54 mpi Exp $ */
+/* $OpenBSD: cgtwelve.c,v 1.12 2022/07/15 17:57:27 kettenis Exp $ */
/*
* Copyright (c) 2002, 2003 Miodrag Vallat. All rights reserved.
@@ -279,6 +279,8 @@ cgtwelve_ioctl(void *dev, u_long cmd, caddr_t data, int flags, struct proc *p)
wdf->height = sc->sc_sunfb.sf_height;
wdf->width = sc->sc_sunfb.sf_width;
wdf->depth = 32;
+ wdf->stride = sc->sc_sunfb.sf_linebytes * 32;
+ wdf->offset = 0;
wdf->cmsize = 0;
break;
case WSDISPLAYIO_GETSUPPORTEDDEPTH:
diff --git a/sys/dev/sbus/mgx.c b/sys/dev/sbus/mgx.c
index 7c336cbd94c..bbaab80ca80 100644
--- a/sys/dev/sbus/mgx.c
+++ b/sys/dev/sbus/mgx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mgx.c,v 1.15 2022/03/13 13:34:54 mpi Exp $ */
+/* $OpenBSD: mgx.c,v 1.16 2022/07/15 17:57:27 kettenis Exp $ */
/*
* Copyright (c) 2003, Miodrag Vallat.
* All rights reserved.
@@ -359,6 +359,8 @@ mgx_ioctl(void *dev, u_long cmd, caddr_t data, int flags, struct proc *p)
wdf->height = sc->sc_sunfb.sf_height;
wdf->width = sc->sc_sunfb.sf_width;
wdf->depth = sc->sc_sunfb.sf_depth;
+ wdf->stride = sc->sc_sunfb.sf_linebytes;
+ wdf->offset = 0;
wdf->cmsize = 256;
break;
case WSDISPLAYIO_LINEBYTES:
diff --git a/sys/dev/sbus/rfx.c b/sys/dev/sbus/rfx.c
index 96b504ef1c5..8dd7844de62 100644
--- a/sys/dev/sbus/rfx.c
+++ b/sys/dev/sbus/rfx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rfx.c,v 1.14 2022/03/13 13:34:54 mpi Exp $ */
+/* $OpenBSD: rfx.c,v 1.15 2022/07/15 17:57:27 kettenis Exp $ */
/*
* Copyright (c) 2004, Miodrag Vallat.
@@ -321,6 +321,8 @@ rfx_ioctl(void *v, u_long cmd, caddr_t data, int flags, struct proc *p)
wdf->height = sc->sc_sunfb.sf_height;
wdf->width = sc->sc_sunfb.sf_width;
wdf->depth = sc->sc_sunfb.sf_depth;
+ wdf->stride = sc->sc_sunfb.sf_linebytes;
+ wdf->offset = 0;
wdf->cmsize = 256;
break;
case WSDISPLAYIO_LINEBYTES:
diff --git a/sys/dev/sbus/tvtwo.c b/sys/dev/sbus/tvtwo.c
index 4ff7dc720c2..06e26a3c113 100644
--- a/sys/dev/sbus/tvtwo.c
+++ b/sys/dev/sbus/tvtwo.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tvtwo.c,v 1.17 2022/03/13 13:34:54 mpi Exp $ */
+/* $OpenBSD: tvtwo.c,v 1.18 2022/07/15 17:57:27 kettenis Exp $ */
/*
* Copyright (c) 2003, 2006, 2008, Miodrag Vallat.
@@ -313,6 +313,8 @@ tvtwo_ioctl(void *dev, u_long cmd, caddr_t data, int flags, struct proc *p)
wdf->height = sc->sc_sunfb.sf_height;
wdf->width = sc->sc_sunfb.sf_width;
wdf->depth = 32;
+ wdf->stride = sc->sc_sunfb.sf_linebytes * 4;
+ wdf->offset = 0;
wdf->cmsize = 0;
break;
case WSDISPLAYIO_GETSUPPORTEDDEPTH:
diff --git a/sys/dev/sbus/vigra.c b/sys/dev/sbus/vigra.c
index ae6f7ffd67e..90a8394ce33 100644
--- a/sys/dev/sbus/vigra.c
+++ b/sys/dev/sbus/vigra.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vigra.c,v 1.13 2022/03/13 13:34:54 mpi Exp $ */
+/* $OpenBSD: vigra.c,v 1.14 2022/07/15 17:57:27 kettenis Exp $ */
/*
* Copyright (c) 2002, 2003, Miodrag Vallat.
@@ -330,6 +330,8 @@ vigra_ioctl(void *v, u_long cmd, caddr_t data, int flags, struct proc *p)
wdf->height = sc->sc_sunfb.sf_height;
wdf->width = sc->sc_sunfb.sf_width;
wdf->depth = sc->sc_sunfb.sf_depth;
+ wdf->stride = sc->sc_sunfb.sf_linebytes;
+ wdf->offset = 0;
wdf->cmsize = 256;
break;
case WSDISPLAYIO_LINEBYTES:
diff --git a/sys/dev/sbus/zx.c b/sys/dev/sbus/zx.c
index cfefe7ffc6a..a4969b77de5 100644
--- a/sys/dev/sbus/zx.c
+++ b/sys/dev/sbus/zx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: zx.c,v 1.23 2022/03/13 13:34:54 mpi Exp $ */
+/* $OpenBSD: zx.c,v 1.24 2022/07/15 17:57:27 kettenis Exp $ */
/* $NetBSD: zx.c,v 1.5 2002/10/02 16:52:46 thorpej Exp $ */
/*
@@ -330,6 +330,8 @@ zx_ioctl(void *dev, u_long cmd, caddr_t data, int flags, struct proc *p)
wdf->height = sc->sc_sunfb.sf_height;
wdf->width = sc->sc_sunfb.sf_width;
wdf->depth = 32;
+ wdf->stride = sc->sc_sunfb.sf_linebytes;
+ wdf->offset = 0;
wdf->cmsize = 0;
break;
case WSDISPLAYIO_GETSUPPORTEDDEPTH: