diff options
author | Frederic Cambus <fcambus@cvs.openbsd.org> | 2017-06-19 11:00:19 +0000 |
---|---|---|
committer | Frederic Cambus <fcambus@cvs.openbsd.org> | 2017-06-19 11:00:19 +0000 |
commit | 99c20a1d9cc50328c8321aa8e2fad8cc2be072f7 (patch) | |
tree | 8f5f657109a54683fc7ceeabe06030a2887e0224 /sys/dev | |
parent | 284f37662cd8c6451ed64f47ec1d16feb3b7aca7 (diff) |
Add a handler for the WSDISPLAYIO_GINFO ioctl in inteldrm, allowing
to retrieve basic information about a framebuffer display.
OK visa@, tedu@
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/pci/drm/i915/i915_drv.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/dev/pci/drm/i915/i915_drv.c b/sys/dev/pci/drm/i915/i915_drv.c index 2abba0a3579..b7447d00cfb 100644 --- a/sys/dev/pci/drm/i915/i915_drv.c +++ b/sys/dev/pci/drm/i915/i915_drv.c @@ -1,4 +1,4 @@ -/* $OpenBSD: i915_drv.c,v 1.101 2017/01/08 12:11:54 fcambus Exp $ */ +/* $OpenBSD: i915_drv.c,v 1.102 2017/06/19 11:00:18 fcambus Exp $ */ /* * Copyright (c) 2008-2009 Owain G. Ainsworth <oga@openbsd.org> * @@ -1037,12 +1037,21 @@ inteldrm_wsioctl(void *v, u_long cmd, caddr_t data, int flag, struct proc *p) { struct inteldrm_softc *dev_priv = v; struct drm_device *dev = dev_priv->dev; + struct rasops_info *ri = &dev_priv->ro; + struct wsdisplay_fbinfo *wdf; struct wsdisplay_param *dp = (struct wsdisplay_param *)data; switch (cmd) { case WSDISPLAYIO_GTYPE: *(int *)data = WSDISPLAY_TYPE_INTELDRM; return 0; + case WSDISPLAYIO_GINFO: + wdf = (struct wsdisplay_fbinfo *)data; + wdf->width = ri->ri_width; + wdf->height = ri->ri_height; + wdf->depth = ri->ri_depth; + wdf->cmsize = 0; + return 0; case WSDISPLAYIO_GETPARAM: if (ws_get_param && ws_get_param(dp) == 0) return 0; |