Merge pull request #1988 from lioncash/res

service/vi: Correct reported dimensions from IApplicationDisplayService's GetDisplayResolution()
This commit is contained in:
bunnei 2019-01-05 00:26:29 -05:00 committed by GitHub
commit 59c665b28e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -958,23 +958,19 @@ private:
IPC::RequestParser rp{ctx}; IPC::RequestParser rp{ctx};
const u64 display_id = rp.Pop<u64>(); const u64 display_id = rp.Pop<u64>();
LOG_WARNING(Service_VI, "(STUBBED) called. display_id=0x{:016X}", display_id); LOG_DEBUG(Service_VI, "called. display_id=0x{:016X}", display_id);
IPC::ResponseBuilder rb{ctx, 6}; IPC::ResponseBuilder rb{ctx, 6};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
if (Settings::values.use_docked_mode) { // This only returns the fixed values of 1280x720 and makes no distinguishing
rb.Push(static_cast<u64>(DisplayResolution::DockedWidth) * // between docked and undocked dimensions. We take the liberty of applying
static_cast<u32>(Settings::values.resolution_factor)); // the resolution scaling factor here.
rb.Push(static_cast<u64>(DisplayResolution::DockedHeight) *
static_cast<u32>(Settings::values.resolution_factor));
} else {
rb.Push(static_cast<u64>(DisplayResolution::UndockedWidth) * rb.Push(static_cast<u64>(DisplayResolution::UndockedWidth) *
static_cast<u32>(Settings::values.resolution_factor)); static_cast<u32>(Settings::values.resolution_factor));
rb.Push(static_cast<u64>(DisplayResolution::UndockedHeight) * rb.Push(static_cast<u64>(DisplayResolution::UndockedHeight) *
static_cast<u32>(Settings::values.resolution_factor)); static_cast<u32>(Settings::values.resolution_factor));
} }
}
void SetLayerScalingMode(Kernel::HLERequestContext& ctx) { void SetLayerScalingMode(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp{ctx}; IPC::RequestParser rp{ctx};