Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F168996866
D56062.id174408.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D56062.id174408.diff
View Options
diff --git a/sys/dev/acpica/acpi_spmc.c b/sys/dev/acpica/acpi_spmc.c
--- a/sys/dev/acpica/acpi_spmc.c
+++ b/sys/dev/acpica/acpi_spmc.c
@@ -45,6 +45,7 @@
/* Only for Microsoft DSM set. */
DSM_MODERN_ENTRY_NOTIF = 7,
DSM_MODERN_EXIT_NOTIF = 8,
+ DSM_MODERN_TURN_ON_DISPLAY = 9,
};
enum amd_dsm_index {
@@ -67,7 +68,9 @@
const char *name;
int revision;
struct uuid uuid;
+ uint64_t dsms_supported;
uint64_t dsms_expected;
+ uint64_t extra_dsms;
};
static struct dsm_set intel_dsm_set = {
@@ -107,6 +110,7 @@
(1 << DSM_DISPLAY_ON_NOTIF) | (1 << DSM_ENTRY_NOTIF) |
(1 << DSM_EXIT_NOTIF) | (1 << DSM_MODERN_ENTRY_NOTIF) |
(1 << DSM_MODERN_EXIT_NOTIF),
+ .extra_dsms = (1 << DSM_MODERN_TURN_ON_DISPLAY),
};
static struct dsm_set amd_dsm_set = {
@@ -206,8 +210,8 @@
if (sc->dsm_sets == 0)
return (ENXIO);
- device_set_descf(dev, "Low Power S0 Idle (DSM sets 0x%x)",
- sc->dsm_sets);
+ device_set_descf(dev, "System Power Management Controller "
+ "(DSM sets 0x%x)", sc->dsm_sets);
return (0);
}
@@ -217,6 +221,11 @@
{
struct acpi_spmc_softc *sc = device_get_softc(dev);
+ if (device_get_unit(dev) > 0) {
+ device_printf(dev, "shouldn't have more than one SPMC");
+ return (ENXIO);
+ }
+
sc->dev = dev;
sc->handle = acpi_get_handle(dev);
@@ -256,6 +265,8 @@
{
uint64_t dsms_supported = acpi_DSMQuery(handle,
(uint8_t *)&dsm_set->uuid, dsm_set->revision);
+ const uint64_t min_dsms = dsm_set->dsms_expected;
+ const uint64_t max_dsms = min_dsms | dsm_set->extra_dsms;
/*
* Check if DSM set supported at all. We do this by checking the
@@ -264,14 +275,19 @@
if ((dsms_supported & 1) == 0)
return;
dsms_supported &= ~1;
- if ((dsms_supported & dsm_set->dsms_expected)
- != dsm_set->dsms_expected) {
+ dsm_set->dsms_supported = dsms_supported;
+ sc->dsm_sets |= dsm_set->flag;
+
+ if ((dsms_supported & min_dsms) != min_dsms)
device_printf(sc->dev, "DSM set %s does not support expected "
"DSMs (%#" PRIx64 " vs %#" PRIx64 "). "
"Some methods may fail.\n",
- dsm_set->name, dsms_supported, dsm_set->dsms_expected);
- }
- sc->dsm_sets |= dsm_set->flag;
+ dsm_set->name, dsms_supported, min_dsms);
+
+ if ((dsms_supported & ~max_dsms) != 0)
+ device_printf(sc->dev, "DSM set %s supports more DSMs than "
+ "expected (%#" PRIx64 " vs %#" PRIx64 ").", dsm_set->name,
+ dsms_supported, max_dsms);
}
static void
@@ -596,6 +612,10 @@
acpi_spmc_run_dsm(dev, &amd_dsm_set, AMD_DSM_EXIT_NOTIF);
if ((sc->dsm_sets & DSM_SET_MS) != 0) {
acpi_spmc_run_dsm(dev, &ms_dsm_set, DSM_EXIT_NOTIF);
+ if (ms_dsm_set.dsms_supported &
+ (1 << DSM_MODERN_TURN_ON_DISPLAY))
+ acpi_spmc_run_dsm(dev, &ms_dsm_set,
+ DSM_MODERN_TURN_ON_DISPLAY);
acpi_spmc_run_dsm(dev, &ms_dsm_set, DSM_MODERN_EXIT_NOTIF);
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Sep 1, 2:26 AM (10 h, 11 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
37748843
Default Alt Text
D56062.id174408.diff (2 KB)
Attached To
Mode
D56062: acpi_spmc: Call new MS turn on display DSM
Attached
Detach File
Event Timeline
Log In to Comment