Skip to content

Commit 8d88e4c

Browse files
committed
accel/ivpu: Use GEM shmem helper for all buffers
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
1 parent 48d45fa commit 8d88e4c

File tree

5 files changed

+144
-460
lines changed

5 files changed

+144
-460
lines changed

drivers/accel/ivpu/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ config DRM_ACCEL_IVPU
66
depends on X86_64 && !UML
77
depends on PCI && PCI_MSI
88
select FW_LOADER
9-
select SHMEM
9+
select DRM_GEM_SHMEM_HELPER
1010
select GENERIC_ALLOCATOR
1111
help
1212
Choose this option if you have a system with an 14th generation

drivers/accel/ivpu/ivpu_drv.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ int ivpu_boot(struct ivpu_device *vdev)
360360
int ret;
361361

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

365365
ret = ivpu_hw_boot_fw(vdev);
366366
if (ret) {
@@ -409,7 +409,9 @@ static const struct drm_driver driver = {
409409

410410
.open = ivpu_open,
411411
.postclose = ivpu_postclose,
412-
.gem_prime_import = ivpu_gem_prime_import,
412+
413+
.gem_create_object = ivpu_gem_create_object,
414+
.gem_prime_import_sg_table = drm_gem_shmem_prime_import_sg_table,
413415

414416
.ioctls = ivpu_drm_ioctls,
415417
.num_ioctls = ARRAY_SIZE(ivpu_drm_ioctls),

0 commit comments

Comments
 (0)