Loading drivers/staging/android/ion/ion_carveout_heap.c +12 −0 Original line number Diff line number Diff line Loading @@ -77,6 +77,7 @@ static int ion_carveout_heap_allocate(struct ion_heap *heap, struct sg_table *table; ion_phys_addr_t paddr; int ret; struct device *dev = heap->priv; if (align > PAGE_SIZE) return -EINVAL; Loading @@ -95,8 +96,19 @@ static int ion_carveout_heap_allocate(struct ion_heap *heap, } sg_set_page(table->sgl, pfn_to_page(PFN_DOWN(paddr)), size, 0); /* * This is not correct - sg_dma_address needs a dma_addr_t that is valid * for the targeted device, but this works on the currently targeted * hardware. */ sg_dma_address(table->sgl) = sg_phys(table->sgl); buffer->priv_virt = table; if (ion_buffer_cached(buffer)) dma_sync_sg_for_cpu(dev, table->sgl, table->nents, DMA_BIDIRECTIONAL); return 0; err_free_table: Loading Loading
drivers/staging/android/ion/ion_carveout_heap.c +12 −0 Original line number Diff line number Diff line Loading @@ -77,6 +77,7 @@ static int ion_carveout_heap_allocate(struct ion_heap *heap, struct sg_table *table; ion_phys_addr_t paddr; int ret; struct device *dev = heap->priv; if (align > PAGE_SIZE) return -EINVAL; Loading @@ -95,8 +96,19 @@ static int ion_carveout_heap_allocate(struct ion_heap *heap, } sg_set_page(table->sgl, pfn_to_page(PFN_DOWN(paddr)), size, 0); /* * This is not correct - sg_dma_address needs a dma_addr_t that is valid * for the targeted device, but this works on the currently targeted * hardware. */ sg_dma_address(table->sgl) = sg_phys(table->sgl); buffer->priv_virt = table; if (ion_buffer_cached(buffer)) dma_sync_sg_for_cpu(dev, table->sgl, table->nents, DMA_BIDIRECTIONAL); return 0; err_free_table: Loading