From b849b074427b8651410585dedbc6edcfb898bee1 Mon Sep 17 00:00:00 2001 From: psucien Date: Fri, 10 May 2024 22:58:53 +0200 Subject: [PATCH] gnm_driver: fixed a typo and fields initialization --- src/core/libraries/gnmdriver/gnmdriver.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/core/libraries/gnmdriver/gnmdriver.cpp b/src/core/libraries/gnmdriver/gnmdriver.cpp index d65d03d0..ba6142a0 100644 --- a/src/core/libraries/gnmdriver/gnmdriver.cpp +++ b/src/core/libraries/gnmdriver/gnmdriver.cpp @@ -658,8 +658,7 @@ s32 PS4_SYSV_ABI sceGnmInsertWaitFlipDone(u32* cmdbuf, u32 size, s32 vo_handle, auto* wait_reg_mem = reinterpret_cast(cmdbuf); wait_reg_mem->header = PM4Type3Header{PM4ItOpcode::WaitRegMem, 5}; - wait_reg_mem->function.Assign(PM4CmdWaitRegMem::Function::Equal); - wait_reg_mem->mem_space.Assign(PM4CmdWaitRegMem::MemSpace::Memory); + wait_reg_mem->raw = 0x13u; *reinterpret_cast(&wait_reg_mem->poll_addr_lo) = (label_addr + buf_idx * sizeof(uintptr_t)) & ~0x3ull; wait_reg_mem->ref = 0u; @@ -1285,7 +1284,7 @@ static inline s32 PatchFlipRequest(u32* cmdbuf, u32 size, u32 vo_handle, u32 buf std::array backup{}; std::memcpy(backup.data(), cmdbuf, backup.size() * sizeof(decltype(backup)::value_type)); - ASSERT_MSG(((backup[2] & 3) == 0u) || (backup[1] != PM4CmdNop::PayloadType::PrepareFlip), + ASSERT_MSG(((backup[2] & 3) == 0u) || (backup[1] != PM4CmdNop::PayloadType::PrepareFlipLabel), "Invalid flip packet"); ASSERT_MSG(buf_idx != 0xffff'ffffu, "Invalid VO buffer index"); @@ -1307,7 +1306,7 @@ static inline s32 PatchFlipRequest(u32* cmdbuf, u32 size, u32 vo_handle, u32 buf // Write event to lock the VO surface auto* write_lock = reinterpret_cast(cmdbuf); write_lock->header = PM4Type3Header{PM4ItOpcode::WriteData, 3}; - write_lock->dst_sel.Assign(5u); + write_lock->raw = 0x500u; *reinterpret_cast(&write_lock->dst_addr_lo) = (label_addr + buf_idx * sizeof(uintptr_t)) & ~0x3ull; write_lock->data[0] = 1; @@ -1325,7 +1324,7 @@ static inline s32 PatchFlipRequest(u32* cmdbuf, u32 size, u32 vo_handle, u32 buf // Write event to update label auto* write_label = reinterpret_cast(cmdbuf + 0x3b); write_label->header = PM4Type3Header{PM4ItOpcode::WriteData, 3}; - write_label->dst_sel.Assign(5u); + write_label->raw = 0x500u; write_label->dst_addr_lo = backup[2] & 0xffff'fffcu; write_label->dst_addr_hi = backup[3]; write_label->data[0] = backup[4];