cam_icp_context.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2017-2021, The Linux Foundation. All rights reserved.
  4. * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
  5. */
  6. #ifndef _CAM_ICP_CONTEXT_H_
  7. #define _CAM_ICP_CONTEXT_H_
  8. #include "cam_context.h"
  9. /**
  10. * struct cam_icp_context - icp context
  11. * @base: icp context object
  12. * @state_machine: state machine for ICP context
  13. * @req_base: common request structure
  14. * @state: icp context state
  15. * @ctxt_to_hw_map: context to FW handle mapping
  16. */
  17. struct cam_icp_context {
  18. struct cam_context *base;
  19. struct cam_ctx_ops *state_machine;
  20. struct cam_ctx_request req_base[CAM_CTX_ICP_REQ_MAX];
  21. uint32_t state;
  22. void *ctxt_to_hw_map;
  23. };
  24. /**
  25. * cam_icp_context_init() - ICP context init
  26. * @ctx: Pointer to context
  27. * @hw_intf: Pointer to ICP hardware interface
  28. * @ctx_id: ID for this context
  29. * @img_iommu_hdl: IOMMU HDL for image buffers
  30. * @icp_dev_name: name of the icp subdevice
  31. */
  32. int cam_icp_context_init(struct cam_icp_context *ctx,
  33. struct cam_hw_mgr_intf *hw_intf, uint32_t ctx_id,
  34. int img_iommu_hdl, const char *icp_dev_name);
  35. /**
  36. * cam_icp_context_deinit() - ICP context deinit
  37. * @ctx: Pointer to context
  38. */
  39. int cam_icp_context_deinit(struct cam_icp_context *ctx);
  40. #endif /* _CAM_ICP_CONTEXT_H_ */