-/* $OpenBSD: efifb.c,v 1.33 2020/07/07 02:13:13 jcs Exp $ */
+/* $OpenBSD: efifb.c,v 1.34 2022/07/15 17:57:25 kettenis Exp $ */
/*
* Copyright (c) 2015 YASUOKA Masahiko <yasuoka@yasuoka.net>
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:
-/* $OpenBSD: amdisplay.c,v 1.16 2021/10/24 17:52:27 mpi Exp $ */
+/* $OpenBSD: amdisplay.c,v 1.17 2022/07/15 17:57:25 kettenis Exp $ */
/*
* Copyright (c) 2016 Ian Sutton <ians@openbsd.org>
*
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;
break;
case WSDISPLAYIO_LINEBYTES:
-/* $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>
*
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;
-/* $OpenBSD: radeonfb.c,v 1.4 2020/05/25 09:55:48 jsg Exp $ */
+/* $OpenBSD: radeonfb.c,v 1.5 2022/07/15 17:57:26 kettenis Exp $ */
/*
* Copyright (c) 2009 Mark Kettenis.
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;
break;
case WSDISPLAYIO_LINEBYTES:
-/* $OpenBSD: sisfb.c,v 1.9 2021/03/11 11:16:58 jsg Exp $ */
+/* $OpenBSD: sisfb.c,v 1.10 2022/07/15 17:57:26 kettenis Exp $ */
/*
* Copyright (c) 2010 Miodrag Vallat.
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 = 256;
break;
case WSDISPLAYIO_LINEBYTES:
-/* $OpenBSD: smfb.c,v 1.20 2021/01/02 14:29:16 visa Exp $ */
+/* $OpenBSD: smfb.c,v 1.21 2022/07/15 17:57:26 kettenis Exp $ */
/*
* Copyright (c) 2009, 2010 Miodrag Vallat.
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;
break;
case WSDISPLAYIO_LINEBYTES:
-/* $OpenBSD: lunafb.c,v 1.28 2021/09/17 12:02:31 aoyama Exp $ */
+/* $OpenBSD: lunafb.c,v 1.29 2022/07/15 17:57:26 kettenis Exp $ */
/* $NetBSD: lunafb.c,v 1.7.6.1 2002/08/07 01:48:34 lukem Exp $ */
/*-
wsd_fbip->height = dc->dc_ht;
wsd_fbip->width = dc->dc_wid;
wsd_fbip->depth = dc->dc_depth;
+ wsd_fbip->stride = dc->dc_rowbytes;
+ wsd_fbip->offset = 8;
wsd_fbip->cmsize = dc->dc_cmsize;
#undef wsd_fbip
break;
-/* $OpenBSD: vgafb.c,v 1.62 2020/05/25 09:55:48 jsg Exp $ */
+/* $OpenBSD: vgafb.c,v 1.63 2022/07/15 17:57:26 kettenis Exp $ */
/* $NetBSD: vga.c,v 1.3 1996/12/02 22:24:54 cgd Exp $ */
/*
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 = 256;
break;
case WSDISPLAYIO_LINEBYTES:
-/* $OpenBSD: astfb.c,v 1.4 2022/04/06 18:59:27 naddy Exp $ */
+/* $OpenBSD: astfb.c,v 1.5 2022/07/15 17:57:26 kettenis Exp $ */
/*
* Copyright (c) 2020 Mark Kettenis.
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:
-/* $OpenBSD: creator.c,v 1.54 2021/10/24 17:05:03 mpi Exp $ */
+/* $OpenBSD: creator.c,v 1.55 2022/07/15 17:57:26 kettenis Exp $ */
/*
* Copyright (c) 2002 Jason L. Wright (jason@thought.net)
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:
-/* $OpenBSD: gfb.c,v 1.3 2021/10/24 17:05:03 mpi Exp $ */
+/* $OpenBSD: gfb.c,v 1.4 2022/07/15 17:57:26 kettenis Exp $ */
/*
* Copyright (c) 2009 Mark Kettenis.
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:
-/* $OpenBSD: gfxp.c,v 1.15 2021/10/24 17:05:03 mpi Exp $ */
+/* $OpenBSD: gfxp.c,v 1.16 2022/07/15 17:57:26 kettenis Exp $ */
/*
* Copyright (c) 2009 Mark Kettenis.
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;
if (sc->sc_sunfb.sf_depth == 32)
wdf->cmsize = 0;
else
-/* $OpenBSD: ifb.c,v 1.25 2021/10/24 17:05:03 mpi Exp $ */
+/* $OpenBSD: ifb.c,v 1.26 2022/07/15 17:57:26 kettenis Exp $ */
/*
* Copyright (c) 2007, 2008, 2009 Miodrag Vallat.
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:
-/* $OpenBSD: machfb.c,v 1.12 2021/10/24 17:05:03 mpi Exp $ */
+/* $OpenBSD: machfb.c,v 1.13 2022/07/15 17:57:26 kettenis Exp $ */
/*
* Copyright (c) 2009 Mark Kettenis.
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:
-/* $OpenBSD: radeonfb.c,v 1.7 2021/10/24 17:05:04 mpi Exp $ */
+/* $OpenBSD: radeonfb.c,v 1.8 2022/07/15 17:57:26 kettenis Exp $ */
/*
* Copyright (c) 2009 Mark Kettenis.
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;
if (sc->sc_sunfb.sf_depth == 32)
wdf->cmsize = 0;
else
-/* $OpenBSD: raptor.c,v 1.11 2021/10/24 17:05:04 mpi Exp $ */
+/* $OpenBSD: raptor.c,v 1.12 2022/07/15 17:57:26 kettenis Exp $ */
/*
* Copyright (c) 2009 Mark Kettenis.
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:
-/* $OpenBSD: vgafb.c,v 1.67 2021/10/24 17:05:04 mpi Exp $ */
+/* $OpenBSD: vgafb.c,v 1.68 2022/07/15 17:57:26 kettenis Exp $ */
/*
* Copyright (c) 2001 Jason L. Wright (jason@thought.net)
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_GETSUPPORTEDDEPTH:
-/* $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>
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:
-/* $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
*
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;
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:
-/* $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>
*
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:
-/* $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
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
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:
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:
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:
-/* $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 $ */
/*
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;
-/* $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
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;
}
-/* $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.
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:
-/* $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)
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:
-/* $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)
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:
-/* $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)
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:
-/* $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.
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:
-/* $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.
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:
-/* $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.
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:
-/* $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.
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:
-/* $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.
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:
-/* $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 $ */
/*
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:
-/* $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>
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:
-/* $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 $ */
/*
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) */
-/* $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 $ */
/*
{
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. */