summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/nvnflinger/nvnflinger.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/hle/service/nvnflinger/nvnflinger.cpp')
-rw-r--r--src/core/hle/service/nvnflinger/nvnflinger.cpp32
1 files changed, 3 insertions, 29 deletions
diff --git a/src/core/hle/service/nvnflinger/nvnflinger.cpp b/src/core/hle/service/nvnflinger/nvnflinger.cpp
index 51133853c..e775a2ca8 100644
--- a/src/core/hle/service/nvnflinger/nvnflinger.cpp
+++ b/src/core/hle/service/nvnflinger/nvnflinger.cpp
@@ -18,6 +18,7 @@
#include "core/hle/service/nvnflinger/buffer_item_consumer.h"
#include "core/hle/service/nvnflinger/buffer_queue_core.h"
#include "core/hle/service/nvnflinger/fb_share_buffer_manager.h"
+#include "core/hle/service/nvnflinger/hardware_composer.h"
#include "core/hle/service/nvnflinger/hos_binder_driver_server.h"
#include "core/hle/service/nvnflinger/nvnflinger.h"
#include "core/hle/service/nvnflinger/ui/graphic_buffer.h"
@@ -279,45 +280,18 @@ void Nvnflinger::Compose() {
SCOPE_EXIT({ display.SignalVSyncEvent(); });
// Don't do anything for displays without layers.
- if (!display.HasLayers())
- continue;
-
- // TODO(Subv): Support more than 1 layer.
- VI::Layer& layer = display.GetLayer(0);
-
- android::BufferItem buffer{};
- const auto status = layer.GetConsumer().AcquireBuffer(&buffer, {}, false);
-
- if (status != android::Status::NoError) {
+ if (!display.HasLayers()) {
continue;
}
- const auto& igbp_buffer = *buffer.graphic_buffer;
-
if (!system.IsPoweredOn()) {
return; // We are likely shutting down
}
- // Now send the buffer to the GPU for drawing.
- // 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>(disp_fd);
ASSERT(nvdisp);
- Common::Rectangle<int> crop_rect{
- static_cast<int>(buffer.crop.Left()), static_cast<int>(buffer.crop.Top()),
- static_cast<int>(buffer.crop.Right()), static_cast<int>(buffer.crop.Bottom())};
-
- nvdisp->flip(igbp_buffer.BufferId(), igbp_buffer.Offset(), igbp_buffer.ExternalFormat(),
- igbp_buffer.Width(), igbp_buffer.Height(), igbp_buffer.Stride(),
- static_cast<android::BufferTransformFlags>(buffer.transform), crop_rect,
- buffer.fence.fences, buffer.fence.num_fences);
-
- MicroProfileFlip();
-
- swap_interval = buffer.swap_interval;
-
- layer.GetConsumer().ReleaseBuffer(buffer, android::Fence::NoFence());
+ swap_interval = display.GetComposer().ComposeLocked(display, *nvdisp, swap_interval);
}
}