Commit Graph
39 Commits
Author SHA1 Message Date
xdCloudy 947b3ba6a0 feat(libSceVideoOut): declare pending PS5 exports 2026-10-21 08:01:08 +01:00
Dean 20de55550f Merge pull request #8095 from Unkown607/fix/videoout-119hz-display-fallback
fix(libSceVideoOut): fall back to 59.94 Hz when display drops below 120 Hz
2026-10-21 14:59:25 +13:00
Dean Galvin f26445217f Merge main into pr-7690
# Conflicts:
#	docs/dev/debt/libSceHmd2.md
2026-10-20 16:54:12 +13:00
Adrià 049a826e95 Merge pull request #7786 from T3cm0/feat/videoout-hmd2-bus
feat(libSceVideoOut): answer the HMD2 bus open as the console does
2026-10-20 03:25:32 +02:00
Dean 0393728fd3 Merge pull request #7005 from TheSovietWaffle/fix/videoout-disable-sdl-wgi
fix(libSceVideoOut): add APS5_NO_WGI to turn off SDL's Windows.Gaming.Input backend
2026-10-20 11:53:01 +13:00
wsjardijn dd523997da fix(libSceVideoOut): fall back to 59.94 Hz when display drops below 120 Hz
When a title has configured 119.88 Hz output (mode 15) and the window moves
to a display below 120 Hz, the presenter fell back to std::terminate via a
require() call. Replace the abort with a graceful fallback: reset outputMode
to mode 1 (59.94 Hz), fire the output-mode event so the title is notified,
and continue presenting.

This matches the HDMI output mode renegotiation a real display change
requires: the system falls back to a compatible mode and notifies the
title, rather than terminating the process.

After the fallback:
- sceVideoOutGetOutputStatus reports refreshRate 3 (59.94 Hz)
- sceVideoOutGetResolutionStatus reports refreshRate 3
- vblanks run at 59.94 Hz (every-other-tick skip resumes)
- sceVideoOutIsOutputSupported(mode=15) returns the unsupported error
- sceVideoOutConfigureOutput(mode=15) succeeds again once the window is
  on a 120 Hz display

The console's exact behaviour when a 120 Hz display is lost has not been
measured; this fallback is recorded as unverified in the debt file.

Fixes #7877
2026-10-19 23:21:16 +02:00
battleblob1andClaude Opus 5.5 a55dc4c535 fix(libSceVideoOut): turn SDL's Windows.Gaming.Input backend off only with APS5_NO_WGI
Windows.Gaming.Input stays on by default, so racing wheels, arcade and
flight sticks, HID pads without an HIDAPI driver and Xbox One/Series
trigger rumble keep working. Hosts where it faults at
Windows.Gaming.Input.dll+0x10a84 set APS5_NO_WGI to turn it off.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 21:12:22 +03:00
T3cm0andClaude Fable 5.1 762410ced4 feat(libSceVideoOut): answer the HMD2 bus open as the console does
sceVideoOutOpen with bus type 0x20, the PS VR2 output PPSA05666 opens as
SCE_VIDEO_OUT_BUS_TYPE_HMD2_MAIN after sceHmd2ReprojectionEnableVrMode, threw
VIDEO_OUT_ERROR_INVALID_VALUE and aborted the title. The console returns that
code to a process that is not a game, with the headset connected and worn or
not, for users 255 and 0 and for a null or zeroed open parameter, so the bus
is answered that way before the other argument checks and the title carries
on with the error as its handle, as it does on the console without a headset.

The debt entry records the sequence the title follows on that handle
(RegisterBuffers2 with category 16 and 4000x2040 descriptors that point at
Hmd2 per-eye textures, ConfigureOutput and IsOutputSupported with 0x2000F, a
GPU wait on buffer 0), which a VR backend will have to model, and the test
covers the bus and the HMD output modes 0x20001 and 0x2000C to 0x20010, which
the console and this implementation answer with VIDEO_OUT_ERROR_UNKNOWN_OUTPUT_MODE
on the TV bus.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-19 02:24:36 -05:00
Adrià c8e3fcb703 Merge pull request #6507 from karanvora2599/perf/videoout-unordered-cpu-flips
perf(videoout): don't hold a flip thread's CPU flips behind queued work
2026-10-19 04:49:51 +02:00
T3cm0andClaude Fable 5.1 e191a132ab feat(libSceHmd2): return the console's display and mirroring buffer sizes
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-18 18:57:14 -05:00
Dean a62c724c38 Merge pull request #6135 from DavidSamir/fix/videoout-cursor-exports
feat(libSceVideoOut): export the hardware cursor functions as not implemented
2026-10-19 02:54:55 +13:00
Karan Vora db091f5fbb perf(videoout): don't hold a flip thread's CPU flips behind queued work
sceVideoOutSubmitFlip went through queue 0 as a one-packet command
buffer, so every CPU flip waited until the queue worker had translated
all command buffers submitted before it. The PS5 RADV WSI flips from its
own thread once the frame's fence has signaled. vkQuake keeps two frames
in flight, so by then the next frame's command buffer is already queued,
and the flip waited about 10 ms for the worker to translate it. Presents
came in pairs, about 4.7 ms and 29 ms apart. Meanwhile the title waited
in acquire for the flip to be shown, leaving the worker idle for about
7.5 ms per pair.

