From 8c3115d858464b122b927d00f5ecda3ae2c9b4e0 Mon Sep 17 00:00:00 2001 From: fcambus Date: Mon, 19 Jun 2017 11:03:30 +0000 Subject: [PATCH] Add a handler for the WSDISPLAYIO_GINFO ioctl in radeondrm, allowing to retrieve basic information about a framebuffer display. OK visa@, deraadt@ --- sys/dev/pci/drm/radeon/radeon_kms.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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; } -- 2.20.1