Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F153108302
D56062.id174629.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.id174629.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 = {
@@ -190,6 +194,11 @@
if (ACPI_ID_PROBE(device_get_parent(dev), dev, spmc_ids, &name) > 0)
return (ENXIO);
+ if (device_get_unit(dev) > 0) {
+ device_printf(dev, "shouldn't have more than one SPMC");
+ return (ENXIO);
+ }
+
handle = acpi_get_handle(dev);
if (handle == NULL)
return (ENXIO);
@@ -206,8 +215,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);
}
@@ -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
Mon, Apr 20, 5:24 AM (1 h, 41 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
30673947
Default Alt Text
D56062.id174629.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