A CPU flip from a thread that has never submitted queue-0 work now goes
to the presenter at once, unless a command-buffer or EOP flip ahead of it
has not been reached yet. Such a thread can only know that its frame is
done by waiting for it. A flip from a thread that submits its own frames
still waits for the work submitted ahead of it, because a title that
flips without waiting for its frame relies on that order.
APS5_CPU_FLIP_IN_ORDER=1 orders every CPU flip.

vkQuake (PPSA99010) on an RTX 4060: 60 -> 72-74 presents per second,
present-interval standard deviation 12.2 -> 2.1 ms, and intervals over
25 ms 40% -> 1%.
2026-10-17 20:00:58 -04:00
pushkarreddyy 4bc8e2c683 feat(libSceVideoOut): implement color space conversion and blend space exports 2026-10-17 17:14:24 +05:30
battleblob1andClaude Opus 5.5 c2f466de53 docs(libSceVideoOut): list the disabled Windows.Gaming.Input backend in technical debt
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 13:50:42 +03:00
Adrià b1cb3ed43b Merge pull request #5991 from Get-fix/ps4/videoout-ps4-buffers
feat(libSceVideoOut): register PS4 display buffers
2026-10-17 02:44:59 +02:00
MarcZX100 931d209295 docs(debt): add PPSA26344 call-site details 2026-10-16 16:59:51 +00:00
Adrià f0a1e3443b Merge pull request #5691 from xXPBSXx/fix/video-out-flip-rate-error-v2
fix(libSceVideoOut): return VIDEO_OUT_ERROR_INVALID_VALUE for a flip rate outside 0..2
2026-10-15 14:59:01 +02:00
David 10bc2f05af docs(debt): record where the cursor functions' signatures come from 2026-10-15 02:46:21 +04:00
Get-fix 901b92c794 feat(libSceVideoOut): register PS4 display buffers
Add the PS4 functions sceVideoOutSetBufferAttribute and
sceVideoOutRegisterBuffers on top of the existing registration. The PS4
call uses the first free attribute set and returns its index. It
accepts linear A8R8G8B8_SRGB and A8B8G8R8_SRGB buffers, which map to the
PS5 B8G8R8A8 and R8G8B8A8 formats. It throws for tiled buffers, whose
PS4 layout differs from the PS5 one. Linear PS4 buffers may be 4 KiB
aligned: the OpenOrbis graphics sample places its second 1920x1080
buffer 8,294,400 bytes after the first. PS5 buffers keep the 64 KiB
rule. A handle with PS4 buffers writes the PS4 flip status (64 bytes)
and vblank status (32 bytes). Writing the 128-byte PS5 flip status into
the sample's stack structure overwrote its saved frame pointer.
2026-10-14 20:52:00 +03:00
Adrià ef4d09d22a Merge pull request #5697 from gjonn/hdr-output
feat(videoout): present PQ display buffers through an HDR10 swapchain
2026-10-14 16:27:11 +02:00
Adrià 937cd6cab2 Merge pull request #5539 from JJenkx/feat/videoout-eop-flips
feat(videoout): present reserved flips from tagged GPU completion
2026-10-14 15:04:12 +02:00
Gjon Gojcevic 4e27d8d753 fix(videoout): keep the output SDR on hosts without a monitor HDR report
A Vulkan surface can offer HDR10 formats while the display is not in
HDR (KDE Wayland with RADV lists them with the output's HDR disabled),
so on hosts other than Windows the probe now reports an SDR monitor and
HDR output stays off until an output-state signal exists. A probe test
checks that a window without a Windows monitor report reads as SDR with
an HDR10 surface.

The HDR10 present test now also changes the monitor's luminance while
presenting HDR10, and the presenter logs the HDR metadata it sets.

AI-assisted: yes
2026-10-14 08:55:18 -04:00
Adrià 8bbed135fa Merge pull request #5592 from JJenkx/feat/videoout-buffer-labels
feat(videoout): expose buffer labels and release replaced frames
2026-10-14 14:50:50 +02:00
JJenkx 8c0c449173 feat(videoout): present reserved flips from tagged GPU completion
Rebased onto main as one commit (conflicts in debt notes, Presentation.cpp includes and Submission.cpp helpers).
2026-10-14 14:22:36 +02:00
Dean Galvin 6b4d3c8ae6 Revert "fix(libSceVideoOut): export unknown Onimusha import NID" (#5608)
The export turned YNw9Xk5iNWo from an unresolved import into a stub that throws. Dreaming Sarah (PPSA02929) calls it during start-up and now aborts with "YNw9Xk5iNWo not implemented" about 2 s in. Reverting until the function is implemented.
2026-10-14 21:40:28 +13:00
hossiendehghan989 5dc7111924 fix(libSceVideoOut): export unknown Onimusha import NID 2026-10-14 20:04:08 +13:00
Gjon Gojcevic c9ba43bfb7 feat(videoout): present PQ display buffers through an HDR10 swapchain
Detect HDR output on the host: on Windows the monitor showing the window
must run in HDR10 (DXGI IDXGIOutput6), and on every host the window's
Vulkan surface must offer a 10-bit VK_COLOR_SPACE_HDR10_ST2084_EXT
swapchain with VK_EXT_swapchain_colorspace and VK_EXT_hdr_metadata. The
monitor's luminance comes from DXGI; hosts that report none get 1000
nits peak and full frame, 0 nits black.

While HDR output is available, sceVideoOutGetOutputStatus reports
dynamic range 2 and flag bit 0, sceSystemServiceGetHdrToneMapLuminance
reports the monitor's luminance, and every open port's output mode
event fires when that changes. PQ display buffers are presented
unchanged through an HDR10 swapchain with HDR metadata; any other
display buffer switches back to the SDR swapchain. Without HDR output
the PQ to SDR conversion uses the peak the title was last told as its
white level.

AI-assisted: yes
2026-10-14 02:55:21 -04:00
xXPBSXxandClaude Sonnet 5.5 76e5edcacd docs(debt): note the unverified flip rate 60 of PPSA13356
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 08:32:36 +02:00
ThatsLeo 9828710a38 feat(videoout): implement sceVideoOutGetOutputStatusWithVrr
Writes the 80-byte status described in #2746: the sceVideoOutGetOutputStatus
fields followed by zeros, with the documented codes for a null status and an
unknown handle.

(cherry picked from commit e893efad2d0a7b90243d07bf6669cc9b5f540432)
2026-10-14 16:37:40 +13:00
Dean 11b24ee816 Merge pull request #4863 from babyhuey/feat/libscevideoout-busy-open
fix(libSceVideoOut): return RESOURCE_BUSY when a bus is opened twice
2026-10-14 14:33:15 +13:00
Dean GalvinandTenith01 56d1eda2f0 docs(videoout): record disabled DirectInput controller backend
Co-authored-by: Tenith01 <102300949+Tenith01@users.noreply.github.com>
2026-10-14 13:14:15 +13:00
JJenkx d1de55fb33 test(videoout): register label modes independently of flip-master tests 2026-10-13 20:14:13 -04:00
JJenkx d946b57909 Merge current main into feat/videoout-buffer-labels 2026-10-13 11:57:53 -04:00
Mouad-Scriptz-0andClaude Fable 5.1 94087d08b0 feat(libSceVideoOut): capture the host cursor for guest mice and scale their deltas
The console's mouse reports relative motion, so the host cursor can never line
up with the cursor a title draws. While a title has a mouse open and the
window is focused the host cursor is hidden and captured, released on focus
loss or while the pad's mouse-to-stick toggle is on. Motion deltas are scaled
from the presented image's size in window units to the title's display
resolution with sub-pixel carry, so the title's cursor travels as far as the
host pointer would, on scaled desktops and letterboxed windows alike.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-13 14:05:52 +00:00
JJenkx aef1b2989c feat(videoout): expose buffer labels and release replaced frames 2026-10-12 23:13:18 -04:00
Nicolas FalesyandClaude Opus 5.5 6f284b8298 feat(libSceVideoOut): implement sceVideoOutDeleteVrrActiveStatusEvent
The NID -q-vbO859Tw, declared as sceVideoOutUnknown_q_vbO859Tw for
PPSA02530, hashes to sceVideoOutDeleteVrrActiveStatusEvent. It removes the
handle's VRR status registration from the queue like the other Delete*Event
calls, the counterpart of sceVideoOutAddVrrActiveStatusEvent.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017WeVmjnnPPKdxVTpr2Vjtw
2026-10-12 23:04:58 -04:00
babyhuey c15e9f2a37 fix(libSceVideoOut): return RESOURCE_BUSY when a bus is opened twice 2026-10-12 20:26:26 -04:00
PrintOrb b6ae7da1ed docs(videoout): preserve split debt layout after merging main 2026-10-12 14:32:58 -05:00
Adrià FranchandClaude 342a8c4590 docs(debt): move library entries to one file per library
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-12 20:38:29 +02:00