Skip to content

Commit

Permalink
Removed zocl_gem_import function, using drm_gem_prime_import (#8259)
Browse files Browse the repository at this point in the history
Signed-off-by: Manoj Takasi <mtakasi@amd.com>
(cherry picked from commit 1bb0832)

Co-authored-by: Manoj Takasi <mtakasi@amd.com>
  • Loading branch information
ManojTakasi and Manoj Takasi authored Jul 3, 2024
1 parent 46e61b0 commit 457ef2b
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 23 deletions.
19 changes: 0 additions & 19 deletions src/runtime_src/core/edge/drm/zocl/common/zocl_bo.c
Original file line number Diff line number Diff line change
Expand Up @@ -1415,25 +1415,6 @@ void zocl_clear_mem(struct drm_zocl_dev *zdev)
mutex_unlock(&zdev->mm_lock);
}

struct drm_gem_object *zocl_gem_import(struct drm_device *dev,
struct dma_buf *dma_buf)
{
struct drm_gem_object *gem_obj;
struct drm_zocl_bo *zocl_bo;

gem_obj = drm_gem_prime_import(dev, dma_buf);
if (!IS_ERR(gem_obj)) {
zocl_bo = to_zocl_bo(gem_obj);
/* drm_gem_cma_prime_import_sg_table() is used for hook
* gem_prime_import_sg_table. It will check if import buffer
* is a CMA buffer and create CMA object.
*/
zocl_bo->flags |= ZOCL_BO_FLAGS_CMA;
}

return gem_obj;
}

void zocl_drm_free_bo(struct drm_zocl_bo *bo)
{
zocl_free_bo(&bo->gem_base);
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 @@ -1042,7 +1042,7 @@ static struct drm_driver zocl_driver = {
.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
.gem_prime_mmap = drm_gem_prime_mmap,
#endif
.gem_prime_import = zocl_gem_import,
.gem_prime_import = drm_gem_prime_import,
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)
.gem_prime_import_sg_table = drm_gem_dma_prime_import_sg_table,
#else
Expand Down
3 changes: 0 additions & 3 deletions src/runtime_src/core/edge/drm/zocl/include/zocl_bo.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,6 @@ static inline uint32_t zocl_convert_bo_uflags(uint32_t uflags)
return zflags;
}

struct drm_gem_object *
zocl_gem_import(struct drm_device *dev, struct dma_buf *dma_buf);

struct sg_table *zocl_gem_prime_get_sg_table(struct drm_gem_object *obj);

#endif /* _ZOCL_BO_H */

0 comments on commit 457ef2b

Please sign in to comment.