accel/ivpu: Remove support for uncached buffers
authorJacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
Tue, 31 Oct 2023 07:31:55 +0000 (08:31 +0100)
committerJacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
Wed, 8 Nov 2023 15:27:39 +0000 (16:27 +0100)
Usages of DRM_IVPU_BO_UNCACHED should be replaced by DRM_IVPU_BO_WC.
There is no functional benefit from DRM_IVPU_BO_UNCACHED if these
buffers are never mapped to host VM.

This allows to cut the buffer handling code in the kernel driver
by half.

Usage of DRM_IVPU_BO_UNCACHED buffers was removed from user-space
driver and will not be part of first UMD release.

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-4-stanislaw.gruszka@linux.intel.com
drivers/accel/ivpu/ivpu_fw.c
drivers/accel/ivpu/ivpu_gem.c
include/uapi/drm/ivpu_accel.h

index 3fd74cd4205f98f4cdd2c243f2debc138630394b..3d0c18d68f6c6c03139a0ac079c2428a004a4941 100644 (file)
@@ -286,7 +286,7 @@ static int ivpu_fw_mem_init(struct ivpu_device *vdev)
 
        if (fw->shave_nn_size) {
                fw->mem_shave_nn = ivpu_bo_alloc_internal(vdev, vdev->hw->ranges.shave.start,
-                                                         fw->shave_nn_size, DRM_IVPU_BO_UNCACHED);
+                                                         fw->shave_nn_size, DRM_IVPU_BO_WC);
                if (!fw->mem_shave_nn) {
                        ivpu_err(vdev, "Failed to allocate shavenn buffer\n");
                        ret = -ENOMEM;
index 915c53d7bb97b791bff154936e7ac54193b1c4aa..2a91eb1e36278a4c4e8a7c8d5b4e5691dc0bdecc 100644 (file)
@@ -89,8 +89,6 @@ static int __must_check shmem_alloc_pages_locked(struct ivpu_bo *bo)
 
        if (bo->flags & DRM_IVPU_BO_WC)
                set_pages_array_wc(pages, npages);
-       else if (bo->flags & DRM_IVPU_BO_UNCACHED)
-               set_pages_array_uc(pages, npages);
 
        bo->pages = pages;
        return 0;
@@ -366,7 +364,6 @@ ivpu_bo_alloc(struct ivpu_device *vdev, u64 size, u32 flags, const struct ivpu_b
 
        switch (flags & DRM_IVPU_BO_CACHE_MASK) {
        case DRM_IVPU_BO_CACHED:
-       case DRM_IVPU_BO_UNCACHED:
        case DRM_IVPU_BO_WC:
                break;
        default:
index 262db0c3beeea3c5e05c9470f1db061870b8b8a2..de1944e42c6556a46a8a87855189f34b86859e99 100644 (file)
@@ -196,7 +196,7 @@ struct drm_ivpu_bo_create {
         *
         * %DRM_IVPU_BO_UNCACHED:
         *
-        * Allocated BO will not be cached on host side nor snooped on the VPU side.
+        * Not supported. Use DRM_IVPU_BO_WC instead.
         *
         * %DRM_IVPU_BO_WC:
         *