summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorGravatar bunnei2015-05-26 01:14:21 -0400
committerGravatar bunnei2015-05-26 01:14:21 -0400
commit4d93c30c97c13d1aef17407fce216a48b51503e6 (patch)
tree0c42bc0466ea1cc1b5da3394463d797bbfeeb856 /src/core
parentMerge pull request #820 from Subv/creatememoryblock (diff)
parentService/GSP: Implemented ImportDisplayCaptureInfo. (diff)
downloadyuzu-4d93c30c97c13d1aef17407fce216a48b51503e6.tar.gz
yuzu-4d93c30c97c13d1aef17407fce216a48b51503e6.tar.xz
yuzu-4d93c30c97c13d1aef17407fce216a48b51503e6.zip
Merge pull request #821 from Subv/ImportDisplayCaptureInfo
Service/GSP: Implemented ImportDisplayCaptureInfo.
Diffstat (limited to 'src/core')
-rw-r--r--src/core/hle/service/gsp_gpu.cpp48
1 files changed, 47 insertions, 1 deletions
diff --git a/src/core/hle/service/gsp_gpu.cpp b/src/core/hle/service/gsp_gpu.cpp
index c56475ae4..4af168bfc 100644
--- a/src/core/hle/service/gsp_gpu.cpp
+++ b/src/core/hle/service/gsp_gpu.cpp
@@ -496,6 +496,52 @@ static void TriggerCmdReqQueue(Service::Interface* self) {
496 cmd_buff[1] = 0; // No error 496 cmd_buff[1] = 0; // No error
497} 497}
498 498
499/**
500 * GSP_GPU::ImportDisplayCaptureInfo service function
501 *
502 * Returns information about the current framebuffer state
503 *
504 * Inputs:
505 * 0: Header 0x00180000
506 * Outputs:
507 * 1: Result code
508 * 2: Left framebuffer virtual address for the main screen
509 * 3: Right framebuffer virtual address for the main screen
510 * 4: Main screen framebuffer format
511 * 5: Main screen framebuffer width
512 * 6: Left framebuffer virtual address for the bottom screen
513 * 7: Right framebuffer virtual address for the bottom screen
514 * 8: Bottom screen framebuffer format
515 * 9: Bottom screen framebuffer width
516 */
517static void ImportDisplayCaptureInfo(Service::Interface* self) {
518 u32* cmd_buff = Kernel::GetCommandBuffer();
519
520 // TODO(Subv): We're always returning the framebuffer structures for thread_id = 0,
521 // because we only support a single running application at a time.
522 // This should always return the framebuffer data that is currently displayed on the screen.
523
524 u32 thread_id = 0;
525
526 FrameBufferUpdate* top_screen = GetFrameBufferInfo(thread_id, 0);
527 FrameBufferUpdate* bottom_screen = GetFrameBufferInfo(thread_id, 1);
528
529 cmd_buff[2] = top_screen->framebuffer_info[top_screen->index].address_left;
530 cmd_buff[3] = top_screen->framebuffer_info[top_screen->index].address_right;
531 cmd_buff[4] = top_screen->framebuffer_info[top_screen->index].format;
532 cmd_buff[5] = top_screen->framebuffer_info[top_screen->index].stride;
533
534 cmd_buff[6] = bottom_screen->framebuffer_info[bottom_screen->index].address_left;
535 cmd_buff[7] = bottom_screen->framebuffer_info[bottom_screen->index].address_right;
536 cmd_buff[8] = bottom_screen->framebuffer_info[bottom_screen->index].format;
537 cmd_buff[9] = bottom_screen->framebuffer_info[bottom_screen->index].stride;
538
539 cmd_buff[1] = RESULT_SUCCESS.raw;
540
541 LOG_WARNING(Service_GSP, "called");
542}
543
544
499const Interface::FunctionInfo FunctionTable[] = { 545const Interface::FunctionInfo FunctionTable[] = {
500 {0x00010082, WriteHWRegs, "WriteHWRegs"}, 546 {0x00010082, WriteHWRegs, "WriteHWRegs"},
501 {0x00020084, WriteHWRegsWithMask, "WriteHWRegsWithMask"}, 547 {0x00020084, WriteHWRegsWithMask, "WriteHWRegsWithMask"},
@@ -520,7 +566,7 @@ const Interface::FunctionInfo FunctionTable[] = {
520 {0x00150002, nullptr, "TryAcquireRight"}, 566 {0x00150002, nullptr, "TryAcquireRight"},
521 {0x00160042, nullptr, "AcquireRight"}, 567 {0x00160042, nullptr, "AcquireRight"},
522 {0x00170000, nullptr, "ReleaseRight"}, 568 {0x00170000, nullptr, "ReleaseRight"},
523 {0x00180000, nullptr, "ImportDisplayCaptureInfo"}, 569 {0x00180000, ImportDisplayCaptureInfo, "ImportDisplayCaptureInfo"},
524 {0x00190000, nullptr, "SaveVramSysArea"}, 570 {0x00190000, nullptr, "SaveVramSysArea"},
525 {0x001A0000, nullptr, "RestoreVramSysArea"}, 571 {0x001A0000, nullptr, "RestoreVramSysArea"},
526 {0x001B0000, nullptr, "ResetGpuCore"}, 572 {0x001B0000, nullptr, "ResetGpuCore"},