summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Lioncash2019-07-11 13:02:29 -0400
committerGravatar Lioncash2019-07-11 13:09:03 -0400
commitb81f6f67f50f5fd5416ca5b54f1e32536c7ece7d (patch)
tree913fec5c332f6baac3a1d831724727117a77f90f /src
parentMerge pull request #2714 from DarkLordZach/repo-sync-pipeline (diff)
downloadyuzu-b81f6f67f50f5fd5416ca5b54f1e32536c7ece7d.tar.gz
yuzu-b81f6f67f50f5fd5416ca5b54f1e32536c7ece7d.tar.xz
yuzu-b81f6f67f50f5fd5416ca5b54f1e32536c7ece7d.zip
service/am: Implement SetAutoSleepDisabled
Provides a basic implementation of SetAutoSleepDisabled. Until idle handling is implemented, this is about the best we can do. In the meantime, provide a rough documenting of specifics that occur when this function is called on actual hardware.
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/service/am/am.cpp22
-rw-r--r--src/core/hle/service/am/am.h2
2 files changed, 23 insertions, 1 deletions
diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp
index 9fdcf2965..3f2f5c7db 100644
--- a/src/core/hle/service/am/am.cpp
+++ b/src/core/hle/service/am/am.cpp
@@ -266,7 +266,7 @@ ISelfController::ISelfController(std::shared_ptr<NVFlinger::NVFlinger> nvflinger
266 {65, nullptr, "ReportUserIsActive"}, 266 {65, nullptr, "ReportUserIsActive"},
267 {66, nullptr, "GetCurrentIlluminance"}, 267 {66, nullptr, "GetCurrentIlluminance"},
268 {67, nullptr, "IsIlluminanceAvailable"}, 268 {67, nullptr, "IsIlluminanceAvailable"},
269 {68, nullptr, "SetAutoSleepDisabled"}, 269 {68, &ISelfController::SetAutoSleepDisabled, "SetAutoSleepDisabled"},
270 {69, nullptr, "IsAutoSleepDisabled"}, 270 {69, nullptr, "IsAutoSleepDisabled"},
271 {70, nullptr, "ReportMultimediaError"}, 271 {70, nullptr, "ReportMultimediaError"},
272 {71, nullptr, "GetCurrentIlluminanceEx"}, 272 {71, nullptr, "GetCurrentIlluminanceEx"},
@@ -454,6 +454,26 @@ void ISelfController::GetIdleTimeDetectionExtension(Kernel::HLERequestContext& c
454 rb.Push<u32>(idle_time_detection_extension); 454 rb.Push<u32>(idle_time_detection_extension);
455} 455}
456 456
457void ISelfController::SetAutoSleepDisabled(Kernel::HLERequestContext& ctx) {
458 IPC::RequestParser rp{ctx};
459 is_auto_sleep_disabled = rp.Pop<bool>();
460
461 // On the system itself, if the previous state of is_auto_sleep_disabled
462 // differed from the current value passed in, it'd signify the internal
463 // window manager to update (and also increment some statistics like update counts)
464 //
465 // It'd also indicate this change to an idle handling context.
466 //
467 // However, given we're emulating this behavior, most of this can be ignored
468 // and it's sufficient to simply set the member variable for querying via
469 // IsAutoSleepDisabled().
470
471 LOG_DEBUG(Service_AM, "called. is_auto_sleep_disabled={}", is_auto_sleep_disabled);
472
473 IPC::ResponseBuilder rb{ctx, 2};
474 rb.Push(RESULT_SUCCESS);
475}
476
457void ISelfController::GetAccumulatedSuspendedTickValue(Kernel::HLERequestContext& ctx) { 477void ISelfController::GetAccumulatedSuspendedTickValue(Kernel::HLERequestContext& ctx) {
458 LOG_DEBUG(Service_AM, "called."); 478 LOG_DEBUG(Service_AM, "called.");
459 479
diff --git a/src/core/hle/service/am/am.h b/src/core/hle/service/am/am.h
index 14b010164..0788e2dc0 100644
--- a/src/core/hle/service/am/am.h
+++ b/src/core/hle/service/am/am.h
@@ -133,6 +133,7 @@ private:
133 void SetHandlesRequestToDisplay(Kernel::HLERequestContext& ctx); 133 void SetHandlesRequestToDisplay(Kernel::HLERequestContext& ctx);
134 void SetIdleTimeDetectionExtension(Kernel::HLERequestContext& ctx); 134 void SetIdleTimeDetectionExtension(Kernel::HLERequestContext& ctx);
135 void GetIdleTimeDetectionExtension(Kernel::HLERequestContext& ctx); 135 void GetIdleTimeDetectionExtension(Kernel::HLERequestContext& ctx);
136 void SetAutoSleepDisabled(Kernel::HLERequestContext& ctx);
136 void GetAccumulatedSuspendedTickValue(Kernel::HLERequestContext& ctx); 137 void GetAccumulatedSuspendedTickValue(Kernel::HLERequestContext& ctx);
137 void GetAccumulatedSuspendedTickChangedEvent(Kernel::HLERequestContext& ctx); 138 void GetAccumulatedSuspendedTickChangedEvent(Kernel::HLERequestContext& ctx);
138 139
@@ -142,6 +143,7 @@ private:
142 143
143 u32 idle_time_detection_extension = 0; 144 u32 idle_time_detection_extension = 0;
144 u64 num_fatal_sections_entered = 0; 145 u64 num_fatal_sections_entered = 0;
146 bool is_auto_sleep_disabled = false;
145}; 147};
146 148
147class ICommonStateGetter final : public ServiceFramework<ICommonStateGetter> { 149class ICommonStateGetter final : public ServiceFramework<ICommonStateGetter> {