Skip to content

Commit

Permalink
accel/ivpu: Use GEM shmem helper for all buffers
Browse files Browse the repository at this point in the history
Use struct drm_gem_shmem_object as a base for struct ivpu_bo.
This cuts by 50% the buffer management code.

Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231031073156.1301669-5-stanislaw.gruszka@linux.intel.com
  • Loading branch information
Jacek Lawrynowicz committed Nov 8, 2023
1 parent 48d45fa commit 8d88e4c
Show file tree
Hide file tree
Showing 5 changed files with 144 additions and 460 deletions.
2 changes: 1 addition & 1 deletion drivers/accel/ivpu/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ config DRM_ACCEL_IVPU
depends on X86_64 && !UML
depends on PCI && PCI_MSI
select FW_LOADER
select SHMEM
select DRM_GEM_SHMEM_HELPER
select GENERIC_ALLOCATOR
help
Choose this option if you have a system with an 14th generation
Expand Down
6 changes: 4 additions & 2 deletions drivers/accel/ivpu/ivpu_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ int ivpu_boot(struct ivpu_device *vdev)
int ret;

/* Update boot params located at first 4KB of FW memory */
ivpu_fw_boot_params_setup(vdev, vdev->fw->mem->kvaddr);
ivpu_fw_boot_params_setup(vdev, ivpu_bo_vaddr(vdev->fw->mem));

ret = ivpu_hw_boot_fw(vdev);
if (ret) {
Expand Down Expand Up @@ -409,7 +409,9 @@ static const struct drm_driver driver = {

.open = ivpu_open,
.postclose = ivpu_postclose,
.gem_prime_import = ivpu_gem_prime_import,

.gem_create_object = ivpu_gem_create_object,
.gem_prime_import_sg_table = drm_gem_shmem_prime_import_sg_table,

.ioctls = ivpu_drm_ioctls,
.num_ioctls = ARRAY_SIZE(ivpu_drm_ioctls),
Expand Down
Loading

0 comments on commit 8d88e4c

Please sign in to comment.