Skip to content

Commit

Permalink
Added variable to store the actual buffer size in xobj (#8014)
Browse files Browse the repository at this point in the history
Signed-off-by: Manoj Takasi <[email protected]>
Co-authored-by: Manoj Takasi <[email protected]>
  • Loading branch information
ManojTakasi and Manoj Takasi authored Mar 16, 2024
1 parent 7bce4d3 commit 8d0cdb9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/runtime_src/core/pcie/driver/linux/xocl/userpf/xocl_bo.c
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

0 comments on commit 8d0cdb9

Please sign in to comment.