Final fixups

Removed the port assert and added asserts in libSceGnmDriver for when sceVideoOutGetBufferLabelAddress calls fail.
This commit is contained in:
Stephen Miller 2025-03-10 19:50:16 -05:00
parent 06994fa705
commit 67d9218101
2 changed files with 7 additions and 3 deletions

View File

@ -1087,7 +1087,8 @@ s32 PS4_SYSV_ABI sceGnmInsertWaitFlipDone(u32* cmdbuf, u32 size, s32 vo_handle,
} }
uintptr_t label_addr{}; uintptr_t label_addr{};
VideoOut::sceVideoOutGetBufferLabelAddress(vo_handle, &label_addr); ASSERT_MSG(VideoOut::sceVideoOutGetBufferLabelAddress(vo_handle, &label_addr) == 16,
"sceVideoOutGetBufferLabelAddress call failed");
auto* wait_reg_mem = reinterpret_cast<PM4CmdWaitRegMem*>(cmdbuf); auto* wait_reg_mem = reinterpret_cast<PM4CmdWaitRegMem*>(cmdbuf);
wait_reg_mem->header = PM4Type3Header{PM4ItOpcode::WaitRegMem, 5}; wait_reg_mem->header = PM4Type3Header{PM4ItOpcode::WaitRegMem, 5};
@ -2041,7 +2042,8 @@ static inline s32 PatchFlipRequest(u32* cmdbuf, u32 size, u32 vo_handle, u32 buf
} }
uintptr_t label_addr{}; uintptr_t label_addr{};
VideoOut::sceVideoOutGetBufferLabelAddress(vo_handle, &label_addr); ASSERT_MSG(VideoOut::sceVideoOutGetBufferLabelAddress(vo_handle, &label_addr) == 16,
"sceVideoOutGetBufferLabelAddress call failed");
// Write event to lock the VO surface // Write event to lock the VO surface
auto* write_lock = reinterpret_cast<PM4CmdWriteData*>(cmdbuf); auto* write_lock = reinterpret_cast<PM4CmdWriteData*>(cmdbuf);

View File

@ -300,7 +300,9 @@ s32 PS4_SYSV_ABI sceVideoOutGetBufferLabelAddress(s32 handle, uintptr_t* label_a
return ORBIS_VIDEO_OUT_ERROR_INVALID_ADDRESS; return ORBIS_VIDEO_OUT_ERROR_INVALID_ADDRESS;
} }
auto* port = driver->GetPort(handle); auto* port = driver->GetPort(handle);
ASSERT(port); if (!port) {
return ORBIS_VIDEO_OUT_ERROR_INVALID_HANDLE;
}
*label_addr = reinterpret_cast<uintptr_t>(port->buffer_labels.data()); *label_addr = reinterpret_cast<uintptr_t>(port->buffer_labels.data());
return 16; return 16;
} }