summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/vi
diff options
context:
space:
mode:
authorLiam <byteslice@airmail.cc>2024-01-22 18:40:50 +0100
committerLiam <byteslice@airmail.cc>2024-01-31 17:27:21 +0100
commita595e9e8a7a6a742481b1cd05455d3c639095413 (patch)
tree03f8dfaec328171c42b090988e93c51e8d726eda /src/core/hle/service/vi
parentrenderer_opengl: implement layer stack composition (diff)
downloadyuzu-a595e9e8a7a6a742481b1cd05455d3c639095413.tar
yuzu-a595e9e8a7a6a742481b1cd05455d3c639095413.tar.gz
yuzu-a595e9e8a7a6a742481b1cd05455d3c639095413.tar.bz2
yuzu-a595e9e8a7a6a742481b1cd05455d3c639095413.tar.lz
yuzu-a595e9e8a7a6a742481b1cd05455d3c639095413.tar.xz
yuzu-a595e9e8a7a6a742481b1cd05455d3c639095413.tar.zst
yuzu-a595e9e8a7a6a742481b1cd05455d3c639095413.zip
Diffstat (limited to 'src/core/hle/service/vi')
-rw-r--r--src/core/hle/service/vi/display/vi_display.cpp4
-rw-r--r--src/core/hle/service/vi/display/vi_display.h15
-rw-r--r--src/core/hle/service/vi/vi.cpp5
3 files changed, 18 insertions, 6 deletions
diff --git a/src/core/hle/service/vi/display/vi_display.cpp b/src/core/hle/service/vi/display/vi_display.cpp
index dab1905cc..7f2af9acc 100644
--- a/src/core/hle/service/vi/display/vi_display.cpp
+++ b/src/core/hle/service/vi/display/vi_display.cpp
@@ -16,6 +16,7 @@
#include "core/hle/service/nvnflinger/buffer_queue_consumer.h"
#include "core/hle/service/nvnflinger/buffer_queue_core.h"
#include "core/hle/service/nvnflinger/buffer_queue_producer.h"
+#include "core/hle/service/nvnflinger/hardware_composer.h"
#include "core/hle/service/nvnflinger/hos_binder_driver_server.h"
#include "core/hle/service/vi/display/vi_display.h"
#include "core/hle/service/vi/layer/vi_layer.h"
@@ -43,6 +44,7 @@ Display::Display(u64 id, std::string name_,
KernelHelpers::ServiceContext& service_context_, Core::System& system_)
: display_id{id}, name{std::move(name_)}, hos_binder_driver_server{hos_binder_driver_server_},
service_context{service_context_} {
+ hardware_composer = std::make_unique<Nvnflinger::HardwareComposer>();
vsync_event = service_context.CreateEvent(fmt::format("Display VSync Event {}", id));
}
@@ -81,8 +83,6 @@ void Display::SignalVSyncEvent() {
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, nv_core.GetNvMapFile());
auto buffer_item_consumer = std::make_shared<android::BufferItemConsumer>(std::move(consumer));
diff --git a/src/core/hle/service/vi/display/vi_display.h b/src/core/hle/service/vi/display/vi_display.h
index 8eb8a5155..220292cff 100644
--- a/src/core/hle/service/vi/display/vi_display.h
+++ b/src/core/hle/service/vi/display/vi_display.h
@@ -11,9 +11,14 @@
#include "common/common_types.h"
#include "core/hle/result.h"
+namespace Core {
+class System;
+}
+
namespace Kernel {
class KEvent;
-}
+class KReadableEvent;
+} // namespace Kernel
namespace Service::android {
class BufferQueueProducer;
@@ -24,8 +29,9 @@ class ServiceContext;
}
namespace Service::Nvnflinger {
+class HardwareComposer;
class HosBinderDriverServer;
-}
+} // namespace Service::Nvnflinger
namespace Service::Nvidia::NvCore {
class Container;
@@ -118,6 +124,10 @@ public:
///
const Layer* FindLayer(u64 layer_id) const;
+ Nvnflinger::HardwareComposer& GetComposer() const {
+ return *hardware_composer;
+ }
+
private:
u64 display_id;
std::string name;
@@ -125,6 +135,7 @@ private:
KernelHelpers::ServiceContext& service_context;
std::vector<std::unique_ptr<Layer>> layers;
+ std::unique_ptr<Nvnflinger::HardwareComposer> hardware_composer;
Kernel::KEvent* vsync_event{};
bool is_abandoned{};
};
diff --git a/src/core/hle/service/vi/vi.cpp b/src/core/hle/service/vi/vi.cpp
index 73058db9a..d508ed28c 100644
--- a/src/core/hle/service/vi/vi.cpp
+++ b/src/core/hle/service/vi/vi.cpp
@@ -195,8 +195,9 @@ private:
void GetSharedBufferMemoryHandleId(HLERequestContext& ctx) {
IPC::RequestParser rp{ctx};
const u64 buffer_id = rp.PopRaw<u64>();
+ const u64 aruid = ctx.GetPID();
- LOG_INFO(Service_VI, "called. buffer_id={:#x}", buffer_id);
+ LOG_INFO(Service_VI, "called. buffer_id={:#x}, aruid={:#x}", buffer_id, aruid);
struct OutputParameters {
s32 nvmap_handle;
@@ -206,7 +207,7 @@ private:
OutputParameters out{};
Nvnflinger::SharedMemoryPoolLayout layout{};
const auto result = nvnflinger.GetSystemBufferManager().GetSharedBufferMemoryHandleId(
- &out.size, &out.nvmap_handle, &layout, buffer_id, 0);
+ &out.size, &out.nvmap_handle, &layout, buffer_id, aruid);
ctx.WriteBuffer(&layout, sizeof(layout));