msm_cvp.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2018-2021, The Linux Foundation. All rights reserved.
  4. */
  5. #ifndef _MSM_CVP_H_
  6. #define _MSM_CVP_H_
  7. #include "msm_cvp_internal.h"
  8. #include "msm_cvp_common.h"
  9. #include "msm_cvp_clocks.h"
  10. #include "msm_cvp_debug.h"
  11. #include "msm_cvp_dsp.h"
  12. #include "eva_shared_def.h"
  13. static inline bool is_buf_param_valid(u32 buf_num, u32 offset)
  14. {
  15. int max_buf_num;
  16. max_buf_num = sizeof(struct eva_kmd_hfi_packet) /
  17. sizeof(struct cvp_buf_type);
  18. if (buf_num > max_buf_num)
  19. return false;
  20. if ((offset * sizeof(u32) + buf_num * sizeof(struct cvp_buf_type)) >
  21. sizeof(struct eva_kmd_hfi_packet))
  22. return false;
  23. return true;
  24. }
  25. int msm_cvp_handle_syscall(struct msm_cvp_inst *inst, struct eva_kmd_arg *arg);
  26. int msm_cvp_session_init(struct msm_cvp_inst *inst);
  27. int msm_cvp_session_deinit(struct msm_cvp_inst *inst);
  28. int msm_cvp_session_queue_stop(struct msm_cvp_inst *inst);
  29. int msm_cvp_session_create(struct msm_cvp_inst *inst);
  30. int msm_cvp_session_delete(struct msm_cvp_inst *inst);
  31. int msm_cvp_session_start(struct msm_cvp_inst *inst, struct eva_kmd_arg *arg);
  32. int msm_cvp_session_stop(struct msm_cvp_inst *inst, struct eva_kmd_arg *arg);
  33. int msm_cvp_get_session_info(struct msm_cvp_inst *inst, u32 *session);
  34. int msm_cvp_update_power(struct msm_cvp_inst *inst);
  35. int cvp_clean_session_queues(struct msm_cvp_inst *inst);
  36. #endif