summaryrefslogtreecommitdiffstats
path: root/sys/dev/pci/drm/drm_linux.c
diff options
context:
space:
mode:
authorjsg <jsg@openbsd.org>2019-07-15 00:52:52 +0000
committerjsg <jsg@openbsd.org>2019-07-15 00:52:52 +0000
commitb1c2f9d13a7248a8560772a94ceeb332b50ca043 (patch)
tree644f0fda6616d182bdbe7e893124071326f6ea60 /sys/dev/pci/drm/drm_linux.c
parentstore smbios date string in globally visible var for drm (diff)
downloadwireguard-openbsd-b1c2f9d13a7248a8560772a94ceeb332b50ca043.tar.xz
wireguard-openbsd-b1c2f9d13a7248a8560772a94ceeb332b50ca043.zip
Add dmi functions used by drm_panel_orientation_quirks.c and enable
CONFIG_DMI path. ok mlarkin@ kettenis@
Diffstat (limited to 'sys/dev/pci/drm/drm_linux.c')
-rw-r--r--sys/dev/pci/drm/drm_linux.c30
1 files changed, 29 insertions, 1 deletions
diff --git a/sys/dev/pci/drm/drm_linux.c b/sys/dev/pci/drm/drm_linux.c
index 7724d827bea..b6fa9799da9 100644
--- a/sys/dev/pci/drm/drm_linux.c
+++ b/sys/dev/pci/drm/drm_linux.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: drm_linux.c,v 1.44 2019/07/12 13:56:27 solene Exp $ */
+/* $OpenBSD: drm_linux.c,v 1.45 2019/07/15 00:52:52 jsg Exp $ */
/*
* Copyright (c) 2013 Jonathan Gray <jsg@openbsd.org>
* Copyright (c) 2015, 2016 Mark Kettenis <kettenis@openbsd.org>
@@ -394,6 +394,34 @@ dmi_found(const struct dmi_system_id *dsi)
return true;
}
+const struct dmi_system_id *
+dmi_first_match(const struct dmi_system_id *sysid)
+{
+ const struct dmi_system_id *dsi;
+
+ for (dsi = sysid; dsi->matches[0].slot != 0 ; dsi++) {
+ if (dmi_found(dsi))
+ return dsi;
+ }
+
+ return NULL;
+}
+
+#ifdef CONFIG_DMI
+extern char smbios_bios_date[];
+#endif
+
+const char *
+dmi_get_system_info(int slot)
+{
+ WARN_ON(slot != DMI_BIOS_DATE);
+#ifdef CONFIG_DMI
+ if (slot == DMI_BIOS_DATE)
+ return smbios_bios_date;
+#endif
+ return NULL;
+}
+
int
dmi_check_system(const struct dmi_system_id *sysid)
{