summaryrefslogtreecommitdiff
path: root/src/core/hle
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/hle')
-rw-r--r--src/core/hle/service/nvdrv/devices/nvdisp_disp0.cpp5
-rw-r--r--src/core/hle/service/nvdrv/devices/nvdisp_disp0.h3
-rw-r--r--src/core/hle/service/nvflinger/nvflinger.cpp15
3 files changed, 8 insertions, 15 deletions
diff --git a/src/core/hle/service/nvdrv/devices/nvdisp_disp0.cpp b/src/core/hle/service/nvdrv/devices/nvdisp_disp0.cpp
index e6a976714..18c5324a9 100644
--- a/src/core/hle/service/nvdrv/devices/nvdisp_disp0.cpp
+++ b/src/core/hle/service/nvdrv/devices/nvdisp_disp0.cpp
@@ -40,7 +40,8 @@ void nvdisp_disp0::OnClose(DeviceFD fd) {}
40 40
41void nvdisp_disp0::flip(u32 buffer_handle, u32 offset, android::PixelFormat format, u32 width, 41void nvdisp_disp0::flip(u32 buffer_handle, u32 offset, android::PixelFormat format, u32 width,
42 u32 height, u32 stride, android::BufferTransformFlags transform, 42 u32 height, u32 stride, android::BufferTransformFlags transform,
43 const Common::Rectangle<int>& crop_rect) { 43 const Common::Rectangle<int>& crop_rect,
44 std::array<Service::Nvidia::NvFence, 4>& fences, u32 num_fences) {
44 const VAddr addr = nvmap.GetHandleAddress(buffer_handle); 45 const VAddr addr = nvmap.GetHandleAddress(buffer_handle);
45 LOG_TRACE(Service, 46 LOG_TRACE(Service,
46 "Drawing from address {:X} offset {:08X} Width {} Height {} Stride {} Format {}", 47 "Drawing from address {:X} offset {:08X} Width {} Height {} Stride {} Format {}",
@@ -50,7 +51,7 @@ void nvdisp_disp0::flip(u32 buffer_handle, u32 offset, android::PixelFormat form
50 stride, format, transform, crop_rect}; 51 stride, format, transform, crop_rect};
51 52
52 system.GetPerfStats().EndSystemFrame(); 53 system.GetPerfStats().EndSystemFrame();
53 system.GPU().RequestSwapBuffers(&framebuffer, nullptr, 0); 54 system.GPU().RequestSwapBuffers(&framebuffer, fences, num_fences);
54 system.SpeedLimiter().DoSpeedLimiting(system.CoreTiming().GetGlobalTimeUs()); 55 system.SpeedLimiter().DoSpeedLimiting(system.CoreTiming().GetGlobalTimeUs());
55 system.GetPerfStats().BeginSystemFrame(); 56 system.GetPerfStats().BeginSystemFrame();
56} 57}
diff --git a/src/core/hle/service/nvdrv/devices/nvdisp_disp0.h b/src/core/hle/service/nvdrv/devices/nvdisp_disp0.h
index 1ca9b2e74..04217ab12 100644
--- a/src/core/hle/service/nvdrv/devices/nvdisp_disp0.h
+++ b/src/core/hle/service/nvdrv/devices/nvdisp_disp0.h
@@ -38,7 +38,8 @@ public:
38 /// Performs a screen flip, drawing the buffer pointed to by the handle. 38 /// Performs a screen flip, drawing the buffer pointed to by the handle.
39 void flip(u32 buffer_handle, u32 offset, android::PixelFormat format, u32 width, u32 height, 39 void flip(u32 buffer_handle, u32 offset, android::PixelFormat format, u32 width, u32 height,
40 u32 stride, android::BufferTransformFlags transform, 40 u32 stride, android::BufferTransformFlags transform,
41 const Common::Rectangle<int>& crop_rect); 41 const Common::Rectangle<int>& crop_rect,
42 std::array<Service::Nvidia::NvFence, 4>& fences, u32 num_fences);
42 43
43 Kernel::KEvent* QueryEvent(u32 event_id) override; 44 Kernel::KEvent* QueryEvent(u32 event_id) override;
44 45
diff --git a/src/core/hle/service/nvflinger/nvflinger.cpp b/src/core/hle/service/nvflinger/nvflinger.cpp
index aa112021d..4658f1e8b 100644
--- a/src/core/hle/service/nvflinger/nvflinger.cpp
+++ b/src/core/hle/service/nvflinger/nvflinger.cpp
@@ -269,17 +269,6 @@ void NVFlinger::Compose() {
269 return; // We are likely shutting down 269 return; // We are likely shutting down
270 } 270 }
271 271
272 auto& syncpoint_manager = system.Host1x().GetSyncpointManager();
273 const auto& multi_fence = buffer.fence;
274 guard->unlock();
275 for (u32 fence_id = 0; fence_id < multi_fence.num_fences; fence_id++) {
276 const auto& fence = multi_fence.fences[fence_id];
277 syncpoint_manager.WaitGuest(fence.id, fence.value);
278 }
279 guard->lock();
280
281 MicroProfileFlip();
282
283 // Now send the buffer to the GPU for drawing. 272 // Now send the buffer to the GPU for drawing.
284 // TODO(Subv): Support more than just disp0. The display device selection is probably based 273 // TODO(Subv): Support more than just disp0. The display device selection is probably based
285 // on which display we're drawing (Default, Internal, External, etc) 274 // on which display we're drawing (Default, Internal, External, etc)
@@ -293,8 +282,10 @@ void NVFlinger::Compose() {
293 282
294 nvdisp->flip(igbp_buffer.BufferId(), igbp_buffer.Offset(), igbp_buffer.ExternalFormat(), 283 nvdisp->flip(igbp_buffer.BufferId(), igbp_buffer.Offset(), igbp_buffer.ExternalFormat(),
295 igbp_buffer.Width(), igbp_buffer.Height(), igbp_buffer.Stride(), 284 igbp_buffer.Width(), igbp_buffer.Height(), igbp_buffer.Stride(),
296 static_cast<android::BufferTransformFlags>(buffer.transform), crop_rect); 285 static_cast<android::BufferTransformFlags>(buffer.transform), crop_rect,
286 buffer.fence.fences, buffer.fence.num_fences);
297 287
288 MicroProfileFlip();
298 guard->lock(); 289 guard->lock();
299 290
300 swap_interval = buffer.swap_interval; 291 swap_interval = buffer.swap_interval;