Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Decode] remove exported bo from external bo list and add more debug log #1815

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
24 changes: 16 additions & 8 deletions media_softlet/linux/common/os/xe/mos_bufmgr_xe.c
Original file line number Diff line number Diff line change
Expand Up @@ -2218,7 +2218,7 @@ __mos_context_exec_update_syncs_xe(struct mos_xe_bufmgr_gem *bufmgr_gem,
MOS_DRM_ASSERTMESSAGE("Invalid op flags(0x0) for exec bo(handle=%d)", exec_bo_gem->bo.handle);
}

if (exec_bo_gem->is_imported || exec_bo_gem->is_exported)
if (exec_bo_gem->is_imported)
{
//external bo, need to export its syncobj everytime.
int prime_fd = INVALID_HANDLE;
Expand Down Expand Up @@ -2504,34 +2504,42 @@ mos_bo_context_exec_with_sync_xe(struct mos_linux_bo **bo, int num_bo, struct mo

//import batch syncobj or its point for external bos and close syncobj created for external bo before.
uint32_t external_bo_count = external_bos.size();
int sync_file_fd = INVALID_HANDLE;
int syncfile_fd = INVALID_HANDLE;
int temp_syncobj = INVALID_HANDLE;

if (external_bo_count > 0)
{
temp_syncobj = mos_sync_syncobj_create(bufmgr_gem->fd, 0);
if (temp_syncobj > 0)
{
mos_sync_syncobj_timeline_to_binary(bufmgr_gem->fd, temp_syncobj, dep->syncobj_handle, curr_timeline, 0);
sync_file_fd = mos_sync_syncobj_handle_to_syncfile_fd(bufmgr_gem->fd, temp_syncobj);
if (mos_sync_syncobj_timeline_to_binary(bufmgr_gem->fd, temp_syncobj, dep->syncobj_handle, curr_timeline, 0))
{
MOS_DRM_ASSERTMESSAGE("Failed to transfer timeline syncobj(errno:%d): exec_queue_id = %d, timeline syncobj = %d, timeline = %ld\n",
-errno, curr_exec_queue_id, dep->syncobj_handle, curr_timeline);
}
syncfile_fd = mos_sync_syncobj_handle_to_syncfile_fd(bufmgr_gem->fd, temp_syncobj);
}
}
for (int i = 0; i < external_bo_count; i++)
{
//import syncobj for external bos
if (sync_file_fd >= 0)
if (syncfile_fd >= 0)
{
mos_sync_import_syncfile_to_external_bo(bufmgr_gem->fd, external_bos[i].prime_fd, sync_file_fd);
if (mos_sync_import_syncfile_to_external_bo(bufmgr_gem->fd, external_bos[i].prime_fd, syncfile_fd))
{
MOS_DRM_ASSERTMESSAGE("Failed to import syncfile to external bo(errno:%d): exec_queue_id = %d, external bo prime fd = %d, syncfile fd = %d\n",
-errno, curr_exec_queue_id, external_bos[i].prime_fd, syncfile_fd);
}
}
if (external_bos[i].prime_fd != INVALID_HANDLE)
{
close(external_bos[i].prime_fd);
}
mos_sync_syncobj_destroy(bufmgr_gem->fd, external_bos[i].syncobj_handle);
}
if (sync_file_fd >= 0)
if (syncfile_fd >= 0)
{
close(sync_file_fd);
close(syncfile_fd);
}
if (temp_syncobj > 0)
{
Expand Down