Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions media_softlet/linux/common/os/xe/mos_bufmgr_xe.c
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,7 @@ drm_export void mos_bo_unreference_xe(struct mos_linux_bo *bo)
if (atomic_read(&bo_gem->ref_count) <= 0)
return;

if (atomic_dec_and_test(&bo_gem->ref_count))
if (atomic_add_unless(&bo_gem->ref_count, -1, 1))
{
/* release memory associated with this object */
/* Clear any left-over mappings */
Expand All @@ -811,9 +811,9 @@ drm_export void mos_bo_unreference_xe(struct mos_linux_bo *bo)
__mos_bo_mark_mmaps_incoherent_xe(bo);
}

DRMLISTDEL(&bo_gem->name_list);

mos_bo_free_xe(bo);
if (atomic_dec_and_test(&bo_gem->ref_count))
mos_bo_free_xe(bo);
}
}

Expand Down Expand Up @@ -3003,6 +3003,7 @@ mos_bo_free_xe(struct mos_linux_bo *bo)
mos_gem_bo_wait_rendering_xe(bo);

bufmgr_gem->m_lock.lock();
DRMLISTDEL(&bo_gem->name_list);

if (!bo_gem->is_userptr)
{
Expand Down