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

Commit 09bb7f53 authored by Rebecca Schultz Zavin's avatar Rebecca Schultz Zavin Committed by Mitchel Humpherys
Browse files

gpu: ion: Clarify variable names and comments around heap ids v types



There is some confusion between when to use the heap type and when
the id.  This patch clarifies this by using clearer variable names
and describing the intention in the comments.  Also fixes the client
debug code to print heaps by id instead of type.

Change-Id: Ie8b3dadded52e18590fcb2ca94001f6ed46ef07d
Signed-off-by: default avatarRebecca Schultz Zavin <rebecca@android.com>
Git-commit: dbb80960
Git-repo: https://android.googlesource.com/kernel/common/


[mitchelh@codeaurora.org: Had to skip most of this patch since already
had most of it. Also had to apply to both ion.h files due to the UAPI
split. Also reverting 0b017a37 which renamed heap_id_mask to
heap_mask.]
Signed-off-by: default avatarMitchel Humpherys <mitchelh@codeaurora.org>
parent 9e91c0c5
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -25,7 +25,7 @@
struct compat_ion_allocation_data {
	compat_size_t len;
	compat_size_t align;
	compat_uint_t heap_mask;
	compat_uint_t heap_id_mask;
	compat_uint_t flags;
	compat_int_t handle;
};
@@ -59,8 +59,8 @@ static int compat_get_ion_allocation_data(
	err |= put_user(s, &data->len);
	err |= get_user(s, &data32->align);
	err |= put_user(s, &data->align);
	err |= get_user(u, &data32->heap_mask);
	err |= put_user(u, &data->heap_mask);
	err |= get_user(u, &data32->heap_id_mask);
	err |= put_user(u, &data->heap_id_mask);
	err |= get_user(u, &data32->flags);
	err |= put_user(u, &data->flags);
	err |= get_user(i, &data32->handle);
@@ -95,8 +95,8 @@ static int compat_put_ion_allocation_data(
	err |= put_user(s, &data32->len);
	err |= get_user(s, &data->align);
	err |= put_user(s, &data32->align);
	err |= get_user(u, &data->heap_mask);
	err |= put_user(u, &data32->heap_mask);
	err |= get_user(u, &data->heap_id_mask);
	err |= put_user(u, &data32->heap_id_mask);
	err |= get_user(u, &data->flags);
	err |= put_user(u, &data32->flags);
	err |= get_user(i, &data->handle);
+1 −1
Original line number Diff line number Diff line
@@ -1390,7 +1390,7 @@ static long ion_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)

		handle = ion_alloc(client, data.allocation.len,
						data.allocation.align,
						data.allocation.heap_mask,
						data.allocation.heap_id_mask,
						data.allocation.flags);
		if (IS_ERR(handle))
			return PTR_ERR(handle);
+3 −3
Original line number Diff line number Diff line
@@ -216,8 +216,8 @@ static inline void ion_reserve(struct ion_platform_data *data)

}

static inline struct ion_client *ion_client_create(struct ion_device *dev,
				     unsigned int heap_mask, const char *name)
static inline struct ion_client *ion_client_create(
	struct ion_device *dev, unsigned int heap_id_mask, const char *name)
{
	return ERR_PTR(-ENODEV);
}
@@ -226,7 +226,7 @@ static inline void ion_client_destroy(struct ion_client *client) { }

static inline struct ion_handle *ion_alloc(struct ion_client *client,
					size_t len, size_t align,
					unsigned int heap_mask,
					unsigned int heap_id_mask,
					unsigned int flags)
{
	return ERR_PTR(-ENODEV);
+1 −1
Original line number Diff line number Diff line
@@ -89,7 +89,7 @@ enum ion_heap_type {
struct ion_allocation_data {
	size_t len;
	size_t align;
	unsigned int heap_mask;
	unsigned int heap_id_mask;
	unsigned int flags;
	ion_user_handle_t handle;
};