.. | .. |
---|
15 | 15 | #include <linux/cma.h> |
---|
16 | 16 | #include <linux/dma-buf.h> |
---|
17 | 17 | #include <linux/dma-heap.h> |
---|
18 | | -#include <linux/dma-contiguous.h> |
---|
| 18 | +#include <linux/dma-map-ops.h> |
---|
19 | 19 | #include <linux/err.h> |
---|
20 | 20 | #include <linux/highmem.h> |
---|
21 | 21 | #include <linux/io.h> |
---|
.. | .. |
---|
135 | 135 | dma_unmap_sgtable(attachment->dev, table, direction, attrs); |
---|
136 | 136 | } |
---|
137 | 137 | |
---|
138 | | -static int |
---|
| 138 | +static int __maybe_unused |
---|
139 | 139 | cma_heap_dma_buf_begin_cpu_access_partial(struct dma_buf *dmabuf, |
---|
140 | 140 | enum dma_data_direction direction, |
---|
141 | 141 | unsigned int offset, |
---|
.. | .. |
---|
160 | 160 | return 0; |
---|
161 | 161 | } |
---|
162 | 162 | |
---|
163 | | -static int |
---|
| 163 | +static int __maybe_unused |
---|
164 | 164 | cma_heap_dma_buf_end_cpu_access_partial(struct dma_buf *dmabuf, |
---|
165 | 165 | enum dma_data_direction direction, |
---|
166 | 166 | unsigned int offset, |
---|
.. | .. |
---|
334 | 334 | .unmap_dma_buf = cma_heap_unmap_dma_buf, |
---|
335 | 335 | .begin_cpu_access = cma_heap_dma_buf_begin_cpu_access, |
---|
336 | 336 | .end_cpu_access = cma_heap_dma_buf_end_cpu_access, |
---|
| 337 | +#ifdef CONFIG_DMABUF_PARTIAL |
---|
337 | 338 | .begin_cpu_access_partial = cma_heap_dma_buf_begin_cpu_access_partial, |
---|
338 | 339 | .end_cpu_access_partial = cma_heap_dma_buf_end_cpu_access_partial, |
---|
| 340 | +#endif |
---|
339 | 341 | .mmap = cma_heap_mmap, |
---|
340 | 342 | .vmap = cma_heap_vmap, |
---|
341 | 343 | .vunmap = cma_heap_vunmap, |
---|
.. | .. |
---|
388 | 390 | kunmap_atomic(vaddr); |
---|
389 | 391 | /* |
---|
390 | 392 | * Avoid wasting time zeroing memory if the process |
---|
391 | | - * has been killed by SIGKILL |
---|
| 393 | + * has been killed by by SIGKILL |
---|
392 | 394 | */ |
---|
393 | 395 | if (fatal_signal_pending(current)) |
---|
394 | 396 | goto free_cma; |
---|
.. | .. |
---|
518 | 520 | |
---|
519 | 521 | if (!heap_dev) |
---|
520 | 522 | return -EINVAL; |
---|
521 | | - |
---|
522 | | - arch_setup_dma_ops(heap_dev, 0, 0, NULL, 0); |
---|
523 | 523 | |
---|
524 | 524 | dma_coerce_mask_and_coherent(heap_dev, DMA_BIT_MASK(64)); |
---|
525 | 525 | |
---|