mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-13 18:28:35 +12:00
cellVdecClose: Followup fix to #7663
Avoid executing sys_interrupt_thread_disestablish on different ppu thread with the same ID.
This commit is contained in:
parent
9e14e835e7
commit
7e224c5585
1 changed files with 9 additions and 4 deletions
|
@ -116,7 +116,7 @@ struct vdec_context final
|
||||||
u32 frc_set{}; // Frame Rate Override
|
u32 frc_set{}; // Frame Rate Override
|
||||||
u64 next_pts{};
|
u64 next_pts{};
|
||||||
u64 next_dts{};
|
u64 next_dts{};
|
||||||
u32 ppu_tid{};
|
atomic_t<u32> ppu_tid{};
|
||||||
|
|
||||||
std::deque<vdec_frame> out;
|
std::deque<vdec_frame> out;
|
||||||
atomic_t<u32> out_max = 60;
|
atomic_t<u32> out_max = 60;
|
||||||
|
@ -202,7 +202,7 @@ struct vdec_context final
|
||||||
|
|
||||||
void exec(ppu_thread& ppu, u32 vid)
|
void exec(ppu_thread& ppu, u32 vid)
|
||||||
{
|
{
|
||||||
ppu_tid = ppu.id;
|
ppu_tid.release(ppu.id);
|
||||||
|
|
||||||
// pcmd can be nullptr
|
// pcmd can be nullptr
|
||||||
for (auto* pcmd : in_cmd)
|
for (auto* pcmd : in_cmd)
|
||||||
|
@ -687,12 +687,17 @@ error_code cellVdecClose(ppu_thread& ppu, u32 handle)
|
||||||
vdec->out_max = 0;
|
vdec->out_max = 0;
|
||||||
vdec->in_cmd.push(vdec_close);
|
vdec->in_cmd.push(vdec_close);
|
||||||
|
|
||||||
while (!atomic_storage<u32>::load(vdec->ppu_tid))
|
while (!vdec->ppu_tid)
|
||||||
{
|
{
|
||||||
thread_ctrl::wait_for(1000);
|
thread_ctrl::wait_for(1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
ppu_execute<&sys_interrupt_thread_disestablish>(ppu, vdec->ppu_tid);
|
const u32 tid = vdec->ppu_tid.exchange(-1);
|
||||||
|
|
||||||
|
if (tid != umax)
|
||||||
|
{
|
||||||
|
ppu_execute<&sys_interrupt_thread_disestablish>(ppu, tid);
|
||||||
|
}
|
||||||
|
|
||||||
if (!idm::remove_verify<vdec_context>(handle, std::move(vdec)))
|
if (!idm::remove_verify<vdec_context>(handle, std::move(vdec)))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue