Commit ce1f147a authored by Rebecca Schultz Zavin's avatar Rebecca Schultz Zavin Committed by Greg Kroah-Hartman
Browse files

gpu: ion: Get an sg_table from an ion handle



This patch adds an interface to return and sg_table given a
valid ion handle.

Signed-off-by: default avatarRebecca Schultz Zavin <rebecca@android.com>
[jstultz: modified patch to apply to staging directory]
Signed-off-by: default avatarJohn Stultz <john.stultz@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 29ae6bc7
Loading
Loading
Loading
Loading
+2 −6
Original line number Diff line number Diff line
@@ -616,7 +616,7 @@ void ion_client_destroy(struct ion_client *client)
	kfree(client);
}

struct sg_table *ion_map_dma(struct ion_client *client,
struct sg_table *ion_sg_table(struct ion_client *client,
			      struct ion_handle *handle)
{
	struct ion_buffer *buffer;
@@ -635,10 +635,6 @@ struct sg_table *ion_map_dma(struct ion_client *client,
	return table;
}

void ion_unmap_dma(struct ion_client *client, struct ion_handle *handle)
{
}

static struct sg_table *ion_map_dma_buf(struct dma_buf_attachment *attachment,
					enum dma_data_direction direction)
{
+12 −1
Original line number Diff line number Diff line
@@ -149,7 +149,7 @@ void ion_free(struct ion_client *client, struct ion_handle *handle);
 * This function queries the heap for a particular handle to get the
 * handle's physical address.  It't output is only correct if
 * a heap returns physically contiguous memory -- in other cases
 * this api should not be implemented -- ion_map_dma should be used
 * this api should not be implemented -- ion_sg_table should be used
 * instead.  Returns -EINVAL if the handle is invalid.  This has
 * no implications on the reference counting of the handle --
 * the returned value may not be valid if the caller is not
@@ -158,6 +158,17 @@ void ion_free(struct ion_client *client, struct ion_handle *handle);
int ion_phys(struct ion_client *client, struct ion_handle *handle,
	     ion_phys_addr_t *addr, size_t *len);

/**
 * ion_map_dma - return an sg_table describing a handle
 * @client:	the client
 * @handle:	the handle
 *
 * This function returns the sg_table describing
 * a particular ion handle.
 */
struct sg_table *ion_sg_table(struct ion_client *client,
			      struct ion_handle *handle);

/**
 * ion_map_kernel - create mapping for the given handle
 * @client:	the client