cam_ope_context.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2019-2021, The Linux Foundation. All rights reserved.
  4. */
  5. #ifndef _CAM_OPE_CONTEXT_H_
  6. #define _CAM_OPE_CONTEXT_H_
  7. #include "cam_context.h"
  8. #define OPE_CTX_MAX 32
  9. /**
  10. * struct cam_ope_context - ope context
  11. * @base: ope context object
  12. * @state_machine: state machine for OPE context
  13. * @req_base: common request structure
  14. * @state: ope context state
  15. * @ctxt_to_hw_map: context to FW handle mapping
  16. */
  17. struct cam_ope_context {
  18. struct cam_context *base;
  19. struct cam_ctx_ops *state_machine;
  20. struct cam_ctx_request req_base[CAM_CTX_REQ_MAX];
  21. uint32_t state;
  22. void *ctxt_to_hw_map;
  23. };
  24. /**
  25. * cam_ope_context_init() - OPE context init
  26. * @ctx: Pointer to context
  27. * @hw_intf: Pointer to OPE hardware interface
  28. * @ctx_id: ID for this context
  29. * @img_iommu_hdl: IOMMU HDL for image buffers
  30. *
  31. */
  32. int cam_ope_context_init(struct cam_ope_context *ctx,
  33. struct cam_hw_mgr_intf *hw_intf, uint32_t ctx_id, int img_iommu_hdl);
  34. /**
  35. * cam_ope_context_deinit() - OPE context deinit
  36. * @ctx: Pointer to context
  37. */
  38. int cam_ope_context_deinit(struct cam_ope_context *ctx);
  39. #endif /* _CAM_OPE_CONTEXT_H_ */