de_heap_ion.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * de_heap_ion.h
  3. *
  4. * platform specific interface for de_heap_ion
  5. *
  6. */
  7. #ifndef DE_HEAP_ION_H
  8. #define DE_HEAP_ION_H
  9. #include <linux/version.h>
  10. /*
  11. * gcc preprocessor defines "linux" as "1".
  12. * [ http://stackoverflow.com/questions/19210935 ]
  13. * IMG_KERNEL_ION_HEADER can be <linux/ion.h>, which expands to <1/ion.h>
  14. */
  15. #undef linux
  16. #include IMG_KERNEL_ION_HEADER
  17. /*
  18. * fetch the ion heap number (argument to ion_alloc)
  19. */
  20. unsigned int de_heap_ion_get_heap_mask(void);
  21. #if ((LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(4, 16, 0)))
  22. unsigned int de_heap_ion_get_heap_id_mask(void);
  23. #endif
  24. /*
  25. * fetch the ion flags (argument to ion_alloc)
  26. */
  27. unsigned int de_heap_ion_get_heap_flags(void);
  28. /*
  29. * fetch an ion client instance
  30. *
  31. * the implementation of this usually depends on ion_device (ion_client_create)
  32. * which is platform specific
  33. */
  34. struct ion_client *de_heap_ion_create_ion_client(void);
  35. struct ion_client *de_heap_ion_destroy_ion_client(struct ion_client *dmabuf_ion_client);
  36. #endif /* DE_HEAP_ION_H */