Skip to content

Commit

Permalink
Modified zocl_free_bo and zocl_gem_prime_get_sg_table functions to ch…
Browse files Browse the repository at this point in the history
…eck for mm_node. (#8500) (#8504)

Signed-off-by: Manoj Takasi <[email protected]>
Co-authored-by: Manoj Takasi <[email protected]>
(cherry picked from commit acf8e76)

Co-authored-by: Manoj Takasi <[email protected]>
  • Loading branch information
ManojTakasi and Manoj Takasi authored Oct 9, 2024
1 parent 8f3beee commit 6d704fd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/runtime_src/core/edge/drm/zocl/common/zocl_bo.c
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ zocl_create_bo(struct drm_device *dev, uint64_t unaligned_size, u32 user_flags)
struct sg_table *zocl_gem_prime_get_sg_table(struct drm_gem_object *obj)
{
struct drm_zocl_bo *zocl_obj = to_zocl_bo(obj);
if (zocl_obj && (zocl_obj->flags & ZOCL_BO_FLAGS_CMA)) {
if (zocl_obj && !(zocl_obj->mm_node)) {
return drm_gem_dma_get_sg_table(&zocl_obj->cma_base);
}
struct drm_device *drm = obj->dev;
Expand Down
2 changes: 1 addition & 1 deletion src/runtime_src/core/edge/drm/zocl/common/zocl_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ void zocl_free_bo(struct drm_gem_object *obj)
zocl_free_userptr_bo(obj);
else if (zocl_obj->flags & ZOCL_BO_FLAGS_HOST_BO)
zocl_free_host_bo(obj);
else if (zocl_obj->flags & ZOCL_BO_FLAGS_CMA) {
else if (!zocl_obj->mm_node) {
/* Update memory usage statistics */
zocl_update_mem_stat(zdev, obj->size, -1,
zocl_obj->mem_index);
Expand Down

0 comments on commit 6d704fd

Please sign in to comment.