hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/dma-buf/heaps/rk_system_heap.c
....@@ -58,12 +58,11 @@
5858 bool uncached;
5959 };
6060
61
-#define LOW_ORDER_GFP (GFP_HIGHUSER | __GFP_ZERO | __GFP_COMP)
62
-#define MID_ORDER_GFP (LOW_ORDER_GFP | __GFP_NOWARN)
61
+#define LOW_ORDER_GFP (GFP_HIGHUSER | __GFP_ZERO)
6362 #define HIGH_ORDER_GFP (((GFP_HIGHUSER | __GFP_ZERO | __GFP_NOWARN \
6463 | __GFP_NORETRY) & ~__GFP_RECLAIM) \
6564 | __GFP_COMP)
66
-static gfp_t order_flags[] = {HIGH_ORDER_GFP, MID_ORDER_GFP, LOW_ORDER_GFP};
65
+static gfp_t order_flags[] = {HIGH_ORDER_GFP, HIGH_ORDER_GFP, LOW_ORDER_GFP};
6766 /*
6867 * The selection of the orders used for allocation (1MB, 64K, 4K) is designed
6968 * to match with the sizes often found in IOMMUs. Using order 4 pages instead
....@@ -266,7 +265,7 @@
266265 return 0;
267266 }
268267
269
-static int
268
+static int __maybe_unused
270269 system_heap_dma_buf_begin_cpu_access_partial(struct dma_buf *dmabuf,
271270 enum dma_data_direction direction,
272271 unsigned int offset,
....@@ -296,7 +295,7 @@
296295 return ret;
297296 }
298297
299
-static int
298
+static int __maybe_unused
300299 system_heap_dma_buf_end_cpu_access_partial(struct dma_buf *dmabuf,
301300 enum dma_data_direction direction,
302301 unsigned int offset,
....@@ -479,8 +478,10 @@
479478 .unmap_dma_buf = system_heap_unmap_dma_buf,
480479 .begin_cpu_access = system_heap_dma_buf_begin_cpu_access,
481480 .end_cpu_access = system_heap_dma_buf_end_cpu_access,
481
+#ifdef CONFIG_DMABUF_PARTIAL
482482 .begin_cpu_access_partial = system_heap_dma_buf_begin_cpu_access_partial,
483483 .end_cpu_access_partial = system_heap_dma_buf_end_cpu_access_partial,
484
+#endif
484485 .mmap = system_heap_mmap,
485486 .vmap = system_heap_vmap,
486487 .vunmap = system_heap_vunmap,
....@@ -702,9 +703,6 @@
702703
703704 if (!heap_dev)
704705 return -EINVAL;
705
-
706
- /* Set a dma ops(swiotlb) for the heap device. */
707
- arch_setup_dma_ops(heap_dev, 0, 0, NULL, 0);
708706
709707 dma_coerce_mask_and_coherent(heap_dev, DMA_BIT_MASK(64));
710708