summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/nvflinger
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2018-08-07 15:17:09 +0200
committerLioncash <mathew1800@gmail.com>2018-08-08 03:53:05 +0200
commitd378d98e2628f83fa56242ec6b53e3cce7c6bb56 (patch)
treec50db5a6d7840f493d970ba449aa7010124e9a88 /src/core/hle/service/nvflinger
parentMerge pull request #971 from DarkLordZach/mbedtls-2.12.0 (diff)
downloadyuzu-d378d98e2628f83fa56242ec6b53e3cce7c6bb56.tar
yuzu-d378d98e2628f83fa56242ec6b53e3cce7c6bb56.tar.gz
yuzu-d378d98e2628f83fa56242ec6b53e3cce7c6bb56.tar.bz2
yuzu-d378d98e2628f83fa56242ec6b53e3cce7c6bb56.tar.lz
yuzu-d378d98e2628f83fa56242ec6b53e3cce7c6bb56.tar.xz
yuzu-d378d98e2628f83fa56242ec6b53e3cce7c6bb56.tar.zst
yuzu-d378d98e2628f83fa56242ec6b53e3cce7c6bb56.zip
Diffstat (limited to 'src/core/hle/service/nvflinger')
-rw-r--r--src/core/hle/service/nvflinger/nvflinger.cpp7
-rw-r--r--src/core/hle/service/nvflinger/nvflinger.h9
2 files changed, 13 insertions, 3 deletions
diff --git a/src/core/hle/service/nvflinger/nvflinger.cpp b/src/core/hle/service/nvflinger/nvflinger.cpp
index 570aa8493..a26a5f812 100644
--- a/src/core/hle/service/nvflinger/nvflinger.cpp
+++ b/src/core/hle/service/nvflinger/nvflinger.cpp
@@ -46,6 +46,10 @@ NVFlinger::~NVFlinger() {
CoreTiming::UnscheduleEvent(composition_event, 0);
}
+void NVFlinger::SetNVDrvInstance(std::shared_ptr<Nvidia::Module> instance) {
+ nvdrv = std::move(instance);
+}
+
u64 NVFlinger::OpenDisplay(std::string_view name) {
LOG_WARNING(Service, "Opening display {}", name);
@@ -141,9 +145,6 @@ void NVFlinger::Compose() {
auto& igbp_buffer = buffer->igbp_buffer;
// Now send the buffer to the GPU for drawing.
- auto nvdrv = Nvidia::nvdrv.lock();
- ASSERT(nvdrv);
-
// TODO(Subv): Support more than just disp0. The display device selection is probably based
// on which display we're drawing (Default, Internal, External, etc)
auto nvdisp = nvdrv->GetDevice<Nvidia::Devices::nvdisp_disp0>("/dev/nvdisp_disp0");
diff --git a/src/core/hle/service/nvflinger/nvflinger.h b/src/core/hle/service/nvflinger/nvflinger.h
index 5374df175..f7112949f 100644
--- a/src/core/hle/service/nvflinger/nvflinger.h
+++ b/src/core/hle/service/nvflinger/nvflinger.h
@@ -16,6 +16,10 @@ namespace CoreTiming {
struct EventType;
}
+namespace Service::Nvidia {
+class Module;
+}
+
namespace Service::NVFlinger {
class BufferQueue;
@@ -44,6 +48,9 @@ public:
NVFlinger();
~NVFlinger();
+ /// Sets the NVDrv module instance to use to send buffers to the GPU.
+ void SetNVDrvInstance(std::shared_ptr<Nvidia::Module> instance);
+
/// Opens the specified display and returns the id.
u64 OpenDisplay(std::string_view name);
@@ -70,6 +77,8 @@ private:
/// Returns the layer identified by the specified id in the desired display.
Layer& GetLayer(u64 display_id, u64 layer_id);
+ std::shared_ptr<Nvidia::Module> nvdrv;
+
std::vector<Display> displays;
std::vector<std::shared_ptr<BufferQueue>> buffer_queues;