1
0
Fork 0
forked from suyu/suyu

Merge pull request #1977 from lioncash/vi-log

service/vi: Log more information where applicable
This commit is contained in:
bunnei 2019-01-02 20:36:40 -05:00 committed by GitHub
commit 7538fa4a67
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -503,10 +503,12 @@ private:
void TransactParcel(Kernel::HLERequestContext& ctx) { void TransactParcel(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp{ctx}; IPC::RequestParser rp{ctx};
u32 id = rp.Pop<u32>(); const u32 id = rp.Pop<u32>();
auto transaction = static_cast<TransactionId>(rp.Pop<u32>()); const auto transaction = static_cast<TransactionId>(rp.Pop<u32>());
u32 flags = rp.Pop<u32>(); const u32 flags = rp.Pop<u32>();
LOG_DEBUG(Service_VI, "called, transaction={:X}", static_cast<u32>(transaction));
LOG_DEBUG(Service_VI, "called. id=0x{:08X} transaction={:X}, flags=0x{:08X}", id,
static_cast<u32>(transaction), flags);
auto buffer_queue = nv_flinger->GetBufferQueue(id); auto buffer_queue = nv_flinger->GetBufferQueue(id);
@ -594,9 +596,10 @@ private:
void AdjustRefcount(Kernel::HLERequestContext& ctx) { void AdjustRefcount(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp{ctx}; IPC::RequestParser rp{ctx};
u32 id = rp.Pop<u32>(); const u32 id = rp.Pop<u32>();
s32 addval = rp.PopRaw<s32>(); const s32 addval = rp.PopRaw<s32>();
u32 type = rp.Pop<u32>(); const u32 type = rp.Pop<u32>();
LOG_WARNING(Service_VI, "(STUBBED) called id={}, addval={:08X}, type={:08X}", id, addval, LOG_WARNING(Service_VI, "(STUBBED) called id={}, addval={:08X}, type={:08X}", id, addval,
type); type);
@ -606,11 +609,12 @@ private:
void GetNativeHandle(Kernel::HLERequestContext& ctx) { void GetNativeHandle(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp{ctx}; IPC::RequestParser rp{ctx};
u32 id = rp.Pop<u32>(); const u32 id = rp.Pop<u32>();
u32 unknown = rp.Pop<u32>(); const u32 unknown = rp.Pop<u32>();
LOG_WARNING(Service_VI, "(STUBBED) called id={}, unknown={:08X}", id, unknown); LOG_WARNING(Service_VI, "(STUBBED) called id={}, unknown={:08X}", id, unknown);
auto buffer_queue = nv_flinger->GetBufferQueue(id); const auto buffer_queue = nv_flinger->GetBufferQueue(id);
// TODO(Subv): Find out what this actually is. // TODO(Subv): Find out what this actually is.
IPC::ResponseBuilder rb{ctx, 2, 1}; IPC::ResponseBuilder rb{ctx, 2, 1};
@ -675,11 +679,12 @@ public:
private: private:
void SetLayerZ(Kernel::HLERequestContext& ctx) { void SetLayerZ(Kernel::HLERequestContext& ctx) {
LOG_WARNING(Service_VI, "(STUBBED) called");
IPC::RequestParser rp{ctx}; IPC::RequestParser rp{ctx};
u64 layer_id = rp.Pop<u64>(); const u64 layer_id = rp.Pop<u64>();
u64 z_value = rp.Pop<u64>(); const u64 z_value = rp.Pop<u64>();
LOG_WARNING(Service_VI, "(STUBBED) called. layer_id=0x{:016X}, z_value=0x{:016X}", layer_id,
z_value);
IPC::ResponseBuilder rb{ctx, 2}; IPC::ResponseBuilder rb{ctx, 2};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
@ -687,8 +692,9 @@ private:
void SetLayerVisibility(Kernel::HLERequestContext& ctx) { void SetLayerVisibility(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp{ctx}; IPC::RequestParser rp{ctx};
u64 layer_id = rp.Pop<u64>(); const u64 layer_id = rp.Pop<u64>();
bool visibility = rp.Pop<bool>(); const bool visibility = rp.Pop<bool>();
LOG_WARNING(Service_VI, "(STUBBED) called, layer_id=0x{:08X}, visibility={}", layer_id, LOG_WARNING(Service_VI, "(STUBBED) called, layer_id=0x{:08X}, visibility={}", layer_id,
visibility); visibility);
@ -797,25 +803,27 @@ public:
private: private:
void CloseDisplay(Kernel::HLERequestContext& ctx) { void CloseDisplay(Kernel::HLERequestContext& ctx) {
LOG_WARNING(Service_VI, "(STUBBED) called");
IPC::RequestParser rp{ctx}; IPC::RequestParser rp{ctx};
u64 display = rp.Pop<u64>(); const u64 display = rp.Pop<u64>();
LOG_WARNING(Service_VI, "(STUBBED) called. display=0x{:016X}", display);
IPC::ResponseBuilder rb{ctx, 2}; IPC::ResponseBuilder rb{ctx, 2};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
} }
void CreateManagedLayer(Kernel::HLERequestContext& ctx) { void CreateManagedLayer(Kernel::HLERequestContext& ctx) {
LOG_WARNING(Service_VI, "(STUBBED) called");
IPC::RequestParser rp{ctx}; IPC::RequestParser rp{ctx};
u32 unknown = rp.Pop<u32>(); const u32 unknown = rp.Pop<u32>();
rp.Skip(1, false); rp.Skip(1, false);
u64 display = rp.Pop<u64>(); const u64 display = rp.Pop<u64>();
u64 aruid = rp.Pop<u64>(); const u64 aruid = rp.Pop<u64>();
u64 layer_id = nv_flinger->CreateLayer(display); LOG_WARNING(Service_VI,
"(STUBBED) called. unknown=0x{:08X}, display=0x{:016X}, aruid=0x{:016X}",
unknown, display, aruid);
const u64 layer_id = nv_flinger->CreateLayer(display);
IPC::ResponseBuilder rb{ctx, 4}; IPC::ResponseBuilder rb{ctx, 4};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
@ -823,11 +831,12 @@ private:
} }
void AddToLayerStack(Kernel::HLERequestContext& ctx) { void AddToLayerStack(Kernel::HLERequestContext& ctx) {
LOG_WARNING(Service_VI, "(STUBBED) called");
IPC::RequestParser rp{ctx}; IPC::RequestParser rp{ctx};
u32 stack = rp.Pop<u32>(); const u32 stack = rp.Pop<u32>();
u64 layer_id = rp.Pop<u64>(); const u64 layer_id = rp.Pop<u64>();
LOG_WARNING(Service_VI, "(STUBBED) called. stack=0x{:08X}, layer_id=0x{:016X}", stack,
layer_id);
IPC::ResponseBuilder rb{ctx, 2}; IPC::ResponseBuilder rb{ctx, 2};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
@ -835,8 +844,9 @@ private:
void SetLayerVisibility(Kernel::HLERequestContext& ctx) { void SetLayerVisibility(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp{ctx}; IPC::RequestParser rp{ctx};
u64 layer_id = rp.Pop<u64>(); const u64 layer_id = rp.Pop<u64>();
bool visibility = rp.Pop<bool>(); const bool visibility = rp.Pop<bool>();
LOG_WARNING(Service_VI, "(STUBBED) called, layer_id=0x{:X}, visibility={}", layer_id, LOG_WARNING(Service_VI, "(STUBBED) called, layer_id=0x{:X}, visibility={}", layer_id,
visibility); visibility);
@ -902,20 +912,20 @@ private:
} }
void CloseDisplay(Kernel::HLERequestContext& ctx) { void CloseDisplay(Kernel::HLERequestContext& ctx) {
LOG_WARNING(Service_VI, "(STUBBED) called");
IPC::RequestParser rp{ctx}; IPC::RequestParser rp{ctx};
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);
IPC::ResponseBuilder rb{ctx, 2}; IPC::ResponseBuilder rb{ctx, 2};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
} }
void GetDisplayResolution(Kernel::HLERequestContext& ctx) { void GetDisplayResolution(Kernel::HLERequestContext& ctx) {
LOG_WARNING(Service_VI, "(STUBBED) called");
IPC::RequestParser rp{ctx}; IPC::RequestParser rp{ctx};
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);
IPC::ResponseBuilder rb{ctx, 6}; IPC::ResponseBuilder rb{ctx, 6};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
@ -934,11 +944,12 @@ private:
} }
void SetLayerScalingMode(Kernel::HLERequestContext& ctx) { void SetLayerScalingMode(Kernel::HLERequestContext& ctx) {
LOG_WARNING(Service_VI, "(STUBBED) called");
IPC::RequestParser rp{ctx}; IPC::RequestParser rp{ctx};
u32 scaling_mode = rp.Pop<u32>(); const u32 scaling_mode = rp.Pop<u32>();
u64 unknown = rp.Pop<u64>(); const u64 unknown = rp.Pop<u64>();
LOG_WARNING(Service_VI, "(STUBBED) called. scaling_mode=0x{:08X}, unknown=0x{:016X}",
scaling_mode, unknown);
IPC::ResponseBuilder rb{ctx, 2}; IPC::ResponseBuilder rb{ctx, 2};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
@ -958,19 +969,19 @@ private:
} }
void OpenLayer(Kernel::HLERequestContext& ctx) { void OpenLayer(Kernel::HLERequestContext& ctx) {
LOG_DEBUG(Service_VI, "called");
IPC::RequestParser rp{ctx}; IPC::RequestParser rp{ctx};
auto name_buf = rp.PopRaw<std::array<u8, 0x40>>(); const auto name_buf = rp.PopRaw<std::array<u8, 0x40>>();
auto end = std::find(name_buf.begin(), name_buf.end(), '\0'); const auto end = std::find(name_buf.begin(), name_buf.end(), '\0');
std::string display_name(name_buf.begin(), end); const std::string display_name(name_buf.begin(), end);
u64 layer_id = rp.Pop<u64>(); const u64 layer_id = rp.Pop<u64>();
u64 aruid = rp.Pop<u64>(); const u64 aruid = rp.Pop<u64>();
u64 display_id = nv_flinger->OpenDisplay(display_name); LOG_DEBUG(Service_VI, "called. layer_id=0x{:016X}, aruid=0x{:016X}", layer_id, aruid);
u32 buffer_queue_id = nv_flinger->GetBufferQueueId(display_id, layer_id);
const u64 display_id = nv_flinger->OpenDisplay(display_name);
const u32 buffer_queue_id = nv_flinger->GetBufferQueueId(display_id, layer_id);
NativeWindow native_window{buffer_queue_id}; NativeWindow native_window{buffer_queue_id};
IPC::ResponseBuilder rb{ctx, 4}; IPC::ResponseBuilder rb{ctx, 4};
@ -979,17 +990,17 @@ private:
} }
void CreateStrayLayer(Kernel::HLERequestContext& ctx) { void CreateStrayLayer(Kernel::HLERequestContext& ctx) {
LOG_DEBUG(Service_VI, "called");
IPC::RequestParser rp{ctx}; IPC::RequestParser rp{ctx};
u32 flags = rp.Pop<u32>(); const u32 flags = rp.Pop<u32>();
rp.Pop<u32>(); // padding rp.Pop<u32>(); // padding
u64 display_id = rp.Pop<u64>(); const u64 display_id = rp.Pop<u64>();
LOG_DEBUG(Service_VI, "called. flags=0x{:08X}, display_id=0x{:016X}", flags, display_id);
// TODO(Subv): What's the difference between a Stray and a Managed layer? // TODO(Subv): What's the difference between a Stray and a Managed layer?
u64 layer_id = nv_flinger->CreateLayer(display_id); const u64 layer_id = nv_flinger->CreateLayer(display_id);
u32 buffer_queue_id = nv_flinger->GetBufferQueueId(display_id, layer_id); const u32 buffer_queue_id = nv_flinger->GetBufferQueueId(display_id, layer_id);
NativeWindow native_window{buffer_queue_id}; NativeWindow native_window{buffer_queue_id};
IPC::ResponseBuilder rb{ctx, 6}; IPC::ResponseBuilder rb{ctx, 6};
@ -999,22 +1010,22 @@ private:
} }
void DestroyStrayLayer(Kernel::HLERequestContext& ctx) { void DestroyStrayLayer(Kernel::HLERequestContext& ctx) {
LOG_WARNING(Service_VI, "(STUBBED) called");
IPC::RequestParser rp{ctx}; IPC::RequestParser rp{ctx};
u64 layer_id = rp.Pop<u64>(); const u64 layer_id = rp.Pop<u64>();
LOG_WARNING(Service_VI, "(STUBBED) called. layer_id=0x{:016X}", layer_id);
IPC::ResponseBuilder rb{ctx, 2}; IPC::ResponseBuilder rb{ctx, 2};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
} }
void GetDisplayVsyncEvent(Kernel::HLERequestContext& ctx) { void GetDisplayVsyncEvent(Kernel::HLERequestContext& ctx) {
LOG_WARNING(Service_VI, "(STUBBED) called");
IPC::RequestParser rp{ctx}; IPC::RequestParser rp{ctx};
u64 display_id = rp.Pop<u64>(); const u64 display_id = rp.Pop<u64>();
auto vsync_event = nv_flinger->GetVsyncEvent(display_id); LOG_WARNING(Service_VI, "(STUBBED) called. display_id=0x{:016X}", display_id);
const auto vsync_event = nv_flinger->GetVsyncEvent(display_id);
IPC::ResponseBuilder rb{ctx, 2, 1}; IPC::ResponseBuilder rb{ctx, 2, 1};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);