[PR #415] [MERGED] video_core: CPU flip relay #1549

Closed
opened 2026-02-27 21:13:01 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/shadps4-emu/shadPS4/pull/415
Author: @psucien
Created: 8/12/2024
Status: Merged
Merged: 8/14/2024
Merged by: @psucien

Base: mainHead: videocore/cpu_flip_relay


📝 Commits (3)

  • 2beff82 video_core: cpu flip is propagated via gpu thread now
  • c94190b tentative fix for cpu flips racing
  • 01e66bb libraries: videoout: better flip status handling

📊 Changes

8 files changed (+98 additions, -33 deletions)

View changed files

📝 src/core/libraries/videoout/driver.cpp (+46 -20)
📝 src/core/libraries/videoout/driver.h (+2 -1)
📝 src/core/libraries/videoout/video_out.cpp (+4 -1)
📝 src/video_core/amdgpu/liverpool.cpp (+19 -3)
📝 src/video_core/amdgpu/liverpool.h (+11 -0)
📝 src/video_core/renderer_vulkan/renderer_vulkan.h (+8 -2)
📝 src/video_core/texture_cache/texture_cache.cpp (+5 -3)
📝 src/video_core/texture_cache/texture_cache.h (+3 -3)

📄 Description

Cherry-pick from https://github.com/shadps4-emu/shadPS4/pull/370. This PR fixes racing in flip submitted by CPU.

At the time when the CPU submits a flip request (fence for VO surface access is signaled by the GPU), it may be immediately taken into processing by the presenter thread via flip_scheduler. However, all operations made on the surface are recorded in draw_scheduler, which needs to be submitted at the time of presentation. This might not be true, as the GPU can have other work to finish before the scheduler flush. With these changes, we postpone CPU flip submission and trigger draw_scheduler flush. Then the flip is relayed into the flip queue as it was previously. This ensures the VO surface is presented in the correct state.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/shadps4-emu/shadPS4/pull/415 **Author:** [@psucien](https://github.com/psucien) **Created:** 8/12/2024 **Status:** ✅ Merged **Merged:** 8/14/2024 **Merged by:** [@psucien](https://github.com/psucien) **Base:** `main` ← **Head:** `videocore/cpu_flip_relay` --- ### 📝 Commits (3) - [`2beff82`](https://github.com/shadps4-emu/shadPS4/commit/2beff82c1bbfb7e2af397b08f9b1c6f4a585057e) video_core: cpu flip is propagated via gpu thread now - [`c94190b`](https://github.com/shadps4-emu/shadPS4/commit/c94190b69b70297387addd1926cf86075541dac9) tentative fix for cpu flips racing - [`01e66bb`](https://github.com/shadps4-emu/shadPS4/commit/01e66bb54873fa344ae10f3638a51b7783acadc2) libraries: videoout: better flip status handling ### 📊 Changes **8 files changed** (+98 additions, -33 deletions) <details> <summary>View changed files</summary> 📝 `src/core/libraries/videoout/driver.cpp` (+46 -20) 📝 `src/core/libraries/videoout/driver.h` (+2 -1) 📝 `src/core/libraries/videoout/video_out.cpp` (+4 -1) 📝 `src/video_core/amdgpu/liverpool.cpp` (+19 -3) 📝 `src/video_core/amdgpu/liverpool.h` (+11 -0) 📝 `src/video_core/renderer_vulkan/renderer_vulkan.h` (+8 -2) 📝 `src/video_core/texture_cache/texture_cache.cpp` (+5 -3) 📝 `src/video_core/texture_cache/texture_cache.h` (+3 -3) </details> ### 📄 Description Cherry-pick from https://github.com/shadps4-emu/shadPS4/pull/370. This PR fixes racing in flip submitted by CPU. At the time when the CPU submits a flip request (fence for VO surface access is signaled by the GPU), it may be immediately taken into processing by the presenter thread via `flip_scheduler`. However, all operations made on the surface are recorded in `draw_scheduler`, which needs to be submitted at the time of presentation. This might not be true, as the GPU can have other work to finish before the scheduler flush. With these changes, we postpone CPU flip submission and trigger `draw_scheduler` flush. Then the flip is relayed into the flip queue as it was previously. This ensures the VO surface is presented in the correct state. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 21:13:01 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/shadPS4#1549
No description provided.