diff options
author | 2013-10-20 10:43:47 +0000 | |
---|---|---|
committer | 2013-10-20 10:43:47 +0000 | |
commit | db13fcc888c15c46a248d7392ac41c815757a820 (patch) | |
tree | 2a8931cefde12b199b3707dffc64559d630da683 /sys | |
parent | (daddr_t) -> (u_int64_t) when multiplying ncylinders * secpercyl to (diff) | |
download | wireguard-openbsd-db13fcc888c15c46a248d7392ac41c815757a820.tar.xz wireguard-openbsd-db13fcc888c15c46a248d7392ac41c815757a820.zip |
WSDISPLAYIO_GTYPE ioctl support for KMS drivers. ok jsg@
Diffstat (limited to 'sys')
-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 |
3 files changed, 14 insertions, 4 deletions
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 { |