diff options
author | Liam <byteslice@airmail.cc> | 2024-02-18 17:25:47 +0100 |
---|---|---|
committer | Liam <byteslice@airmail.cc> | 2024-02-18 17:25:52 +0100 |
commit | 940a71422e18b6305556d0efc2588a90f156ae04 (patch) | |
tree | 4750b942a3c0b56f09128721a70ab8521f5b1df4 /src/core/hle/service/nvnflinger/surface_flinger.cpp | |
parent | service: vi: Implement ListDisplayMode (diff) | |
download | yuzu-940a71422e18b6305556d0efc2588a90f156ae04.tar yuzu-940a71422e18b6305556d0efc2588a90f156ae04.tar.gz yuzu-940a71422e18b6305556d0efc2588a90f156ae04.tar.bz2 yuzu-940a71422e18b6305556d0efc2588a90f156ae04.tar.lz yuzu-940a71422e18b6305556d0efc2588a90f156ae04.tar.xz yuzu-940a71422e18b6305556d0efc2588a90f156ae04.tar.zst yuzu-940a71422e18b6305556d0efc2588a90f156ae04.zip |
Diffstat (limited to 'src/core/hle/service/nvnflinger/surface_flinger.cpp')
-rw-r--r-- | src/core/hle/service/nvnflinger/surface_flinger.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/core/hle/service/nvnflinger/surface_flinger.cpp b/src/core/hle/service/nvnflinger/surface_flinger.cpp index 0e9714a03..41a705717 100644 --- a/src/core/hle/service/nvnflinger/surface_flinger.cpp +++ b/src/core/hle/service/nvnflinger/surface_flinger.cpp @@ -33,16 +33,17 @@ void SurfaceFlinger::RemoveDisplay(u64 display_id) { std::erase_if(m_displays, [&](auto& display) { return display.id == display_id; }); } -void SurfaceFlinger::ComposeDisplay(s32* out_swap_interval, f32* out_compose_speed_scale, +bool SurfaceFlinger::ComposeDisplay(s32* out_swap_interval, f32* out_compose_speed_scale, u64 display_id) { auto* const display = this->FindDisplay(display_id); - if (!display) { - return; + if (!display || !display->HasLayers()) { + return false; } *out_swap_interval = m_composer.ComposeLocked(out_compose_speed_scale, *display, *nvdrv->GetDevice<Nvidia::Devices::nvdisp_disp0>(disp_fd)); + return true; } void SurfaceFlinger::AddLayerToDisplayStack(u64 display_id, s32 consumer_binder_id) { |