Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 45d36fb2 authored by Kyle Yan's avatar Kyle Yan Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: ion: Export msm_ion_do_cache_offset_op to do cache operations" into msm-4.9

parents 6ce27913 d58f5a0e
Loading
Loading
Loading
Loading
+22 −3
Original line number Diff line number Diff line
@@ -301,13 +301,23 @@ static int ion_pages_cache_ops(
	};

	for_each_sg(table->sgl, sg, table->nents, i) {
		unsigned int sg_offset, sg_left, size = 0;

		len += sg->length;
		if (len < offset)
		if (len <= offset)
			continue;

		__do_cache_ops(sg_page(sg), sg->offset, sg->length, op);
		sg_left = len - offset;
		sg_offset = sg->length - sg_left;

		size = (length < sg_left) ? length : sg_left;

		__do_cache_ops(sg_page(sg), sg_offset, size, op);

		offset += size;
		length -= size;

		if (len > length + offset)
		if (length == 0)
			break;
	}
	return 0;
@@ -356,6 +366,15 @@ int msm_ion_do_cache_op(struct ion_client *client, struct ion_handle *handle,
}
EXPORT_SYMBOL(msm_ion_do_cache_op);

int msm_ion_do_cache_offset_op(
		struct ion_client *client, struct ion_handle *handle,
		void *vaddr, unsigned int offset, unsigned long len,
		unsigned int cmd)
{
	return ion_do_cache_op(client, handle, vaddr, offset, len, cmd);
}
EXPORT_SYMBOL(msm_ion_do_cache_offset_op);

static void msm_ion_allocate(struct ion_platform_heap *heap)
{
	if (!heap->base && heap->extra_data) {
+13 −0
Original line number Diff line number Diff line
@@ -167,6 +167,11 @@ int ion_handle_get_size(struct ion_client *client, struct ion_handle *handle,
int msm_ion_do_cache_op(struct ion_client *client, struct ion_handle *handle,
			void *vaddr, unsigned long len, unsigned int cmd);

int msm_ion_do_cache_offset_op(
		struct ion_client *client, struct ion_handle *handle,
		void *vaddr, unsigned int offset, unsigned long len,
		unsigned int cmd);

#else
static inline struct ion_client *msm_ion_client_create(const char *name)
{
@@ -187,6 +192,14 @@ static inline int msm_ion_do_cache_op(
	return -ENODEV;
}

int msm_ion_do_cache_offset_op(
		struct ion_client *client, struct ion_handle *handle,
		void *vaddr, unsigned int offset, unsigned long len,
		unsigned int cmd)
{
	return -ENODEV;
}

#endif /* CONFIG_ION */

#endif