msm_vidc_fence.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
  4. */
  5. #ifndef __H_MSM_VIDC_FENCE_H__
  6. #define __H_MSM_VIDC_FENCE_H__
  7. #include "msm_vidc_inst.h"
  8. #include "msm_vidc_buffer.h"
  9. int msm_vidc_fence_init(struct msm_vidc_inst *inst);
  10. void msm_vidc_fence_deinit(struct msm_vidc_inst *inst);
  11. #define call_fence_op(c, op, ...) \
  12. (((c) && (c)->fence_ops && (c)->fence_ops->op) ? \
  13. ((c)->fence_ops->op(__VA_ARGS__)) : 0)
  14. struct msm_vidc_fence_ops {
  15. int (*fence_register)(struct msm_vidc_core *core);
  16. int (*fence_deregister)(struct msm_vidc_core *core);
  17. struct msm_vidc_fence *(*fence_create)(struct msm_vidc_inst *inst);
  18. int (*fence_create_fd)(struct msm_vidc_inst *inst,
  19. struct msm_vidc_fence *fence);
  20. void (*fence_destroy)(struct msm_vidc_inst *inst,
  21. u64 fence_id);
  22. int (*fence_signal)(struct msm_vidc_inst *inst,
  23. u64 fence_id);
  24. void (*fence_recover)(struct msm_vidc_core *core);
  25. };
  26. const struct msm_vidc_fence_ops *get_dma_fence_ops(void);
  27. #endif // __H_MSM_VIDC_FENCE_H__