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.
Unified · Split
| @@ -286,7 +286,7 @@ static int ivpu_fw_mem_init(struct ivpu_device *vdev) · 285 unmodified lines | |||
| 286 | 286 | ||
| 287 | if (fw->shave_nn_size) { | 287 | if (fw->shave_nn_size) { |
| 288 | fw->mem_shave_nn = ivpu_bo_alloc_internal(vdev, vdev->hw->ranges.shave.start, | 288 | fw->mem_shave_nn = ivpu_bo_alloc_internal(vdev, vdev->hw->ranges.shave.start, |
| 289 | fw->shave_nn_size, DRM_IVPU_BO_UNCACHED); | 289 | fw->shave_nn_size, DRM_IVPU_BO_WC); |
| 290 | if (!fw->mem_shave_nn) { | 290 | if (!fw->mem_shave_nn) { |
| 291 | ivpu_err(vdev, "Failed to allocate shavenn buffer\n"); | 291 | ivpu_err(vdev, "Failed to allocate shavenn buffer\n"); |
| 292 | ret = -ENOMEM; | 292 | ret = -ENOMEM; |
| @@ -89,8 +89,6 @@ static int __must_check shmem_alloc_pages_locked(struct ivpu_bo *bo) · 88 unmodified lines | |||
| 89 | 89 | ||
| 90 | if (bo->flags & DRM_IVPU_BO_WC) | 90 | if (bo->flags & DRM_IVPU_BO_WC) |
| 91 | set_pages_array_wc(pages, npages); | 91 | set_pages_array_wc(pages, npages); |
| 92 | else if (bo->flags & DRM_IVPU_BO_UNCACHED) | ||
| 93 | set_pages_array_uc(pages, npages); | ||
| 94 | 92 | ||
| 95 | bo->pages = pages; | 93 | bo->pages = pages; |
| 96 | return 0; | 94 | return 0; |
| @@ -366,7 +364,6 @@ ivpu_bo_alloc(struct ivpu_device *vdev, u64 size, u32 flags, const struct ivpu_b · 269 unmodified lines | |||
| 366 | 364 | ||
| 367 | switch (flags & DRM_IVPU_BO_CACHE_MASK) { | 365 | switch (flags & DRM_IVPU_BO_CACHE_MASK) { |
| 368 | case DRM_IVPU_BO_CACHED: | 366 | case DRM_IVPU_BO_CACHED: |
| 369 | case DRM_IVPU_BO_UNCACHED: | ||
| 370 | case DRM_IVPU_BO_WC: | 367 | case DRM_IVPU_BO_WC: |
| 371 | break; | 368 | break; |
| 372 | default: | 369 | default: |
| @@ -196,7 +196,7 @@ struct drm_ivpu_bo_create { · 195 unmodified lines | |||
| 196 | * | 196 | * |
| 197 | * %DRM_IVPU_BO_UNCACHED: | 197 | * %DRM_IVPU_BO_UNCACHED: |
| 198 | * | 198 | * |
| 199 | * Allocated BO will not be cached on host side nor snooped on the VPU side. | 199 | * Not supported. Use DRM_IVPU_BO_WC instead. |
| 200 | * | 200 | * |
| 201 | * %DRM_IVPU_BO_WC: | 201 | * %DRM_IVPU_BO_WC: |
| 202 | * | 202 | * |