From d7e0985ce13d094608bec9b496873ae0361ea87d Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Sat, 28 Sep 2019 06:41:22 +0300 Subject: ipa: Allow short-circuiting the ipa_context_ops MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When an IPA module is loaded without isolation and implements the IPAInterface internally, going through ipa_context_ops is a waste of time. Add an operation to retrieve the IPAInterface, and use it directly in the IPAContextWrapper. For debugging purpose, make it possible to forcing usage of the C API by defining the LIBCAMERA_IPA_FORCE_C_API environment variable. Signed-off-by: Laurent Pinchart Signed-off-by: Jacopo Mondi Reviewed-by: Jacopo Mondi Reviewed-by: Niklas Söderlund Reviewed-by: Kieran Bingham --- src/libcamera/ipa_interface.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/libcamera/ipa_interface.cpp') diff --git a/src/libcamera/ipa_interface.cpp b/src/libcamera/ipa_interface.cpp index cb2767a0..715e7972 100644 --- a/src/libcamera/ipa_interface.cpp +++ b/src/libcamera/ipa_interface.cpp @@ -62,6 +62,12 @@ * handlers to communicate with IPA modules. IPA modules may use the * IPAInterface API internally if they want to benefit from the data and helper * classes offered by libcamera. + * + * When an IPA module is loaded directly into the libcamera process and uses + * the IPAInterface API internally, short-circuiting the path to the + * ipa_context_ops and back to IPAInterface is desirable. To support this, IPA + * modules may implement the ipa_context_ops::get_interface function to return a + * pointer to their internal IPAInterface. */ /** @@ -209,6 +215,18 @@ * \param[in] ctx The IPA context */ +/** + * \var ipa_context_ops::get_interface + * \brief Retrieve the IPAInterface implemented by the ipa_context (optional) + * \param[in] ctx The IPA context + * + * IPA modules may implement this function to expose their internal + * IPAInterface, if any. When implemented, libcamera may at its sole discretion + * call it and then bypass the ipa_context_ops API by calling the IPAInterface + * methods directly. IPA modules shall still implement and support the full + * ipa_context_ops API. + */ + /** * \var ipa_context_ops::init * \brief Initialise the IPA context -- cgit v1.2.1