msm_cvp_synx.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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 msm_cvp_core;
  11. struct cvp_fence_queue {
  12. struct mutex lock;
  13. enum queue_state state;
  14. enum op_mode mode;
  15. struct list_head wait_list;
  16. wait_queue_head_t wq;
  17. struct list_head sched_list;
  18. };
  19. struct cvp_fence_type {
  20. s32 h_synx;
  21. u32 secure_key;
  22. };
  23. struct cvp_fence_command {
  24. struct list_head list;
  25. u64 frame_id;
  26. enum op_mode mode;
  27. u32 signature;
  28. u32 num_fences;
  29. u32 output_index;
  30. u32 type;
  31. u32 synx[MAX_HFI_FENCE_SIZE/2];
  32. struct cvp_hfi_cmd_session_hdr *pkt;
  33. };
  34. enum cvp_synx_type {
  35. CVP_UINIT_SYNX,
  36. CVP_INPUT_SYNX,
  37. CVP_OUTPUT_SYNX,
  38. CVP_INVALID_SYNX,
  39. };
  40. struct msm_cvp_synx_ops {
  41. int (*cvp_sess_init_synx)(struct msm_cvp_inst *inst);
  42. int (*cvp_sess_deinit_synx)(struct msm_cvp_inst *inst);
  43. int (*cvp_release_synx)(struct msm_cvp_inst *inst,
  44. struct cvp_fence_command *fc);
  45. int (*cvp_import_synx)(struct msm_cvp_inst *inst,
  46. struct cvp_fence_command *fc,
  47. u32 *fence);
  48. int (*cvp_synx_ops)(struct msm_cvp_inst *inst,
  49. enum cvp_synx_type type,
  50. struct cvp_fence_command *fc,
  51. u32 *synx_state);
  52. int (*cvp_cancel_synx)(struct msm_cvp_inst *inst,
  53. enum cvp_synx_type type,
  54. struct cvp_fence_command *fc,
  55. int synx_state);
  56. void (*cvp_dump_fence_queue)(struct msm_cvp_inst *inst);
  57. };
  58. void cvp_synx_ftbl_init(struct msm_cvp_core *core);
  59. #endif