msm_cvp_synx.h 1.7 KB

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