Re: [RFC][PATCH 6/6] staging: android: ion: Introduce new ioctls for dynamic heaps

From: Brian Starkey
Date: Thu Jun 09 2016 - 04:25:22 EST


Hi Laura,

On Wed, Jun 08, 2016 at 12:14:12PM -0700, Laura Abbott wrote:

For now I'm just going to focus on comments not about the heap ID mapping
because I'm leaning towards dropping the heap ID mapping.


Fair enough. Like you said, giving userspace enough information to just
figure out the right heap IDs is already a big improvement.


I'm not that familiar with the DRM ioctls but this sounds like a
good suggestion. One less ioctl to worry about.


Sorry, I probably should have pointed to an example:
http://lxr.free-electrons.com/source/drivers/gpu/drm/drm_crtc.c#L2325

+ */
+struct ion_heap_query {
+ __u32 cnt; /* Total number of heaps to be copied */
+ __u64 heaps; /* buffer to be populated */

I guess this field needs explicit alignment to 64 bits


Yes, I was going by the suggestion in botching-up-ioctls.txt

https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/ioctl/botching-up-ioctls.txt#n42


The type is fine, but you should add a 32-bit padding field before
heaps:
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/ioctl/botching-up-ioctls.txt#n32

Cheers,

-Brian