diff options
| author | 2019-01-29 23:30:22 -0500 | |
|---|---|---|
| committer | 2019-01-30 11:11:32 -0500 | |
| commit | 1d11def9c46dc9c81af01bc55052b51e8028126e (patch) | |
| tree | bfaee8bb24a1b4e7b73842803ee5a846a51749d7 /src/core | |
| parent | Merge pull request #2070 from ReinUsesLisp/cubearray-view (diff) | |
| download | yuzu-1d11def9c46dc9c81af01bc55052b51e8028126e.tar.gz yuzu-1d11def9c46dc9c81af01bc55052b51e8028126e.tar.xz yuzu-1d11def9c46dc9c81af01bc55052b51e8028126e.zip | |
service/nvflinger: Rename Get prefix on function to Find
This more accurately describes what the function is actually attempting
to do (it's not a simple trivial getter).
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/hle/service/nvflinger/nvflinger.cpp | 16 | ||||
| -rw-r--r-- | src/core/hle/service/nvflinger/nvflinger.h | 20 | ||||
| -rw-r--r-- | src/core/hle/service/vi/vi.cpp | 10 |
3 files changed, 23 insertions, 23 deletions
diff --git a/src/core/hle/service/nvflinger/nvflinger.cpp b/src/core/hle/service/nvflinger/nvflinger.cpp index 6db2cce41..8e2e6b670 100644 --- a/src/core/hle/service/nvflinger/nvflinger.cpp +++ b/src/core/hle/service/nvflinger/nvflinger.cpp | |||
| @@ -61,7 +61,7 @@ u64 NVFlinger::OpenDisplay(std::string_view name) { | |||
| 61 | } | 61 | } |
| 62 | 62 | ||
| 63 | u64 NVFlinger::CreateLayer(u64 display_id) { | 63 | u64 NVFlinger::CreateLayer(u64 display_id) { |
| 64 | auto& display = GetDisplay(display_id); | 64 | auto& display = FindDisplay(display_id); |
| 65 | 65 | ||
| 66 | ASSERT_MSG(display.layers.empty(), "Only one layer is supported per display at the moment"); | 66 | ASSERT_MSG(display.layers.empty(), "Only one layer is supported per display at the moment"); |
| 67 | 67 | ||
| @@ -73,16 +73,16 @@ u64 NVFlinger::CreateLayer(u64 display_id) { | |||
| 73 | return layer_id; | 73 | return layer_id; |
| 74 | } | 74 | } |
| 75 | 75 | ||
| 76 | u32 NVFlinger::GetBufferQueueId(u64 display_id, u64 layer_id) { | 76 | u32 NVFlinger::FindBufferQueueId(u64 display_id, u64 layer_id) { |
| 77 | const auto& layer = GetLayer(display_id, layer_id); | 77 | const auto& layer = FindLayer(display_id, layer_id); |
| 78 | return layer.buffer_queue->GetId(); | 78 | return layer.buffer_queue->GetId(); |
| 79 | } | 79 | } |
| 80 | 80 | ||
| 81 | Kernel::SharedPtr<Kernel::ReadableEvent> NVFlinger::GetVsyncEvent(u64 display_id) { | 81 | Kernel::SharedPtr<Kernel::ReadableEvent> NVFlinger::GetVsyncEvent(u64 display_id) { |
| 82 | return GetDisplay(display_id).vsync_event.readable; | 82 | return FindDisplay(display_id).vsync_event.readable; |
| 83 | } | 83 | } |
| 84 | 84 | ||
| 85 | std::shared_ptr<BufferQueue> NVFlinger::GetBufferQueue(u32 id) const { | 85 | std::shared_ptr<BufferQueue> NVFlinger::FindBufferQueue(u32 id) const { |
| 86 | const auto itr = std::find_if(buffer_queues.begin(), buffer_queues.end(), | 86 | const auto itr = std::find_if(buffer_queues.begin(), buffer_queues.end(), |
| 87 | [&](const auto& queue) { return queue->GetId() == id; }); | 87 | [&](const auto& queue) { return queue->GetId() == id; }); |
| 88 | 88 | ||
| @@ -90,7 +90,7 @@ std::shared_ptr<BufferQueue> NVFlinger::GetBufferQueue(u32 id) const { | |||
| 90 | return *itr; | 90 | return *itr; |
| 91 | } | 91 | } |
| 92 | 92 | ||
| 93 | Display& NVFlinger::GetDisplay(u64 display_id) { | 93 | Display& NVFlinger::FindDisplay(u64 display_id) { |
| 94 | const auto itr = std::find_if(displays.begin(), displays.end(), | 94 | const auto itr = std::find_if(displays.begin(), displays.end(), |
| 95 | [&](const Display& display) { return display.id == display_id; }); | 95 | [&](const Display& display) { return display.id == display_id; }); |
| 96 | 96 | ||
| @@ -98,8 +98,8 @@ Display& NVFlinger::GetDisplay(u64 display_id) { | |||
| 98 | return *itr; | 98 | return *itr; |
| 99 | } | 99 | } |
| 100 | 100 | ||
| 101 | Layer& NVFlinger::GetLayer(u64 display_id, u64 layer_id) { | 101 | Layer& NVFlinger::FindLayer(u64 display_id, u64 layer_id) { |
| 102 | auto& display = GetDisplay(display_id); | 102 | auto& display = FindDisplay(display_id); |
| 103 | 103 | ||
| 104 | const auto itr = std::find_if(display.layers.begin(), display.layers.end(), | 104 | const auto itr = std::find_if(display.layers.begin(), display.layers.end(), |
| 105 | [&](const Layer& layer) { return layer.id == layer_id; }); | 105 | [&](const Layer& layer) { return layer.id == layer_id; }); |
diff --git a/src/core/hle/service/nvflinger/nvflinger.h b/src/core/hle/service/nvflinger/nvflinger.h index 8f9a0a7f8..8880d8485 100644 --- a/src/core/hle/service/nvflinger/nvflinger.h +++ b/src/core/hle/service/nvflinger/nvflinger.h | |||
| @@ -57,31 +57,31 @@ public: | |||
| 57 | /// Sets the NVDrv module instance to use to send buffers to the GPU. | 57 | /// Sets the NVDrv module instance to use to send buffers to the GPU. |
| 58 | void SetNVDrvInstance(std::shared_ptr<Nvidia::Module> instance); | 58 | void SetNVDrvInstance(std::shared_ptr<Nvidia::Module> instance); |
| 59 | 59 | ||
| 60 | /// Opens the specified display and returns the id. | 60 | /// Opens the specified display and returns the ID. |
| 61 | u64 OpenDisplay(std::string_view name); | 61 | u64 OpenDisplay(std::string_view name); |
| 62 | 62 | ||
| 63 | /// Creates a layer on the specified display and returns the layer id. | 63 | /// Creates a layer on the specified display and returns the layer ID. |
| 64 | u64 CreateLayer(u64 display_id); | 64 | u64 CreateLayer(u64 display_id); |
| 65 | 65 | ||
| 66 | /// Gets the buffer queue id of the specified layer in the specified display. | 66 | /// Finds the buffer queue ID of the specified layer in the specified display. |
| 67 | u32 GetBufferQueueId(u64 display_id, u64 layer_id); | 67 | u32 FindBufferQueueId(u64 display_id, u64 layer_id); |
| 68 | 68 | ||
| 69 | /// Gets the vsync event for the specified display. | 69 | /// Gets the vsync event for the specified display. |
| 70 | Kernel::SharedPtr<Kernel::ReadableEvent> GetVsyncEvent(u64 display_id); | 70 | Kernel::SharedPtr<Kernel::ReadableEvent> GetVsyncEvent(u64 display_id); |
| 71 | 71 | ||
| 72 | /// Obtains a buffer queue identified by the id. | 72 | /// Obtains a buffer queue identified by the ID. |
| 73 | std::shared_ptr<BufferQueue> GetBufferQueue(u32 id) const; | 73 | std::shared_ptr<BufferQueue> FindBufferQueue(u32 id) const; |
| 74 | 74 | ||
| 75 | /// Performs a composition request to the emulated nvidia GPU and triggers the vsync events when | 75 | /// Performs a composition request to the emulated nvidia GPU and triggers the vsync events when |
| 76 | /// finished. | 76 | /// finished. |
| 77 | void Compose(); | 77 | void Compose(); |
| 78 | 78 | ||
| 79 | private: | 79 | private: |
| 80 | /// Returns the display identified by the specified id. | 80 | /// Finds the display identified by the specified ID. |
| 81 | Display& GetDisplay(u64 display_id); | 81 | Display& FindDisplay(u64 display_id); |
| 82 | 82 | ||
| 83 | /// Returns the layer identified by the specified id in the desired display. | 83 | /// Finds the layer identified by the specified ID in the desired display. |
| 84 | Layer& GetLayer(u64 display_id, u64 layer_id); | 84 | Layer& FindLayer(u64 display_id, u64 layer_id); |
| 85 | 85 | ||
| 86 | std::shared_ptr<Nvidia::Module> nvdrv; | 86 | std::shared_ptr<Nvidia::Module> nvdrv; |
| 87 | 87 | ||
diff --git a/src/core/hle/service/vi/vi.cpp b/src/core/hle/service/vi/vi.cpp index 0f2c25182..fe08c38f2 100644 --- a/src/core/hle/service/vi/vi.cpp +++ b/src/core/hle/service/vi/vi.cpp | |||
| @@ -524,7 +524,7 @@ private: | |||
| 524 | LOG_DEBUG(Service_VI, "called. id=0x{:08X} transaction={:X}, flags=0x{:08X}", id, | 524 | LOG_DEBUG(Service_VI, "called. id=0x{:08X} transaction={:X}, flags=0x{:08X}", id, |
| 525 | static_cast<u32>(transaction), flags); | 525 | static_cast<u32>(transaction), flags); |
| 526 | 526 | ||
| 527 | auto buffer_queue = nv_flinger->GetBufferQueue(id); | 527 | auto buffer_queue = nv_flinger->FindBufferQueue(id); |
| 528 | 528 | ||
| 529 | if (transaction == TransactionId::Connect) { | 529 | if (transaction == TransactionId::Connect) { |
| 530 | IGBPConnectRequestParcel request{ctx.ReadBuffer()}; | 530 | IGBPConnectRequestParcel request{ctx.ReadBuffer()}; |
| @@ -558,7 +558,7 @@ private: | |||
| 558 | [=](Kernel::SharedPtr<Kernel::Thread> thread, Kernel::HLERequestContext& ctx, | 558 | [=](Kernel::SharedPtr<Kernel::Thread> thread, Kernel::HLERequestContext& ctx, |
| 559 | Kernel::ThreadWakeupReason reason) { | 559 | Kernel::ThreadWakeupReason reason) { |
| 560 | // Repeat TransactParcel DequeueBuffer when a buffer is available | 560 | // Repeat TransactParcel DequeueBuffer when a buffer is available |
| 561 | auto buffer_queue = nv_flinger->GetBufferQueue(id); | 561 | auto buffer_queue = nv_flinger->FindBufferQueue(id); |
| 562 | std::optional<u32> slot = buffer_queue->DequeueBuffer(width, height); | 562 | std::optional<u32> slot = buffer_queue->DequeueBuffer(width, height); |
| 563 | ASSERT_MSG(slot != std::nullopt, "Could not dequeue buffer."); | 563 | ASSERT_MSG(slot != std::nullopt, "Could not dequeue buffer."); |
| 564 | 564 | ||
| @@ -628,7 +628,7 @@ private: | |||
| 628 | 628 | ||
| 629 | LOG_WARNING(Service_VI, "(STUBBED) called id={}, unknown={:08X}", id, unknown); | 629 | LOG_WARNING(Service_VI, "(STUBBED) called id={}, unknown={:08X}", id, unknown); |
| 630 | 630 | ||
| 631 | const auto buffer_queue = nv_flinger->GetBufferQueue(id); | 631 | const auto buffer_queue = nv_flinger->FindBufferQueue(id); |
| 632 | 632 | ||
| 633 | // TODO(Subv): Find out what this actually is. | 633 | // TODO(Subv): Find out what this actually is. |
| 634 | IPC::ResponseBuilder rb{ctx, 2, 1}; | 634 | IPC::ResponseBuilder rb{ctx, 2, 1}; |
| @@ -1044,7 +1044,7 @@ private: | |||
| 1044 | LOG_DEBUG(Service_VI, "called. layer_id=0x{:016X}, aruid=0x{:016X}", layer_id, aruid); | 1044 | LOG_DEBUG(Service_VI, "called. layer_id=0x{:016X}, aruid=0x{:016X}", layer_id, aruid); |
| 1045 | 1045 | ||
| 1046 | const u64 display_id = nv_flinger->OpenDisplay(display_name); | 1046 | const u64 display_id = nv_flinger->OpenDisplay(display_name); |
| 1047 | const u32 buffer_queue_id = nv_flinger->GetBufferQueueId(display_id, layer_id); | 1047 | const u32 buffer_queue_id = nv_flinger->FindBufferQueueId(display_id, layer_id); |
| 1048 | 1048 | ||
| 1049 | NativeWindow native_window{buffer_queue_id}; | 1049 | NativeWindow native_window{buffer_queue_id}; |
| 1050 | IPC::ResponseBuilder rb{ctx, 4}; | 1050 | IPC::ResponseBuilder rb{ctx, 4}; |
| @@ -1063,7 +1063,7 @@ private: | |||
| 1063 | // TODO(Subv): What's the difference between a Stray and a Managed layer? | 1063 | // TODO(Subv): What's the difference between a Stray and a Managed layer? |
| 1064 | 1064 | ||
| 1065 | const u64 layer_id = nv_flinger->CreateLayer(display_id); | 1065 | const u64 layer_id = nv_flinger->CreateLayer(display_id); |
| 1066 | const u32 buffer_queue_id = nv_flinger->GetBufferQueueId(display_id, layer_id); | 1066 | const u32 buffer_queue_id = nv_flinger->FindBufferQueueId(display_id, layer_id); |
| 1067 | 1067 | ||
| 1068 | NativeWindow native_window{buffer_queue_id}; | 1068 | NativeWindow native_window{buffer_queue_id}; |
| 1069 | IPC::ResponseBuilder rb{ctx, 6}; | 1069 | IPC::ResponseBuilder rb{ctx, 6}; |