msm_cvp.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. static inline bool is_buf_param_valid(u32 buf_num, u32 offset)
  13. {
  14. int max_buf_num;
  15. max_buf_num = sizeof(struct eva_kmd_hfi_packet) /
  16. sizeof(struct cvp_buf_type);
  17. if (buf_num > max_buf_num)
  18. return false;
  19. if ((offset + buf_num * sizeof(struct cvp_buf_type)) >
  20. sizeof(struct eva_kmd_hfi_packet))
  21. return false;
  22. return true;
  23. }
  24. int msm_cvp_handle_syscall(struct msm_cvp_inst *inst, struct eva_kmd_arg *arg);
  25. int msm_cvp_session_init(struct msm_cvp_inst *inst);
  26. int msm_cvp_session_deinit(struct msm_cvp_inst *inst);
  27. int msm_cvp_session_queue_stop(struct msm_cvp_inst *inst);
  28. int msm_cvp_session_create(struct msm_cvp_inst *inst);
  29. int msm_cvp_session_delete(struct msm_cvp_inst *inst);
  30. int msm_cvp_get_session_info(struct msm_cvp_inst *inst, u32 *session);
  31. int msm_cvp_update_power(struct msm_cvp_inst *inst);
  32. int cvp_clean_session_queues(struct msm_cvp_inst *inst);
  33. #endif