|
@@ -863,22 +863,6 @@ static void ion_unmap_dma_buf(struct dma_buf_attachment *attachment,
|
|
|
dma_unmap_sg(attachment->dev, table->sgl, table->nents, direction);
|
|
|
}
|
|
|
|
|
|
-void ion_pages_sync_for_device(struct device *dev, struct page *page,
|
|
|
- size_t size, enum dma_data_direction dir)
|
|
|
-{
|
|
|
- struct scatterlist sg;
|
|
|
-
|
|
|
- sg_init_table(&sg, 1);
|
|
|
- sg_set_page(&sg, page, 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(&sg) = page_to_phys(page);
|
|
|
- dma_sync_sg_for_device(dev, &sg, 1, dir);
|
|
|
-}
|
|
|
-
|
|
|
static int ion_mmap(struct dma_buf *dmabuf, struct vm_area_struct *vma)
|
|
|
{
|
|
|
struct ion_buffer *buffer = dmabuf->priv;
|
|
@@ -1097,30 +1081,6 @@ struct ion_handle *ion_import_dma_buf_fd(struct ion_client *client, int fd)
|
|
|
}
|
|
|
EXPORT_SYMBOL(ion_import_dma_buf_fd);
|
|
|
|
|
|
-int ion_sync_for_device(struct ion_client *client, int fd)
|
|
|
-{
|
|
|
- struct dma_buf *dmabuf;
|
|
|
- struct ion_buffer *buffer;
|
|
|
-
|
|
|
- dmabuf = dma_buf_get(fd);
|
|
|
- if (IS_ERR(dmabuf))
|
|
|
- return PTR_ERR(dmabuf);
|
|
|
-
|
|
|
- /* if this memory came from ion */
|
|
|
- if (dmabuf->ops != &dma_buf_ops) {
|
|
|
- pr_err("%s: can not sync dmabuf from another exporter\n",
|
|
|
- __func__);
|
|
|
- dma_buf_put(dmabuf);
|
|
|
- return -EINVAL;
|
|
|
- }
|
|
|
- buffer = dmabuf->priv;
|
|
|
-
|
|
|
- dma_sync_sg_for_device(NULL, buffer->sg_table->sgl,
|
|
|
- buffer->sg_table->nents, DMA_BIDIRECTIONAL);
|
|
|
- dma_buf_put(dmabuf);
|
|
|
- return 0;
|
|
|
-}
|
|
|
-
|
|
|
int ion_query_heaps(struct ion_client *client, struct ion_heap_query *query)
|
|
|
{
|
|
|
struct ion_device *dev = client->dev;
|