sde_vm_common.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2020, The Linux Foundation. All rights reserved.
  4. */
  5. #ifndef __SDE_VM_COMMON_H__
  6. #define __SDE_VM_COMMON_H__
  7. #include <linux/haven/hh_rm_drv.h>
  8. #include "sde_vm.h"
  9. #define SDE_VM_MEM_LABEL 0x11
  10. /**
  11. * sde_vm_populate_vmid - create and populate the rm vmid desc structure with
  12. * the given vmid
  13. * @vmid: vmid of the destination vm
  14. * @return: populated hh_notify_vmid_desc structure
  15. */
  16. struct hh_notify_vmid_desc *sde_vm_populate_vmid(hh_vmid_t vmid);
  17. /**
  18. * sde_vm_populate_acl - create and populate the access control list structure
  19. * for the given vm name
  20. * @vm_name: vm name enum published by the RM driver
  21. * @return: populated hh_acl_desc structure
  22. */
  23. struct hh_acl_desc *sde_vm_populate_acl(enum hh_vm_names vm_name);
  24. /**
  25. * sde_vm_populate_sgl - create and populate the scatter/gather list structure
  26. * with the given io memory list
  27. * @io_res: io resource list containing the io memory
  28. * @return: populated hh_sgl_desc structure
  29. */
  30. struct hh_sgl_desc *sde_vm_populate_sgl(struct msm_io_res *io_res);
  31. /**
  32. * sde_vm_populate_irq - create and populate the hw irq descriptor structure
  33. * with the given hw irq lines
  34. * @io_res: io resource list containing the irq numbers
  35. * @return: populated sde_vm_irq_desc structure
  36. */
  37. struct sde_vm_irq_desc *sde_vm_populate_irq(struct msm_io_res *io_res);
  38. /**
  39. * sde_vm_free_irq - free up the irq description structure
  40. * @irq_desc: handle to irq descriptor
  41. */
  42. void sde_vm_free_irq(struct sde_vm_irq_desc *irq_desc);
  43. /**
  44. * sde_vm_get_resources - collect io resource from all the VM clients
  45. * @sde_kms: handle to sde_kms
  46. * @io_res: pointer to msm_io_res structure to populate the resources
  47. * @return: 0 on success.
  48. */
  49. int sde_vm_get_resources(struct sde_kms *sde_kms, struct msm_io_res *io_res);
  50. /**
  51. * sde_vm_free_resources - free up the io resource list
  52. * @io_res: pointer to msm_io_res structure
  53. */
  54. void sde_vm_free_resources(struct msm_io_res *io_res);
  55. #endif /* __SDE_VM_COMMON_H__ */