diff options
author | Laura Abbott | 2016-09-07 20:49:59 +0200 |
---|---|---|
committer | Greg Kroah-Hartman | 2016-09-12 11:46:44 +0200 |
commit | 02b23803c6af399473703e26703f74cfff3f22f8 (patch) | |
tree | 7c3f80f8f3b3b3a9ebf7319645505f5ba49dcacd /drivers/staging/android/uapi | |
parent | staging: rtl8712: checkpatch cleanup: block comments using a trailing */ (diff) | |
download | kernel-qcow2-linux-02b23803c6af399473703e26703f74cfff3f22f8.tar.gz kernel-qcow2-linux-02b23803c6af399473703e26703f74cfff3f22f8.tar.xz kernel-qcow2-linux-02b23803c6af399473703e26703f74cfff3f22f8.zip |
staging: android: ion: Add ioctl to query available heaps
Ion clients currently lack a good method to determine what
heaps are available and what ids they map to. This leads
to tight coupling between user and kernel space and headaches.
Add a query ioctl to let userspace know the availability of
heaps.
Signed-off-by: Laura Abbott <labbott@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/android/uapi')
-rw-r--r-- | drivers/staging/android/uapi/ion.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/drivers/staging/android/uapi/ion.h b/drivers/staging/android/uapi/ion.h index a9c4e8b04be0..647f130c60af 100644 --- a/drivers/staging/android/uapi/ion.h +++ b/drivers/staging/android/uapi/ion.h @@ -128,6 +128,36 @@ struct ion_custom_data { unsigned long arg; }; +#define MAX_HEAP_NAME 32 + +/** + * struct ion_heap_data - data about a heap + * @name - first 32 characters of the heap name + * @type - heap type + * @heap_id - heap id for the heap + */ +struct ion_heap_data { + char name[MAX_HEAP_NAME]; + __u32 type; + __u32 heap_id; + __u32 reserved0; + __u32 reserved1; + __u32 reserved2; +}; + +/** + * struct ion_heap_query - collection of data about all heaps + * @cnt - total number of heaps to be copied + * @heaps - buffer to copy heap data + */ +struct ion_heap_query { + __u32 cnt; /* Total number of heaps to be copied */ + __u32 reserved0; /* align to 64bits */ + __u64 heaps; /* buffer to be populated */ + __u32 reserved1; + __u32 reserved2; +}; + #define ION_IOC_MAGIC 'I' /** @@ -194,4 +224,13 @@ struct ion_custom_data { */ #define ION_IOC_CUSTOM _IOWR(ION_IOC_MAGIC, 6, struct ion_custom_data) +/** + * DOC: ION_IOC_HEAP_QUERY - information about available heaps + * + * Takes an ion_heap_query structure and populates information about + * available Ion heaps. + */ +#define ION_IOC_HEAP_QUERY _IOWR(ION_IOC_MAGIC, 8, \ + struct ion_heap_query) + #endif /* _UAPI_LINUX_ION_H */ |