diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2013-10-20 10:43:49 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2013-10-20 10:43:49 +0000 |
commit | 5d95e5679b62bf050ffb3997ec86ef7f5f611b9a (patch) | |
tree | 2eb6f4290eb04bb922c7f4a0ba26dac831c519e7 | |
parent | 95c7a7e8448aceffb1dc9ab5854db4252b367b90 (diff) |
WSDISPLAYIO_GTYPE ioctl support for KMS drivers. ok jsg@
-rw-r--r-- | sbin/wsconsctl/util.c | 5 | ||||
-rw-r--r-- | sys/dev/pci/drm/i915/i915_drv.c | 5 | ||||
-rw-r--r-- | sys/dev/pci/drm/radeon/radeon_kms.c | 10 | ||||
-rw-r--r-- | sys/dev/wscons/wsconsio.h | 3 |
4 files changed, 17 insertions, 6 deletions
diff --git a/sbin/wsconsctl/util.c b/sbin/wsconsctl/util.c index 33b415d364d..b8ab5153286 100644 --- a/sbin/wsconsctl/util.c +++ b/sbin/wsconsctl/util.c @@ -1,4 +1,4 @@ -/* $OpenBSD: util.c,v 1.59 2012/10/29 11:56:19 stsp Exp $ */ +/* $OpenBSD: util.c,v 1.60 2013/10/20 10:43:47 miod Exp $ */ /* $NetBSD: util.c,v 1.8 2000/03/14 08:11:53 sato Exp $ */ /*- @@ -164,7 +164,8 @@ static const struct nameint dpytype_tab[] = { { WSDISPLAY_TYPE_IMPACT, "impact" }, { WSDISPLAY_TYPE_GRTWO, "grtwo" }, { WSDISPLAY_TYPE_NEWPORT, "newport" }, - { WSDISPLAY_TYPE_LIGHT, "light" } + { WSDISPLAY_TYPE_LIGHT, "light" }, + { WSDISPLAY_TYPE_KMS, "kms" } }; static const struct nameint kbdenc_tab[] = { diff --git a/sys/dev/pci/drm/i915/i915_drv.c b/sys/dev/pci/drm/i915/i915_drv.c index 153239999f6..ad82c1a96bb 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.39 2013/09/30 06:47:48 jsg Exp $ */ +/* $OpenBSD: i915_drv.c,v 1.40 2013/10/20 10:43:47 miod Exp $ */ /* * Copyright (c) 2008-2009 Owain G. Ainsworth <oga@openbsd.org> * @@ -630,6 +630,9 @@ inteldrm_wsioctl(void *v, u_long cmd, caddr_t data, int flag, struct proc *p) extern u32 _intel_panel_get_max_backlight(struct drm_device *); switch (cmd) { + case WSDISPLAYIO_GTYPE: + *(int *)data = WSDISPLAY_TYPE_KMS; + return 0; case WSDISPLAYIO_GETPARAM: if (ws_get_param && ws_get_param(dp) == 0) return 0; diff --git a/sys/dev/pci/drm/radeon/radeon_kms.c b/sys/dev/pci/drm/radeon/radeon_kms.c index 8f81216616d..3e876a9645f 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.7 2013/10/18 14:35:20 deraadt Exp $ */ +/* $OpenBSD: radeon_kms.c,v 1.8 2013/10/20 10:43:48 miod Exp $ */ /* * Copyright 2008 Advanced Micro Devices, Inc. * Copyright 2008 Red Hat Inc. @@ -331,7 +331,13 @@ struct wsdisplay_accessops radeondrm_accessops = { int radeondrm_wsioctl(void *v, u_long cmd, caddr_t data, int flag, struct proc *p) { - return (-1); + switch (cmd) { + case WSDISPLAYIO_GTYPE: + *(int *)data = WSDISPLAY_TYPE_KMS; + return 0; + default: + return -1; + } } paddr_t diff --git a/sys/dev/wscons/wsconsio.h b/sys/dev/wscons/wsconsio.h index ab0b22ca79f..d56fb039dea 100644 --- a/sys/dev/wscons/wsconsio.h +++ b/sys/dev/wscons/wsconsio.h @@ -1,4 +1,4 @@ -/* $OpenBSD: wsconsio.h,v 1.67 2012/10/29 11:54:45 stsp Exp $ */ +/* $OpenBSD: wsconsio.h,v 1.68 2013/10/20 10:43:48 miod Exp $ */ /* $NetBSD: wsconsio.h,v 1.74 2005/04/28 07:15:44 martin Exp $ */ /* @@ -327,6 +327,7 @@ struct wsmouse_calibcoords { #define WSDISPLAY_TYPE_GRTWO 66 /* SGI GR2 */ #define WSDISPLAY_TYPE_NEWPORT 67 /* SGI Newport */ #define WSDISPLAY_TYPE_LIGHT 68 /* SGI Light */ +#define WSDISPLAY_TYPE_KMS 69 /* KMS framebuffer */ /* Basic display information. Not applicable to all display types. */ struct wsdisplay_fbinfo { |