sde_vm_common.h 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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. /**
  56. * sde_vm_post_acquire - handle post_acquire events with all the VM clients
  57. * @kms: handle to sde_kms
  58. */
  59. int sde_vm_post_acquire(struct sde_kms *kms);
  60. /**
  61. * sde_vm_pre_release - handle pre_release events with all the VM clients
  62. * @kms: handle to sde_kms
  63. */
  64. int sde_vm_pre_release(struct sde_kms *kms);
  65. /**
  66. * sde_vm_request_valid - check the validity of state transition request
  67. * @sde_kms: handle to sde_kms
  68. * @old_state: old crtc vm req state
  69. * @new_state: new crtc vm req state
  70. * @return: 0 on success
  71. */
  72. int sde_vm_request_valid(struct sde_kms *sde_kms,
  73. enum sde_crtc_vm_req old_state,
  74. enum sde_crtc_vm_req new_state);
  75. /**
  76. * sde_vm_msg_send - send display custom message through message queue
  77. * @sde_vm: handle to sde_vm struct
  78. * @msg: payload data
  79. * @msg_size: payload data size
  80. * @return: 0 on success
  81. */
  82. int sde_vm_msg_send(struct sde_vm *sde_vm, void *msg, size_t msg_size);
  83. #endif /* __SDE_VM_COMMON_H__ */