msm_smem.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
  2. *
  3. * This program is free software; you can redistribute it and/or modify
  4. * it under the terms of the GNU General Public License version 2 and
  5. * only version 2 as published by the Free Software Foundation.
  6. *
  7. * This program is distributed in the hope that it will be useful,
  8. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. * GNU General Public License for more details.
  11. *
  12. */
  13. #ifndef _MSM_SMEM_H_
  14. #define _MSM_SMEM_H_
  15. #include <linux/types.h>
  16. #include <linux/msm_ion.h>
  17. #include "msm_vidc_resources.h"
  18. #define HAL_BUFFER_MAX 0xb
  19. enum smem_type {
  20. SMEM_ION,
  21. };
  22. enum smem_prop {
  23. SMEM_CACHED = ION_FLAG_CACHED,
  24. SMEM_SECURE = ION_FLAG_SECURE,
  25. };
  26. void *msm_smem_new_client(enum smem_type mtype,
  27. struct msm_vidc_platform_resources *res);
  28. struct msm_smem *msm_smem_alloc(void *clt, size_t size, u32 align, u32 flags,
  29. enum hal_buffer buffer_type, int map_kernel);
  30. void msm_smem_free(void *clt, struct msm_smem *mem);
  31. void msm_smem_delete_client(void *clt);
  32. int msm_smem_cache_operations(void *clt, struct msm_smem *mem,
  33. enum smem_cache_ops);
  34. struct msm_smem *msm_smem_user_to_kernel(void *clt, int fd, u32 offset,
  35. enum hal_buffer buffer_type);
  36. int msm_smem_get_domain_partition(void *clt, u32 flags, enum hal_buffer
  37. buffer_type, int *domain_num, int *partition_num);
  38. #endif