[{"id":4622,"web_url":"https://patchwork.libcamera.org/comment/4622/","msgid":"<20200428165842.GH5859@pendragon.ideasonboard.com>","date":"2020-04-28T16:58:42","subject":"Re: [libcamera-devel] [PATCH v5 7/7] libcamera: ipa: Add support\n\tfor CameraSensorInfo","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Jacopo,\n\nThank you for the patch.\n\nOn Tue, Apr 28, 2020 at 11:19:34AM +0200, Jacopo Mondi wrote:\n> Add support for camera sensor information in the libcamera IPA protocol.\n> \n> Define a new 'struct ipa_sensor_info' structure in the IPA context and\n> use it to perform translation between the C and the C++ API.\n> \n> Update the IPAInterface::configure() operation to accept a new\n> CameraSensorInfo parameter and port all users of that function to\n> the new interface.\n> \n> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> ---\n>  include/ipa/ipa_interface.h                 | 27 +++++++-\n>  src/ipa/libipa/ipa_interface_wrapper.cpp    | 19 +++++-\n>  src/ipa/libipa/ipa_interface_wrapper.h      |  1 +\n>  src/ipa/rkisp1/rkisp1.cpp                   | 12 +++-\n>  src/ipa/vimc/vimc.cpp                       |  3 +-\n>  src/libcamera/include/ipa_context_wrapper.h |  3 +-\n>  src/libcamera/ipa_context_wrapper.cpp       | 23 ++++++-\n>  src/libcamera/ipa_interface.cpp             | 73 +++++++++++++++++++++\n>  src/libcamera/pipeline/rkisp1/rkisp1.cpp    | 10 ++-\n>  src/libcamera/proxy/ipa_proxy_linux.cpp     |  3 +-\n>  src/libcamera/proxy/ipa_proxy_thread.cpp    |  8 ++-\n>  test/ipa/ipa_wrappers_test.cpp              | 22 ++++++-\n>  12 files changed, 188 insertions(+), 16 deletions(-)\n> \n> diff --git a/include/ipa/ipa_interface.h b/include/ipa/ipa_interface.h\n> index ef3d6507b692..a2d5e3dd1f51 100644\n> --- a/include/ipa/ipa_interface.h\n> +++ b/include/ipa/ipa_interface.h\n> @@ -22,6 +22,27 @@ struct ipa_settings {\n>  \tconst char *configuration_file;\n>  };\n>  \n> +struct ipa_sensor_info {\n> +\tconst char *model;\n> +\tuint8_t bits_per_pixel;\n> +\tstruct {\n> +\t\tuint32_t width;\n> +\t\tuint32_t height;\n> +\t} active_area;\n> +\tstruct {\n> +\t\tint32_t left;\n> +\t\tint32_t top;\n> +\t\tuint32_t width;\n> +\t\tuint32_t height;\n> +\t} analog_crop;\n> +\tstruct {\n> +\t\tuint32_t width;\n> +\t\tuint32_t height;\n> +\t} output_size;\n> +\tuint64_t pixel_rate;\n> +\tuint32_t line_length;\n> +};\n> +\n>  struct ipa_stream {\n>  \tunsigned int id;\n>  \tunsigned int pixel_format;\n> @@ -75,6 +96,7 @@ struct ipa_context_ops {\n>  \t\t\t\t   const struct ipa_callback_ops *callbacks,\n>  \t\t\t\t   void *cb_ctx);\n>  \tvoid (*configure)(struct ipa_context *ctx,\n> +\t\t\t  const struct ipa_sensor_info *sensor_info,\n>  \t\t\t  const struct ipa_stream *streams,\n>  \t\t\t  unsigned int num_streams,\n>  \t\t\t  const struct ipa_control_info_map *maps,\n> @@ -125,6 +147,8 @@ struct IPAOperationData {\n>  \tstd::vector<ControlList> controls;\n>  };\n>  \n> +struct CameraSensorInfo;\n> +\n>  class IPAInterface\n>  {\n>  public:\n> @@ -134,7 +158,8 @@ public:\n>  \tvirtual int start() = 0;\n>  \tvirtual void stop() = 0;\n>  \n> -\tvirtual void configure(const std::map<unsigned int, IPAStream> &streamConfig,\n> +\tvirtual void configure(const CameraSensorInfo &sensorInfo,\n> +\t\t\t       const std::map<unsigned int, IPAStream> &streamConfig,\n>  \t\t\t       const std::map<unsigned int, const ControlInfoMap &> &entityControls) = 0;\n>  \n>  \tvirtual void mapBuffers(const std::vector<IPABuffer> &buffers) = 0;\n> diff --git a/src/ipa/libipa/ipa_interface_wrapper.cpp b/src/ipa/libipa/ipa_interface_wrapper.cpp\n> index 9596cb20cd66..21d8c98bddee 100644\n> --- a/src/ipa/libipa/ipa_interface_wrapper.cpp\n> +++ b/src/ipa/libipa/ipa_interface_wrapper.cpp\n> @@ -15,6 +15,7 @@\n>  #include <ipa/ipa_interface.h>\n>  \n>  #include \"byte_stream_buffer.h\"\n> +#include \"camera_sensor.h\"\n>  \n>  /**\n>   * \\file ipa_interface_wrapper.h\n> @@ -115,6 +116,7 @@ void IPAInterfaceWrapper::register_callbacks(struct ipa_context *_ctx,\n>  }\n>  \n>  void IPAInterfaceWrapper::configure(struct ipa_context *_ctx,\n> +\t\t\t\t    const struct ipa_sensor_info *sensor_info,\n>  \t\t\t\t    const struct ipa_stream *streams,\n>  \t\t\t\t    unsigned int num_streams,\n>  \t\t\t\t    const struct ipa_control_info_map *maps,\n> @@ -124,6 +126,21 @@ void IPAInterfaceWrapper::configure(struct ipa_context *_ctx,\n>  \n>  \tctx->serializer_.reset();\n>  \n> +\t/* Translate the IPA sensor info. */\n> +\tCameraSensorInfo sensorInfo{};\n> +\tsensorInfo.model = sensor_info->model;\n> +\tsensorInfo.bitsPerPixel = sensor_info->bits_per_pixel;\n> +\tsensorInfo.activeAreaSize = { sensor_info->active_area.width,\n> +\t\t\t\t      sensor_info->active_area.height };\n> +\tsensorInfo.analogCrop = { sensor_info->analog_crop.left,\n> +\t\t\t\t  sensor_info->analog_crop.top,\n> +\t\t\t\t  sensor_info->analog_crop.width,\n> +\t\t\t\t  sensor_info->analog_crop.height };\n> +\tsensorInfo.outputSize = { sensor_info->output_size.width,\n> +\t\t\t\t  sensor_info->output_size.height };\n> +\tsensorInfo.pixelRate = sensor_info->pixel_rate;\n> +\tsensorInfo.lineLength = sensor_info->line_length;\n> +\n>  \t/* Translate the IPA stream configurations map. */\n>  \tstd::map<unsigned int, IPAStream> ipaStreams;\n>  \n> @@ -149,7 +166,7 @@ void IPAInterfaceWrapper::configure(struct ipa_context *_ctx,\n>  \t\tentityControls.emplace(id, infoMaps[id]);\n>  \t}\n>  \n> -\tctx->ipa_->configure(ipaStreams, entityControls);\n> +\tctx->ipa_->configure(sensorInfo, ipaStreams, entityControls);\n>  }\n>  \n>  void IPAInterfaceWrapper::map_buffers(struct ipa_context *_ctx,\n> diff --git a/src/ipa/libipa/ipa_interface_wrapper.h b/src/ipa/libipa/ipa_interface_wrapper.h\n> index 78ccf0f59d42..56507aafd81e 100644\n> --- a/src/ipa/libipa/ipa_interface_wrapper.h\n> +++ b/src/ipa/libipa/ipa_interface_wrapper.h\n> @@ -31,6 +31,7 @@ private:\n>  \t\t\t\t       const struct ipa_callback_ops *callbacks,\n>  \t\t\t\t       void *cb_ctx);\n>  \tstatic void configure(struct ipa_context *ctx,\n> +\t\t\t      const struct ipa_sensor_info *sensor_info,\n>  \t\t\t      const struct ipa_stream *streams,\n>  \t\t\t      unsigned int num_streams,\n>  \t\t\t      const struct ipa_control_info_map *maps,\n> diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp\n> index 9a347e527cd2..bfa88418fa7b 100644\n> --- a/src/ipa/rkisp1/rkisp1.cpp\n> +++ b/src/ipa/rkisp1/rkisp1.cpp\n> @@ -36,7 +36,8 @@ public:\n>  \tint start() override { return 0; }\n>  \tvoid stop() override {}\n>  \n> -\tvoid configure(const std::map<unsigned int, IPAStream> &streamConfig,\n> +\tvoid configure(const CameraSensorInfo &info,\n> +\t\t       const std::map<unsigned int, IPAStream> &streamConfig,\n>  \t\t       const std::map<unsigned int, const ControlInfoMap &> &entityControls) override;\n>  \tvoid mapBuffers(const std::vector<IPABuffer> &buffers) override;\n>  \tvoid unmapBuffers(const std::vector<unsigned int> &ids) override;\n> @@ -66,7 +67,14 @@ private:\n>  \tuint32_t maxGain_;\n>  };\n>  \n> -void IPARkISP1::configure(const std::map<unsigned int, IPAStream> &streamConfig,\n> +/**\n> + * \\todo The RkISP1 pipeline currently provides an empty CameraSensorInfo\n> + * if the connected sensor does not provide enough information to properly\n> + * assemble one. Make sure the reported sensor information are relevant\n> + * before accessing them.\n> + */\n> +void IPARkISP1::configure(const CameraSensorInfo &info,\n> +\t\t\t  const std::map<unsigned int, IPAStream> &streamConfig,\n>  \t\t\t  const std::map<unsigned int, const ControlInfoMap &> &entityControls)\n>  {\n>  \tif (entityControls.empty())\n> diff --git a/src/ipa/vimc/vimc.cpp b/src/ipa/vimc/vimc.cpp\n> index f29bc504d8c8..9271f2d8acff 100644\n> --- a/src/ipa/vimc/vimc.cpp\n> +++ b/src/ipa/vimc/vimc.cpp\n> @@ -37,7 +37,8 @@ public:\n>  \tint start() override;\n>  \tvoid stop() override;\n>  \n> -\tvoid configure(const std::map<unsigned int, IPAStream> &streamConfig,\n> +\tvoid configure(const CameraSensorInfo &sensorInfo,\n> +\t\t       const std::map<unsigned int, IPAStream> &streamConfig,\n>  \t\t       const std::map<unsigned int, const ControlInfoMap &> &entityControls) override {}\n>  \tvoid mapBuffers(const std::vector<IPABuffer> &buffers) override {}\n>  \tvoid unmapBuffers(const std::vector<unsigned int> &ids) override {}\n> diff --git a/src/libcamera/include/ipa_context_wrapper.h b/src/libcamera/include/ipa_context_wrapper.h\n> index 64395b4a450b..0db022ef5a1b 100644\n> --- a/src/libcamera/include/ipa_context_wrapper.h\n> +++ b/src/libcamera/include/ipa_context_wrapper.h\n> @@ -22,7 +22,8 @@ public:\n>  \tint init(const IPASettings &settings) override;\n>  \tint start() override;\n>  \tvoid stop() override;\n> -\tvoid configure(const std::map<unsigned int, IPAStream> &streamConfig,\n> +\tvoid configure(const CameraSensorInfo &sensorInfo,\n> +\t\t       const std::map<unsigned int, IPAStream> &streamConfig,\n>  \t\t       const std::map<unsigned int, const ControlInfoMap &> &entityControls) override;\n>  \n>  \tvoid mapBuffers(const std::vector<IPABuffer> &buffers) override;\n> diff --git a/src/libcamera/ipa_context_wrapper.cpp b/src/libcamera/ipa_context_wrapper.cpp\n> index 5bd5d916ccc0..0bd3a1aeca95 100644\n> --- a/src/libcamera/ipa_context_wrapper.cpp\n> +++ b/src/libcamera/ipa_context_wrapper.cpp\n> @@ -12,6 +12,7 @@\n>  #include <libcamera/controls.h>\n>  \n>  #include \"byte_stream_buffer.h\"\n> +#include \"camera_sensor.h\"\n>  #include \"utils.h\"\n>  \n>  /**\n> @@ -107,17 +108,33 @@ void IPAContextWrapper::stop()\n>  \tctx_->ops->stop(ctx_);\n>  }\n>  \n> -void IPAContextWrapper::configure(const std::map<unsigned int, IPAStream> &streamConfig,\n> +void IPAContextWrapper::configure(const CameraSensorInfo &sensorInfo,\n> +\t\t\t\t  const std::map<unsigned int, IPAStream> &streamConfig,\n>  \t\t\t\t  const std::map<unsigned int, const ControlInfoMap &> &entityControls)\n>  {\n>  \tif (intf_)\n> -\t\treturn intf_->configure(streamConfig, entityControls);\n> +\t\treturn intf_->configure(sensorInfo, streamConfig, entityControls);\n>  \n>  \tif (!ctx_)\n>  \t\treturn;\n>  \n>  \tserializer_.reset();\n>  \n> +\t/* Translate the camera sensor info. */\n> +\tstruct ipa_sensor_info sensor_info = {};\n> +\tsensor_info.model = sensorInfo.model.c_str();\n> +\tsensor_info.bits_per_pixel = sensorInfo.bitsPerPixel;\n> +\tsensor_info.active_area.width = sensorInfo.activeAreaSize.width;\n> +\tsensor_info.active_area.height = sensorInfo.activeAreaSize.height;\n> +\tsensor_info.analog_crop.left = sensorInfo.analogCrop.x;\n> +\tsensor_info.analog_crop.top = sensorInfo.analogCrop.y;\n> +\tsensor_info.analog_crop.width = sensorInfo.analogCrop.width;\n> +\tsensor_info.analog_crop.height = sensorInfo.analogCrop.height;\n> +\tsensor_info.output_size.width = sensorInfo.outputSize.width;\n> +\tsensor_info.output_size.height = sensorInfo.outputSize.height;\n> +\tsensor_info.pixel_rate = sensorInfo.pixelRate;\n> +\tsensor_info.line_length = sensorInfo.lineLength;\n> +\n>  \t/* Translate the IPA stream configurations map. */\n>  \tstruct ipa_stream c_streams[streamConfig.size()];\n>  \n> @@ -157,7 +174,7 @@ void IPAContextWrapper::configure(const std::map<unsigned int, IPAStream> &strea\n>  \t\t++i;\n>  \t}\n>  \n> -\tctx_->ops->configure(ctx_, c_streams, streamConfig.size(),\n> +\tctx_->ops->configure(ctx_, &sensor_info, c_streams, streamConfig.size(),\n>  \t\t\t     c_info_maps, entityControls.size());\n>  }\n>  \n> diff --git a/src/libcamera/ipa_interface.cpp b/src/libcamera/ipa_interface.cpp\n> index 616f20fbf54f..c890eadaf6c8 100644\n> --- a/src/libcamera/ipa_interface.cpp\n> +++ b/src/libcamera/ipa_interface.cpp\n> @@ -102,6 +102,74 @@\n>   * empty string)\n>   */\n>  \n> +/**\n> + * \\struct ipa_sensor_info\n> + * \\brief Camera sensor information for the IPA context operations\n> + * \\sa libcamera::CameraSensorInfo\n> + *\n> + * \\var ipa_sensor_info::model\n> + * \\brief The camera sensor model name\n> + * \\todo Remove this field as soon as no IPA depends on it anymore\n> + *\n> + * \\var ipa_sensor_info::bits_per_pixel\n> + * \\brief The camera sensor image format bit depth\n> + * \\sa libcamera::CameraSensorInfo::bitsPerPixel\n> + *\n> + * \\var ipa_sensor_info::active_area.width\n> + * \\brief The camera sensor pixel array active area width\n> + * \\sa libcamera::CameraSensorInfo::activeAreaSize\n> + *\n> + * \\var ipa_sensor_info::active_area.height\n> + * \\brief The camera sensor pixel array active area height\n> + * \\sa libcamera::CameraSensorInfo::activeAreaSize\n> + *\n> + * \\var ipa_sensor_info::active_area\n> + * \\brief The camera sensor pixel array active size\n> + * \\sa libcamera::CameraSensorInfo::activeAreaSize\n> + *\n> + * \\var ipa_sensor_info::analog_crop.left\n> + * \\brief The left coordinate of the analog crop rectangle, relative to the\n> + * pixel array active area\n> + * \\sa libcamera::CameraSensorInfo::analogCrop\n> + *\n> + * \\var ipa_sensor_info::analog_crop.top\n> + * \\brief The top coordinate of the analog crop rectangle, relative to the pixel\n> + * array active area\n> + * \\sa libcamera::CameraSensorInfo::analogCrop\n> + *\n> + * \\var ipa_sensor_info::analog_crop.width\n> + * \\brief The horizontal size of the analog crop rectangle\n> + * \\sa libcamera::CameraSensorInfo::analogCrop\n> + *\n> + * \\var ipa_sensor_info::analog_crop.height\n> + * \\brief The vertical size of the analog crop rectangle\n> + * \\sa libcamera::CameraSensorInfo::analogCrop\n> + *\n> + * \\var ipa_sensor_info::analog_crop\n> + * \\brief The analog crop rectangle\n> + * \\sa libcamera::CameraSensorInfo::analogCrop\n> + *\n> + * \\var ipa_sensor_info::output_size.width\n> + * \\brief The horizontal size of the output image\n> + * \\sa libcamera::CameraSensorInfo::outputSize\n> + *\n> + * \\var ipa_sensor_info::output_size.height\n> + * \\brief The vertical size of the output image\n> + * \\sa libcamera::CameraSensorInfo::outputSize\n> + *\n> + * \\var ipa_sensor_info::output_size\n> + * \\brief The size of the output image\n> + * \\sa libcamera::CameraSensorInfo::outputSize\n> + *\n> + * \\var ipa_sensor_info::pixel_rate\n> + * \\brief The number of pixel produced in a second\n> + * \\sa libcamera::CameraSensorInfo::pixelRate\n> + *\n> + * \\var ipa_sensor_info::line_length\n> + * \\brief The full line length, including blanking, in pixel units\n> + * \\sa libcamera::CameraSensorInfo::lineLength\n> + */\n> +\n>  /**\n>   * \\struct ipa_stream\n>   * \\brief Stream information for the IPA context operations\n> @@ -481,6 +549,7 @@ namespace libcamera {\n>  /**\n>   * \\fn IPAInterface::configure()\n>   * \\brief Configure the IPA stream and sensor settings\n> + * \\param[in] sensorInfo Camera sensor information\n>   * \\param[in] streamConfig Configuration of all active streams\n>   * \\param[in] entityControls Controls provided by the pipeline entities\n>   *\n> @@ -488,6 +557,10 @@ namespace libcamera {\n>   * the camera's streams and the sensor settings. The meaning of the numerical\n>   * keys in the \\a streamConfig and \\a entityControls maps is defined by the IPA\n>   * protocol.\n> + *\n> + * The \\a sensorInfo conveys information about the camera sensor settings that\n> + * the pipeline handler has selected for the configuration. The IPA may use\n> + * that information to tune its algorithms.\n>   */\n>  \n>  /**\n> diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> index fde445b99a46..1a34ffe60ab4 100644\n> --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> @@ -822,6 +822,14 @@ int PipelineHandlerRkISP1::start(Camera *camera)\n>  \tactiveCamera_ = camera;\n>  \n>  \t/* Inform IPA of stream configuration and sensor controls. */\n> +\tCameraSensorInfo sensorInfo = {};\n> +\tret = data->sensor_->sensorInfo(&sensorInfo);\n> +\tif (ret) {\n> +\t\t/* \\todo Turn this in an hard failure. */\n> +\t\tLOG(RkISP1, Warning) << \"Camera sensor information not available\";\n> +\t\tsensorInfo = {};\n> +\t}\n> +\n>  \tstd::map<unsigned int, IPAStream> streamConfig;\n>  \tstreamConfig[0] = {\n>  \t\t.pixelFormat = data->stream_.configuration().pixelFormat,\n> @@ -831,7 +839,7 @@ int PipelineHandlerRkISP1::start(Camera *camera)\n>  \tstd::map<unsigned int, const ControlInfoMap &> entityControls;\n>  \tentityControls.emplace(0, data->sensor_->controls());\n>  \n> -\tdata->ipa_->configure(streamConfig, entityControls);\n> +\tdata->ipa_->configure(sensorInfo, streamConfig, entityControls);\n>  \n>  \treturn ret;\n>  }\n> diff --git a/src/libcamera/proxy/ipa_proxy_linux.cpp b/src/libcamera/proxy/ipa_proxy_linux.cpp\n> index cd8ac824679d..9e0f44cf314f 100644\n> --- a/src/libcamera/proxy/ipa_proxy_linux.cpp\n> +++ b/src/libcamera/proxy/ipa_proxy_linux.cpp\n> @@ -29,7 +29,8 @@ public:\n>  \tint init(const IPASettings &settings) override { return 0; }\n>  \tint start() override { return 0; }\n>  \tvoid stop() override {}\n> -\tvoid configure(const std::map<unsigned int, IPAStream> &streamConfig,\n> +\tvoid configure(const CameraSensorInfo &sensorInfo,\n> +\t\t       const std::map<unsigned int, IPAStream> &streamConfig,\n>  \t\t       const std::map<unsigned int, const ControlInfoMap &> &entityControls) override {}\n>  \tvoid mapBuffers(const std::vector<IPABuffer> &buffers) override {}\n>  \tvoid unmapBuffers(const std::vector<unsigned int> &ids) override {}\n> diff --git a/src/libcamera/proxy/ipa_proxy_thread.cpp b/src/libcamera/proxy/ipa_proxy_thread.cpp\n> index be82fde34bd9..81d2d68ee715 100644\n> --- a/src/libcamera/proxy/ipa_proxy_thread.cpp\n> +++ b/src/libcamera/proxy/ipa_proxy_thread.cpp\n> @@ -29,7 +29,8 @@ public:\n>  \tint start() override;\n>  \tvoid stop() override;\n>  \n> -\tvoid configure(const std::map<unsigned int, IPAStream> &streamConfig,\n> +\tvoid configure(const CameraSensorInfo &sensorInfo,\n> +\t\t       const std::map<unsigned int, IPAStream> &streamConfig,\n>  \t\t       const std::map<unsigned int, const ControlInfoMap &> &entityControls) override;\n>  \tvoid mapBuffers(const std::vector<IPABuffer> &buffers) override;\n>  \tvoid unmapBuffers(const std::vector<unsigned int> &ids) override;\n> @@ -126,10 +127,11 @@ void IPAProxyThread::stop()\n>  \tthread_.wait();\n>  }\n>  \n> -void IPAProxyThread::configure(const std::map<unsigned int, IPAStream> &streamConfig,\n> +void IPAProxyThread::configure(const CameraSensorInfo &sensorInfo,\n> +\t\t\t       const std::map<unsigned int, IPAStream> &streamConfig,\n>  \t\t\t       const std::map<unsigned int, const ControlInfoMap &> &entityControls)\n>  {\n> -\tipa_->configure(streamConfig, entityControls);\n> +\tipa_->configure(sensorInfo, streamConfig, entityControls);\n>  }\n>  \n>  void IPAProxyThread::mapBuffers(const std::vector<IPABuffer> &buffers)\n> diff --git a/test/ipa/ipa_wrappers_test.cpp b/test/ipa/ipa_wrappers_test.cpp\n> index 21bf51a2e046..4de132123525 100644\n> --- a/test/ipa/ipa_wrappers_test.cpp\n> +++ b/test/ipa/ipa_wrappers_test.cpp\n> @@ -15,6 +15,7 @@\n>  #include <libcamera/controls.h>\n>  #include <libipa/ipa_interface_wrapper.h>\n>  \n> +#include \"camera_sensor.h\"\n>  #include \"device_enumerator.h\"\n>  #include \"ipa_context_wrapper.h\"\n>  #include \"media_device.h\"\n> @@ -66,9 +67,17 @@ public:\n>  \t\treport(Op_stop, TestPass);\n>  \t}\n>  \n> -\tvoid configure(const std::map<unsigned int, IPAStream> &streamConfig,\n> +\tvoid configure(const CameraSensorInfo &sensorInfo,\n> +\t\t       const std::map<unsigned int, IPAStream> &streamConfig,\n>  \t\t       const std::map<unsigned int, const ControlInfoMap &> &entityControls) override\n>  \t{\n> +\t\t/* Verify sensorInfo. */\n> +\t\tif (sensorInfo.outputSize.width != 2560 ||\n> +\t\t    sensorInfo.outputSize.height != 1940) {\n> +\t\t\tcerr << \"configure(): Invalid sensor info size \"\n> +\t\t\t     << sensorInfo.outputSize.toString();\n> +\t\t}\n> +\n>  \t\t/* Verify streamConfig. */\n>  \t\tif (streamConfig.size() != 2) {\n>  \t\t\tcerr << \"configure(): Invalid number of streams \"\n> @@ -293,13 +302,22 @@ protected:\n>  \t\tint ret;\n>  \n>  \t\t/* Test configure(). */\n> +\t\tCameraSensorInfo sensorInfo{\n> +\t\t\t.model = \"sensor\",\n> +\t\t\t.bitsPerPixel = 8,\n> +\t\t\t.activeAreaSize = { 2576, 1956 },\n> +\t\t\t.analogCrop = { 8, 8, 2560, 1940 },\n> +\t\t\t.outputSize = { 2560, 1940 },\n> +\t\t\t.pixelRate = 96000000,\n> +\t\t\t.lineLength = 2918,\n> +\t\t};\n>  \t\tstd::map<unsigned int, IPAStream> config{\n>  \t\t\t{ 1, { V4L2_PIX_FMT_YUYV, { 1024, 768 } } },\n>  \t\t\t{ 2, { V4L2_PIX_FMT_NV12, { 800, 600 } } },\n>  \t\t};\n>  \t\tstd::map<unsigned int, const ControlInfoMap &> controlInfo;\n>  \t\tcontrolInfo.emplace(42, subdev_->controls());\n> -\t\tret = INVOKE(configure, config, controlInfo);\n> +\t\tret = INVOKE(configure, sensorInfo, config, controlInfo);\n>  \t\tif (ret == TestFail)\n>  \t\t\treturn TestFail;\n>","headers":{"Return-Path":"<laurent.pinchart@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 0EBC360AF5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 28 Apr 2020 18:58:59 +0200 (CEST)","from pendragon.ideasonboard.com (81-175-216-236.bb.dnainternet.fi\n\t[81.175.216.236])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 6623D72C;\n\tTue, 28 Apr 2020 18:58:58 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"DmiWN9Un\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1588093138;\n\tbh=lB4x6hTAXXKDsMaIXm76db4pUhO/yll0TTXdQzFbD3M=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=DmiWN9UnmyfmGxaB+5j7CwZYEGekZcMqKEctAgvmyABo5TNAY4wwMgoSmhExWwWdr\n\tQ6DCNb63xVhHEJjyeSJfvz4bK1D9qy04Rz7eMbv8Ay44DNtMD7+6J2pE/UUuBaYTAr\n\tIw2Ct/7TbrdvGg/U6RtRzBBtU/Y90bhP80x/EsdU=","Date":"Tue, 28 Apr 2020 19:58:42 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Jacopo Mondi <jacopo@jmondi.org>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20200428165842.GH5859@pendragon.ideasonboard.com>","References":"<20200428091934.341550-1-jacopo@jmondi.org>\n\t<20200428091934.341550-7-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20200428091934.341550-7-jacopo@jmondi.org>","Subject":"Re: [libcamera-devel] [PATCH v5 7/7] libcamera: ipa: Add support\n\tfor CameraSensorInfo","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","X-List-Received-Date":"Tue, 28 Apr 2020 16:58:59 -0000"}}]