diff options
author | Frederic Cambus <fcambus@cvs.openbsd.org> | 2017-06-19 11:03:31 +0000 |
---|---|---|
committer | Frederic Cambus <fcambus@cvs.openbsd.org> | 2017-06-19 11:03:31 +0000 |
commit | 5b55e390788ad3e139451afb2285f936dd6c6a8c (patch) | |
tree | cb8d30901840fefa8c435389ad371b697a1dedfe /sys/dev/pci/drm | |
parent | 99c20a1d9cc50328c8321aa8e2fad8cc2be072f7 (diff) |
Add a handler for the WSDISPLAYIO_GINFO ioctl in radeondrm, allowing
to retrieve basic information about a framebuffer display.
OK visa@, deraadt@
Diffstat (limited to 'sys/dev/pci/drm')
-rw-r--r-- | sys/dev/pci/drm/radeon/radeon_kms.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/sys/dev/pci/drm/radeon/radeon_kms.c b/sys/dev/pci/drm/radeon/radeon_kms.c index 89d734311a7..4b5dfd595ac 100644 --- a/sys/dev/pci/drm/radeon/radeon_kms.c +++ b/sys/dev/pci/drm/radeon/radeon_kms.c @@ -1,4 +1,4 @@ -/* $OpenBSD: radeon_kms.c,v 1.49 2017/01/08 12:11:54 fcambus Exp $ */ +/* $OpenBSD: radeon_kms.c,v 1.50 2017/06/19 11:03:30 fcambus Exp $ */ /* * Copyright 2008 Advanced Micro Devices, Inc. * Copyright 2008 Red Hat Inc. @@ -354,10 +354,20 @@ struct wsdisplay_accessops radeondrm_accessops = { int radeondrm_wsioctl(void *v, u_long cmd, caddr_t data, int flag, struct proc *p) { + struct rasops_info *ri = v; + struct wsdisplay_fbinfo *wdf; + switch (cmd) { case WSDISPLAYIO_GTYPE: *(int *)data = WSDISPLAY_TYPE_RADEONDRM; 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; default: return -1; } |