msm_cvp_synx.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
  4. */
  5. #ifndef _MSM_CVP_SYNX_H_
  6. #define _MSM_CVP_SYNX_H_
  7. #include <linux/types.h>
  8. #include <media/msm_eva_private.h>
  9. #include "cvp_comm_def.h"
  10. struct cvp_fence_queue {
  11. struct mutex lock;
  12. enum queue_state state;
  13. enum op_mode mode;
  14. struct list_head wait_list;
  15. wait_queue_head_t wq;
  16. struct list_head sched_list;
  17. };
  18. struct cvp_fence_type {
  19. s32 h_synx;
  20. u32 secure_key;
  21. };
  22. struct cvp_fence_command {
  23. struct list_head list;
  24. u64 frame_id;
  25. enum op_mode mode;
  26. u32 signature;
  27. u32 num_fences;
  28. u32 output_index;
  29. u32 type;
  30. u32 synx[MAX_HFI_FENCE_SIZE/2];
  31. struct cvp_hfi_cmd_session_hdr *pkt;
  32. };
  33. enum cvp_synx_type {
  34. CVP_UINIT_SYNX,
  35. CVP_INPUT_SYNX,
  36. CVP_OUTPUT_SYNX,
  37. CVP_INVALID_SYNX,
  38. };
  39. int cvp_import_synx(struct msm_cvp_inst *inst, struct cvp_fence_command *fc,
  40. u32 *fence);
  41. int cvp_release_synx(struct msm_cvp_inst *inst, struct cvp_fence_command *fc);
  42. int cvp_cancel_synx(struct msm_cvp_inst *inst, enum cvp_synx_type type,
  43. struct cvp_fence_command *fc, int synx_state);
  44. int cvp_synx_ops(struct msm_cvp_inst *inst, enum cvp_synx_type type,
  45. struct cvp_fence_command *fc, u32 *synx_state);
  46. void cvp_dump_fence_queue(struct msm_cvp_inst *inst);
  47. #endif