diff options
author | 2019-10-23 10:17:40 +0000 | |
---|---|---|
committer | 2019-10-23 10:17:40 +0000 | |
commit | a3f8ffed4acef7600c703b660c69f12b1f7b4c8a (patch) | |
tree | 9733f70dfb14de7b45be4a3e256ae7304d2ca754 | |
parent | store specific strings for smbios baseboard vendor, product and serial (diff) | |
download | wireguard-openbsd-a3f8ffed4acef7600c703b660c69f12b1f7b4c8a.tar.xz wireguard-openbsd-a3f8ffed4acef7600c703b660c69f12b1f7b4c8a.zip |
Use baseboard specific vendor, product and serial strings for DMI_BOARD_*
instead of using hw_vendor and hw_prod which are set from the
system information structure possibly falling back to baseboard structure.
Remove currently unused DMI_BOARD_VERSION case.
Should fix the GPD Pocket panel rotation quirk that depends on baseboard
vendor of 'AMI Corporation' while the system information vendor is
'Default string'. Reported by Alexander Shendi on bugs@.
-rw-r--r-- | sys/dev/pci/drm/drm_linux.c | 36 |
1 files changed, 32 insertions, 4 deletions
diff --git a/sys/dev/pci/drm/drm_linux.c b/sys/dev/pci/drm/drm_linux.c index dd5bf253d6b..a53230091f0 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.49 2019/08/27 11:46:07 kettenis Exp $ */ +/* $OpenBSD: drm_linux.c,v 1.50 2019/10/23 10:17:40 jsg Exp $ */ /* * Copyright (c) 2013 Jonathan Gray <jsg@openbsd.org> * Copyright (c) 2015, 2016 Mark Kettenis <kettenis@openbsd.org> @@ -352,28 +352,56 @@ timeval_to_us(const struct timeval *tv) extern char *hw_vendor, *hw_prod, *hw_ver; +#if NBIOS > 0 +extern char smbios_board_vendor[]; +extern char smbios_board_prod[]; +extern char smbios_board_serial[]; +#endif + bool dmi_match(int slot, const char *str) { switch (slot) { case DMI_SYS_VENDOR: - case DMI_BOARD_VENDOR: if (hw_vendor != NULL && !strcmp(hw_vendor, str)) return true; break; case DMI_PRODUCT_NAME: - case DMI_BOARD_NAME: if (hw_prod != NULL && !strcmp(hw_prod, str)) return true; break; case DMI_PRODUCT_VERSION: - case DMI_BOARD_VERSION: if (hw_ver != NULL && !strcmp(hw_ver, str)) return true; break; +#if NBIOS > 0 + case DMI_BOARD_VENDOR: + if (strcmp(smbios_board_vendor, str) == 0) + return true; + break; + case DMI_BOARD_NAME: + if (strcmp(smbios_board_prod, str) == 0) + return true; + break; + case DMI_BOARD_SERIAL: + if (strcmp(smbios_board_serial, str) == 0) + return true; + break; +#else + case DMI_BOARD_VENDOR: + if (hw_vendor != NULL && + !strcmp(hw_vendor, str)) + return true; + break; + case DMI_BOARD_NAME: + if (hw_prod != NULL && + !strcmp(hw_prod, str)) + return true; + break; +#endif case DMI_NONE: default: return false; |