diff options
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/fdt/rkdrm.c | 4 | ||||
-rw-r--r-- | sys/dev/fdt/simplefb.c | 5 | ||||
-rw-r--r-- | sys/dev/fdt/ssdfb.c | 4 | ||||
-rw-r--r-- | sys/dev/ic/sti.c | 7 | ||||
-rw-r--r-- | sys/dev/pci/drm/amd/amdgpu/amdgpu_kms.c | 2 | ||||
-rw-r--r-- | sys/dev/pci/drm/i915/i915_drv.c | 2 | ||||
-rw-r--r-- | sys/dev/pci/drm/radeon/radeon_kms.c | 2 | ||||
-rw-r--r-- | sys/dev/pci/tga.c | 4 | ||||
-rw-r--r-- | sys/dev/pcmcia/cfxga.c | 7 | ||||
-rw-r--r-- | sys/dev/sbus/agten.c | 4 | ||||
-rw-r--r-- | sys/dev/sbus/bwtwo.c | 4 | ||||
-rw-r--r-- | sys/dev/sbus/cgsix.c | 4 | ||||
-rw-r--r-- | sys/dev/sbus/cgthree.c | 4 | ||||
-rw-r--r-- | sys/dev/sbus/cgtwelve.c | 4 | ||||
-rw-r--r-- | sys/dev/sbus/mgx.c | 4 | ||||
-rw-r--r-- | sys/dev/sbus/rfx.c | 4 | ||||
-rw-r--r-- | sys/dev/sbus/tvtwo.c | 4 | ||||
-rw-r--r-- | sys/dev/sbus/vigra.c | 4 | ||||
-rw-r--r-- | sys/dev/sbus/zx.c | 4 | ||||
-rw-r--r-- | sys/dev/usb/udl.c | 4 | ||||
-rw-r--r-- | sys/dev/wscons/wsconsio.h | 13 | ||||
-rw-r--r-- | sys/dev/wscons/wsdisplay.c | 21 |
22 files changed, 95 insertions, 20 deletions
diff --git a/sys/dev/fdt/rkdrm.c b/sys/dev/fdt/rkdrm.c index bccda1b84db..634f108277d 100644 --- a/sys/dev/fdt/rkdrm.c +++ b/sys/dev/fdt/rkdrm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rkdrm.c,v 1.13 2022/04/06 18:59:28 naddy Exp $ */ +/* $OpenBSD: rkdrm.c,v 1.14 2022/07/15 17:57:26 kettenis Exp $ */ /* $NetBSD: rk_drm.c,v 1.3 2019/12/15 01:00:58 mrg Exp $ */ /*- * Copyright (c) 2019 Jared D. McNeill <jmcneill@invisible.ca> @@ -276,6 +276,8 @@ rkdrm_wsioctl(void *v, u_long cmd, caddr_t data, int flag, struct proc *p) wdf->width = ri->ri_width; wdf->height = ri->ri_height; wdf->depth = ri->ri_depth; + wdf->stride = ri->ri_stride; + wdf->offset = 0; wdf->cmsize = 0; return 0; case WSDISPLAYIO_LINEBYTES: diff --git a/sys/dev/fdt/simplefb.c b/sys/dev/fdt/simplefb.c index 985a584f5bf..1c9d14114d0 100644 --- a/sys/dev/fdt/simplefb.c +++ b/sys/dev/fdt/simplefb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: simplefb.c,v 1.15 2022/01/09 05:42:37 jsg Exp $ */ +/* $OpenBSD: simplefb.c,v 1.16 2022/07/15 17:57:26 kettenis Exp $ */ /* * Copyright (c) 2016 Mark Kettenis * @@ -234,6 +234,7 @@ int simplefb_wsioctl(void *v, u_long cmd, caddr_t data, int flag, struct proc *p) { struct rasops_info *ri = v; + struct simplefb_softc *sc = ri->ri_hw; struct wsdisplay_param *dp = (struct wsdisplay_param *)data; struct wsdisplay_fbinfo *wdf; @@ -254,6 +255,8 @@ simplefb_wsioctl(void *v, u_long cmd, caddr_t data, int flag, struct proc *p) wdf->width = ri->ri_width; wdf->height = ri->ri_height; wdf->depth = ri->ri_depth; + wdf->stride = ri->ri_stride; + wdf->offset = sc->sc_paddr & PAGE_MASK; wdf->cmsize = 0; /* color map is unavailable */ break; case WSDISPLAYIO_LINEBYTES: diff --git a/sys/dev/fdt/ssdfb.c b/sys/dev/fdt/ssdfb.c index a457701384f..6a172850b2b 100644 --- a/sys/dev/fdt/ssdfb.c +++ b/sys/dev/fdt/ssdfb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssdfb.c,v 1.12 2021/10/24 17:52:27 mpi Exp $ */ +/* $OpenBSD: ssdfb.c,v 1.13 2022/07/15 17:57:26 kettenis Exp $ */ /* * Copyright (c) 2018 Patrick Wildt <patrick@blueri.se> * @@ -634,6 +634,8 @@ ssdfb_ioctl(void *v, u_long cmd, caddr_t data, int flag, struct proc *p) wdf->width = ri->ri_width; wdf->height = ri->ri_height; wdf->depth = ri->ri_depth; + wdf->stride = ri->ri_stride; + wdf->offset = 0; wdf->cmsize = 0; /* color map is unavailable */ break; case WSDISPLAYIO_LINEBYTES: 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 diff --git a/sys/dev/pci/drm/amd/amdgpu/amdgpu_kms.c b/sys/dev/pci/drm/amd/amdgpu/amdgpu_kms.c index 262e8fdb05b..66e36cde096 100644 --- a/sys/dev/pci/drm/amd/amdgpu/amdgpu_kms.c +++ b/sys/dev/pci/drm/amd/amdgpu/amdgpu_kms.c @@ -2015,6 +2015,8 @@ amdgpu_wsioctl(void *v, u_long cmd, caddr_t data, int flag, struct proc *p) wdf->width = ri->ri_width; wdf->height = ri->ri_height; wdf->depth = ri->ri_depth; + wdf->stride = ri->ri_stride; + wdf->offset = 0; wdf->cmsize = 0; return 0; case WSDISPLAYIO_GETPARAM: diff --git a/sys/dev/pci/drm/i915/i915_drv.c b/sys/dev/pci/drm/i915/i915_drv.c index d8d52895951..0510113caef 100644 --- a/sys/dev/pci/drm/i915/i915_drv.c +++ b/sys/dev/pci/drm/i915/i915_drv.c @@ -2104,6 +2104,8 @@ inteldrm_wsioctl(void *v, u_long cmd, caddr_t data, int flag, struct proc *p) wdf->width = ri->ri_width; wdf->height = ri->ri_height; wdf->depth = ri->ri_depth; + wdf->stride = ri->ri_stride; + wdf->offset = 0; wdf->cmsize = 0; return 0; case WSDISPLAYIO_GETPARAM: diff --git a/sys/dev/pci/drm/radeon/radeon_kms.c b/sys/dev/pci/drm/radeon/radeon_kms.c index 8d412fffb3c..75702aafd11 100644 --- a/sys/dev/pci/drm/radeon/radeon_kms.c +++ b/sys/dev/pci/drm/radeon/radeon_kms.c @@ -241,6 +241,8 @@ radeondrm_wsioctl(void *v, u_long cmd, caddr_t data, int flag, struct proc *p) wdf->width = ri->ri_width; wdf->height = ri->ri_height; wdf->depth = ri->ri_depth; + wdf->stride = ri->ri_stride; + wdf->offset = 0; wdf->cmsize = 0; return 0; case WSDISPLAYIO_GETPARAM: diff --git a/sys/dev/pci/tga.c b/sys/dev/pci/tga.c index 8711c16ab87..222fa777892 100644 --- a/sys/dev/pci/tga.c +++ b/sys/dev/pci/tga.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tga.c,v 1.42 2022/03/11 18:00:52 mpi Exp $ */ +/* $OpenBSD: tga.c,v 1.43 2022/07/15 17:57:26 kettenis Exp $ */ /* $NetBSD: tga.c,v 1.40 2002/03/13 15:05:18 ad Exp $ */ /* @@ -594,6 +594,8 @@ tga_ioctl(v, cmd, data, flag, p) wsd_fbip->height = sc->sc_dc->dc_ht; wsd_fbip->width = sc->sc_dc->dc_wid; wsd_fbip->depth = sc->sc_dc->dc_tgaconf->tgac_phys_depth; + wsd_fbip->stride = sc->sc_dc->dc_rowbytes; + wsd_fbip->offset = 0; wsd_fbip->cmsize = 1024; /* XXX ??? */ #undef wsd_fbip break; diff --git a/sys/dev/pcmcia/cfxga.c b/sys/dev/pcmcia/cfxga.c index 11f6597992b..2237db1fb55 100644 --- a/sys/dev/pcmcia/cfxga.c +++ b/sys/dev/pcmcia/cfxga.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cfxga.c,v 1.32 2022/04/06 18:59:30 naddy Exp $ */ +/* $OpenBSD: cfxga.c,v 1.33 2022/07/15 17:57:26 kettenis Exp $ */ /* * Copyright (c) 2005, 2006, Matthieu Herrb and Miodrag Vallat @@ -595,11 +595,14 @@ cfxga_ioctl(void *v, u_long cmd, caddr_t data, int flag, struct proc *p) scr = sc->sc_active; if (scr == NULL) { /* try later...after running wsconscfg to add screens */ - wdf->height = wdf->width = wdf->depth = wdf->cmsize = 0; + wdf->height = wdf->width = wdf->depth = 0; + wdf->stride = wdf->offset = wdf->cmsize = 0; } else { wdf->height = scr->scr_ri.ri_height; wdf->width = scr->scr_ri.ri_width; wdf->depth = scr->scr_ri.ri_depth; + wdf->stride = scr->scr_ri.ri_stride; + wdf->offset = 0; wdf->cmsize = scr->scr_ri.ri_depth <= 8 ? (1 << scr->scr_ri.ri_depth) : 0; } 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: diff --git a/sys/dev/usb/udl.c b/sys/dev/usb/udl.c index 0a20c09a605..008ae4bb159 100644 --- a/sys/dev/usb/udl.c +++ b/sys/dev/usb/udl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: udl.c,v 1.97 2022/01/09 05:43:00 jsg Exp $ */ +/* $OpenBSD: udl.c,v 1.98 2022/07/15 17:57:27 kettenis Exp $ */ /* * Copyright (c) 2009 Marcus Glocker <mglocker@openbsd.org> @@ -509,6 +509,8 @@ udl_ioctl(void *v, u_long cmd, caddr_t data, int flag, struct proc *p) wdf->height = sc->sc_height; wdf->width = sc->sc_width; wdf->depth = sc->sc_depth; + wdf->stride = sc->sc_width * (sc->sc_depth / 8); + wdf->offset = 0; wdf->cmsize = 0; /* XXX fill up colormap size */ break; case WSDISPLAYIO_SMODE: diff --git a/sys/dev/wscons/wsconsio.h b/sys/dev/wscons/wsconsio.h index 9a3fbb142dc..de483493360 100644 --- a/sys/dev/wscons/wsconsio.h +++ b/sys/dev/wscons/wsconsio.h @@ -1,4 +1,4 @@ -/* $OpenBSD: wsconsio.h,v 1.97 2021/03/12 23:42:50 kettenis Exp $ */ +/* $OpenBSD: wsconsio.h,v 1.98 2022/07/15 17:57:27 kettenis Exp $ */ /* $NetBSD: wsconsio.h,v 1.74 2005/04/28 07:15:44 martin Exp $ */ /* @@ -448,10 +448,21 @@ struct wsdisplay_fbinfo { u_int height; /* height in pixels */ u_int width; /* width in pixels */ u_int depth; /* bits per pixel */ + u_int stride; /* bytes per line */ + u_int offset; /* first pixel offset (bytes) */ u_int cmsize; /* color map size (entries) */ }; #define WSDISPLAYIO_GINFO _IOR('W', 65, struct wsdisplay_fbinfo) +/* Backwards compat; remove after OpenBSD 7.3 is released. */ +struct wsdisplay_ofbinfo { + u_int height; /* height in pixels */ + u_int width; /* width in pixels */ + u_int depth; /* bits per pixel */ + u_int cmsize; /* color map size (entries) */ +}; +#define WSDISPLAYIO_OGINFO _IOR('W', 65, struct wsdisplay_ofbinfo) + /* Colormap operations. Not applicable to all display types. */ struct wsdisplay_cmap { u_int index; /* first element (0 origin) */ 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. */ |