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

DRM_IOCTL_XOCL_INFO_BO returns wrong size #8014

Merged
merged 1 commit into from
Mar 16, 2024
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,7 @@ static struct drm_xocl_bo *xocl_create_bo(struct drm_device *dev,

xobj->user_flags = user_flags;
xobj->flags = bo_type;
xobj->actual_bo_size = unaligned_size;
mutex_lock(&drm_p->mm_lock);
/* Assume there is only 1 HOST bank. We ignore the memidx
* for host bank. This is required for supporting No flag
Expand Down Expand Up @@ -956,7 +957,7 @@ int xocl_info_bo_ioctl(struct drm_device *dev,
xobj = to_xocl_bo(gem_obj);
BO_ENTER("xobj %p", xobj);

args->size = xobj->base.size;
args->size = xobj->actual_bo_size;
args->flags = xobj->user_flags;

args->paddr = xocl_bo_physical_addr(xobj);
Expand Down
2 changes: 2 additions & 0 deletions src/runtime_src/core/pcie/driver/linux/xocl/xocl_drm.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ struct drm_xocl_bo {
unsigned flags;
unsigned mem_idx;
unsigned user_flags;
/* variable to store the actual bo size instead of aligned size*/
uint64_t actual_bo_size;
};

struct drm_xocl_unmgd {
Expand Down
Loading