diff options
author | VonChenPlus <vonchenplus@gmail.com> | 2022-06-27 06:39:57 +0200 |
---|---|---|
committer | Fernando Sahmkow <fsahmkow27@gmail.com> | 2022-10-06 21:00:53 +0200 |
commit | 9982cff98b4db38565715cc515ea496b6195725b (patch) | |
tree | 08ac644dcb6d51b4deda281133fa31b40b7cc3d7 /src/core/hle/service/vi/display | |
parent | General: Fix clang format. (diff) | |
download | yuzu-9982cff98b4db38565715cc515ea496b6195725b.tar yuzu-9982cff98b4db38565715cc515ea496b6195725b.tar.gz yuzu-9982cff98b4db38565715cc515ea496b6195725b.tar.bz2 yuzu-9982cff98b4db38565715cc515ea496b6195725b.tar.lz yuzu-9982cff98b4db38565715cc515ea496b6195725b.tar.xz yuzu-9982cff98b4db38565715cc515ea496b6195725b.tar.zst yuzu-9982cff98b4db38565715cc515ea496b6195725b.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/service/vi/display/vi_display.cpp | 16 | ||||
-rw-r--r-- | src/core/hle/service/vi/display/vi_display.h | 7 |
2 files changed, 16 insertions, 7 deletions
diff --git a/src/core/hle/service/vi/display/vi_display.cpp b/src/core/hle/service/vi/display/vi_display.cpp index aa49aa775..288aafaaf 100644 --- a/src/core/hle/service/vi/display/vi_display.cpp +++ b/src/core/hle/service/vi/display/vi_display.cpp @@ -12,6 +12,7 @@ #include "core/hle/kernel/k_readable_event.h" #include "core/hle/kernel/k_writable_event.h" #include "core/hle/service/kernel_helpers.h" +#include "core/hle/service/nvdrv/core/container.h" #include "core/hle/service/nvflinger/buffer_item_consumer.h" #include "core/hle/service/nvflinger/buffer_queue_consumer.h" #include "core/hle/service/nvflinger/buffer_queue_core.h" @@ -29,11 +30,13 @@ struct BufferQueue { std::unique_ptr<android::BufferQueueConsumer> consumer; }; -static BufferQueue CreateBufferQueue(KernelHelpers::ServiceContext& service_context) { +static BufferQueue CreateBufferQueue(KernelHelpers::ServiceContext& service_context, + Service::Nvidia::NvCore::NvMap& nvmap) { auto buffer_queue_core = std::make_shared<android::BufferQueueCore>(); - return {buffer_queue_core, - std::make_unique<android::BufferQueueProducer>(service_context, buffer_queue_core), - std::make_unique<android::BufferQueueConsumer>(buffer_queue_core)}; + return { + buffer_queue_core, + std::make_unique<android::BufferQueueProducer>(service_context, buffer_queue_core, nvmap), + std::make_unique<android::BufferQueueConsumer>(buffer_queue_core, nvmap)}; } Display::Display(u64 id, std::string name_, @@ -74,10 +77,11 @@ void Display::SignalVSyncEvent() { vsync_event->GetWritableEvent().Signal(); } -void Display::CreateLayer(u64 layer_id, u32 binder_id) { +void Display::CreateLayer(u64 layer_id, u32 binder_id, + Service::Nvidia::NvCore::Container& nv_core) { ASSERT_MSG(layers.empty(), "Only one layer is supported per display at the moment"); - auto [core, producer, consumer] = CreateBufferQueue(service_context); + auto [core, producer, consumer] = CreateBufferQueue(service_context, nv_core.GetNvMapFile()); auto buffer_item_consumer = std::make_shared<android::BufferItemConsumer>(std::move(consumer)); buffer_item_consumer->Connect(false); diff --git a/src/core/hle/service/vi/display/vi_display.h b/src/core/hle/service/vi/display/vi_display.h index 8dbb0ef80..33d5f398c 100644 --- a/src/core/hle/service/vi/display/vi_display.h +++ b/src/core/hle/service/vi/display/vi_display.h @@ -27,6 +27,11 @@ namespace Service::NVFlinger { class HosBinderDriverServer; } +namespace Service::Nvidia::NvCore { +class Container; +class NvMap; +} // namespace Service::Nvidia::NvCore + namespace Service::VI { class Layer; @@ -93,7 +98,7 @@ public: /// @param layer_id The ID to assign to the created layer. /// @param binder_id The ID assigned to the buffer queue. /// - void CreateLayer(u64 layer_id, u32 binder_id); + void CreateLayer(u64 layer_id, u32 binder_id, Service::Nvidia::NvCore::Container& core); /// Closes and removes a layer from this display with the given ID. /// |