sde_vm_event.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2020, The Linux Foundation. All rights reserved.
  4. */
  5. #ifndef __SDE_VM_EVENT_H__
  6. #define __SDE_VM_EVENT_H__
  7. #include <linux/list.h>
  8. #include <linux/types.h>
  9. #include <linux/slab.h>
  10. #include <linux/platform_device.h>
  11. #include <drm/drm_device.h>
  12. /**
  13. * struct msm_vm_ops - hooks for communication with vm clients
  14. * @vm_pre_hw_release: invoked before releasing the HW
  15. * @vm_post_hw_acquire: invoked before pushing the first commit
  16. * @vm_check: invoked to check the readiness of the vm_clients
  17. * before releasing the HW
  18. */
  19. struct msm_vm_ops {
  20. int (*vm_pre_hw_release)(void *priv_data);
  21. int (*vm_post_hw_acquire)(void *priv_data);
  22. int (*vm_check)(void *priv_data);
  23. };
  24. /**
  25. * msm_vm_client_entry - defines the vm client info
  26. * @ops: client vm_ops
  27. * @dev: clients device id. Used in unregister
  28. * @data: client custom data
  29. * @list: linked list entry
  30. */
  31. struct msm_vm_client_entry {
  32. struct msm_vm_ops ops;
  33. struct device *dev;
  34. void *data;
  35. struct list_head list;
  36. };
  37. /**
  38. * msm_register_vm_event - api for display dependent drivers(clients) to
  39. * register for vm events
  40. * @dev: msm device
  41. * @client_dev: client device
  42. * @ops: vm event hooks
  43. * @priv_data: client custom data
  44. */
  45. int msm_register_vm_event(struct device *dev, struct device *client_dev,
  46. struct msm_vm_ops *ops, void *priv_data);
  47. /**
  48. * msm_unregister_vm_event - api for display dependent drivers(clients) to
  49. * unregister from vm events
  50. * @dev: msm device
  51. * @client_dev: client device
  52. */
  53. void msm_unregister_vm_event(struct device *dev, struct device *client_dev);
  54. #endif //__SDE_VM_EVENT_H__