videoout: Move HDR swapchain configuration to present thread. (#3690)

This commit is contained in:
squidbus
2025-10-01 12:20:43 -07:00
committed by GitHub
parent 68fca2552f
commit 6d0b179d24
3 changed files with 14 additions and 10 deletions

View File

@@ -165,6 +165,9 @@ int VideoOutDriver::UnregisterBuffers(VideoOutPort* port, s32 attributeIndex) {
} }
void VideoOutDriver::Flip(const Request& req) { void VideoOutDriver::Flip(const Request& req) {
// Update HDR status before presenting.
presenter->SetHDR(req.port->is_hdr);
// Present the frame. // Present the frame.
presenter->Present(req.frame); presenter->Present(req.frame);

View File

@@ -34,7 +34,7 @@ struct VideoOutPort {
int flip_rate = 0; int flip_rate = 0;
int prev_index = -1; int prev_index = -1;
bool is_open = false; bool is_open = false;
bool is_mode_changing = false; // Used to prevent flip during mode change bool is_hdr = false;
s32 FindFreeGroup() const { s32 FindFreeGroup() const {
s32 index = 0; s32 index = 0;

View File

@@ -429,16 +429,17 @@ s32 PS4_SYSV_ABI sceVideoOutConfigureOutputMode_(s32 handle, u32 reserved, const
return ORBIS_VIDEO_OUT_ERROR_INVALID_VALUE; return ORBIS_VIDEO_OUT_ERROR_INVALID_VALUE;
} }
if (mode->colorimetry != OrbisVideoOutColorimetry::Any) { switch (mode->colorimetry) {
auto& game_info = Common::ElfInfo::Instance(); case OrbisVideoOutColorimetry::Any:
if (mode->colorimetry == OrbisVideoOutColorimetry::Bt2020PQ && port->is_hdr = false;
game_info.GetPSFAttributes().support_hdr) { break;
port->is_mode_changing = true; case OrbisVideoOutColorimetry::Bt2020PQ:
presenter->SetHDR(true); if (Common::ElfInfo::Instance().GetPSFAttributes().support_hdr) {
port->is_mode_changing = false; port->is_hdr = true;
} else {
return ORBIS_VIDEO_OUT_ERROR_INVALID_VALUE;
} }
break;
default:
return ORBIS_VIDEO_OUT_ERROR_INVALID_VALUE;
} }
return ORBIS_OK; return ORBIS_OK;