Show a patch.

GET /api/1.1/patches/3531/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 3531,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/3531/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/3531/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/1.1/projects/1/?format=api",
        "name": "libcamera",
        "link_name": "libcamera",
        "list_id": "libcamera_core",
        "list_email": "libcamera-devel@lists.libcamera.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": ""
    },
    "msgid": "<20200424215304.558317-14-jacopo@jmondi.org>",
    "date": "2020-04-24T21:53:04",
    "name": "[libcamera-devel,v3,13/13] libcamera: ipa: Add support for CameraSensorInfo",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "966e4412464d6b89b30e5c6336095d56d83bfb58",
    "submitter": {
        "id": 3,
        "url": "https://patchwork.libcamera.org/api/1.1/people/3/?format=api",
        "name": "Jacopo Mondi",
        "email": "jacopo@jmondi.org"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/3531/mbox/",
    "series": [
        {
            "id": 822,
            "url": "https://patchwork.libcamera.org/api/1.1/series/822/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=822",
            "date": "2020-04-24T21:52:51",
            "name": "libcamera: Add CameraSensorInfo",
            "version": 3,
            "mbox": "https://patchwork.libcamera.org/series/822/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/3531/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/3531/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<jacopo@jmondi.org>",
        "Received": [
            "from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net\n\t[217.70.183.195])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 67DE762F5E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 24 Apr 2020 23:50:17 +0200 (CEST)",
            "from uno.homenet.telecomitalia.it\n\t(host240-55-dynamic.3-87-r.retail.telecomitalia.it [87.3.55.240])\n\t(Authenticated sender: jacopo@jmondi.org)\n\tby relay3-d.mail.gandi.net (Postfix) with ESMTPSA id 3367A60002;\n\tFri, 24 Apr 2020 21:50:16 +0000 (UTC)"
        ],
        "X-Originating-IP": "87.3.55.240",
        "From": "Jacopo Mondi <jacopo@jmondi.org>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Fri, 24 Apr 2020 23:53:04 +0200",
        "Message-Id": "<20200424215304.558317-14-jacopo@jmondi.org>",
        "X-Mailer": "git-send-email 2.26.1",
        "In-Reply-To": "<20200424215304.558317-1-jacopo@jmondi.org>",
        "References": "<20200424215304.558317-1-jacopo@jmondi.org>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v3 13/13] libcamera: ipa: Add support for\n\tCameraSensorInfo",
        "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": "Fri, 24 Apr 2020 21:50:17 -0000"
    },
    "content": "Add support for camera sensor information in the libcamera IPA protocol.\n\nDefine a new 'struct ipa_sensor_info' structure in the IPA context and\nuse it to perform translation between the C and the C++ API.\n\nUpdate the IPAInterface::configure() operation to accept a new\nCameraSensorInfo parameter and port all users of that function to\nthe new interface.\n\nSigned-off-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n include/ipa/ipa_interface.h                 | 21 +++++++-\n src/ipa/libipa/ipa_interface_wrapper.cpp    | 19 ++++++-\n src/ipa/libipa/ipa_interface_wrapper.h      |  1 +\n src/ipa/rkisp1/rkisp1.cpp                   | 13 ++++-\n src/ipa/vimc/vimc.cpp                       |  4 +-\n src/libcamera/include/ipa_context_wrapper.h |  4 +-\n src/libcamera/ipa_context_wrapper.cpp       | 24 +++++++--\n src/libcamera/ipa_interface.cpp             | 60 +++++++++++++++++++++\n src/libcamera/pipeline/rkisp1/rkisp1.cpp    |  9 +++-\n src/libcamera/proxy/ipa_proxy_linux.cpp     |  4 +-\n src/libcamera/proxy/ipa_proxy_thread.cpp    |  9 ++--\n test/ipa/ipa_wrappers_test.cpp              | 21 +++++++-\n 12 files changed, 173 insertions(+), 16 deletions(-)",
    "diff": "diff --git a/include/ipa/ipa_interface.h b/include/ipa/ipa_interface.h\nindex e65844bc7b34..a7acc09c4715 100644\n--- a/include/ipa/ipa_interface.h\n+++ b/include/ipa/ipa_interface.h\n@@ -18,6 +18,22 @@ struct ipa_context {\n \tconst struct ipa_context_ops *ops;\n };\n \n+struct ipa_sensor_info {\n+#define CAMERA_SENSOR_NAME_LEN 32\n+\tchar name[CAMERA_SENSOR_NAME_LEN];\n+\tuint8_t bits_per_pixel;\n+\tuint32_t active_area_width;\n+\tuint32_t active_area_height;\n+\tint32_t analog_crop_left;\n+\tint32_t analog_crop_top;\n+\tuint32_t analog_crop_width;\n+\tuint32_t analog_crop_height;\n+\tuint32_t output_width;\n+\tuint32_t output_height;\n+\tuint32_t pixel_clock;\n+\tuint32_t line_length;\n+};\n+\n struct ipa_stream {\n \tunsigned int id;\n \tunsigned int pixel_format;\n@@ -70,6 +86,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@@ -96,6 +113,7 @@ struct ipa_context *ipaCreate();\n #include <libcamera/geometry.h>\n #include <libcamera/signal.h>\n \n+#include \"camera_sensor.h\"\n #include \"v4l2_controls.h\"\n \n namespace libcamera {\n@@ -125,7 +143,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;\ndiff --git a/src/ipa/libipa/ipa_interface_wrapper.cpp b/src/ipa/libipa/ipa_interface_wrapper.cpp\nindex f50f93a0185a..049b9dd1eefc 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@@ -111,6 +112,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@@ -120,6 +122,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.name = sensor_info->name;\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_width,\n+\t\t\t\t  sensor_info->output_height, };\n+\tsensorInfo.pixelClock = sensor_info->pixel_clock;\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@@ -145,7 +162,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,\ndiff --git a/src/ipa/libipa/ipa_interface_wrapper.h b/src/ipa/libipa/ipa_interface_wrapper.h\nindex e4bc6dd4535d..febd6e66d0c4 100644\n--- a/src/ipa/libipa/ipa_interface_wrapper.h\n+++ b/src/ipa/libipa/ipa_interface_wrapper.h\n@@ -30,6 +30,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,\ndiff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp\nindex acbbe58c7a2e..8b081359afff 100644\n--- a/src/ipa/rkisp1/rkisp1.cpp\n+++ b/src/ipa/rkisp1/rkisp1.cpp\n@@ -22,6 +22,7 @@\n #include <libcamera/request.h>\n #include <libipa/ipa_interface_wrapper.h>\n \n+#include \"camera_sensor.h\"\n #include \"log.h\"\n #include \"utils.h\"\n \n@@ -36,7 +37,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 +68,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+ * befor 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())\ndiff --git a/src/ipa/vimc/vimc.cpp b/src/ipa/vimc/vimc.cpp\nindex d2267e11737f..b8aadd8588cb 100644\n--- a/src/ipa/vimc/vimc.cpp\n+++ b/src/ipa/vimc/vimc.cpp\n@@ -19,6 +19,7 @@\n \n #include <libipa/ipa_interface_wrapper.h>\n \n+#include \"camera_sensor.h\"\n #include \"log.h\"\n \n namespace libcamera {\n@@ -36,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 {}\ndiff --git a/src/libcamera/include/ipa_context_wrapper.h b/src/libcamera/include/ipa_context_wrapper.h\nindex 0a48bfe732c8..e11e7b6a894d 100644\n--- a/src/libcamera/include/ipa_context_wrapper.h\n+++ b/src/libcamera/include/ipa_context_wrapper.h\n@@ -9,6 +9,7 @@\n \n #include <ipa/ipa_interface.h>\n \n+#include \"camera_sensor.h\"\n #include \"control_serializer.h\"\n \n namespace libcamera {\n@@ -22,7 +23,8 @@ public:\n \tint init() 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;\ndiff --git a/src/libcamera/ipa_context_wrapper.cpp b/src/libcamera/ipa_context_wrapper.cpp\nindex ab6ce396b88a..b1ff83aa8be8 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@@ -104,17 +105,34 @@ 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+\tstrncpy(sensor_info.name, sensorInfo.name.c_str(),\n+\t\tsensorInfo.name.length());\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_width = sensorInfo.outputSize.width;\n+\tsensor_info.output_height = sensorInfo.outputSize.height;\n+\tsensor_info.pixel_clock = sensorInfo.pixelClock;\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@@ -154,7 +172,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 \ndiff --git a/src/libcamera/ipa_interface.cpp b/src/libcamera/ipa_interface.cpp\nindex 890d4340e4f3..22a3567bc1d0 100644\n--- a/src/libcamera/ipa_interface.cpp\n+++ b/src/libcamera/ipa_interface.cpp\n@@ -92,6 +92,65 @@\n  * \\brief The IPA context operations\n  */\n \n+/**\n+ * \\struct ipa_sensor_info\n+ * \\brief Camera sensor information for the IPA context operations\n+ * \\sa libcamera::CameraSensorInfo\n+ *\n+ * \\def CAMERA_SENSOR_NAME_LEN\n+ * \\brief The camera sensor name maximum length\n+ *\n+ * \\var ipa_sensor_info::name\n+ * \\brief The camera sensor 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::analog_crop_left\n+ * \\brief The horizontal displacement from the active area top-left corner of\n+ * the cropped portion of the pixel array matrix\n+ * \\sa libcamera::CameraSensorInfo::analogCrop\n+ *\n+ * \\var ipa_sensor_info::analog_crop_top\n+ * \\brief The vertical displacement from the active area top-left corner of\n+ * the cropped portion of the pixel array matrix\n+ * \\sa libcamera::CameraSensorInfo::analogCrop\n+ *\n+ * \\var ipa_sensor_info::analog_crop_width\n+ * \\brief The horizontal size of the cropped portion of the pixel array matrix\n+ * \\sa libcamera::CameraSensorInfo::analogCrop\n+ *\n+ * \\var ipa_sensor_info::analog_crop_height\n+ * \\brief The vertical size of the cropped portion of the pixel array matrix\n+ * \\sa libcamera::CameraSensorInfo::analogCrop\n+ *\n+ * \\var ipa_sensor_info::output_width\n+ * \\brief The horizontal size of the output image\n+ * \\sa libcamera::CameraSensorInfo::outputSize\n+ *\n+ * \\var ipa_sensor_info::output_height\n+ * \\brief The vertical size of the output image\n+ * \\sa libcamera::CameraSensorInfo::outputSize\n+ *\n+ * \\var ipa_sensor_info::pixel_clock\n+ * \\brief the pixel clock out frequency in Hz\n+ * \\sa libcamera::CameraSensorInfo::pixelClock\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@@ -447,6 +506,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  *\ndiff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\nindex f42264361785..169492e8313f 100644\n--- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n+++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n@@ -822,6 +822,13 @@ 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\tLOG(RkISP1, Info) << \"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 +838,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 }\ndiff --git a/src/libcamera/proxy/ipa_proxy_linux.cpp b/src/libcamera/proxy/ipa_proxy_linux.cpp\nindex 2aa80b946704..54b1abc4727b 100644\n--- a/src/libcamera/proxy/ipa_proxy_linux.cpp\n+++ b/src/libcamera/proxy/ipa_proxy_linux.cpp\n@@ -10,6 +10,7 @@\n #include <ipa/ipa_interface.h>\n #include <ipa/ipa_module_info.h>\n \n+#include \"camera_sensor.h\"\n #include \"ipa_module.h\"\n #include \"ipa_proxy.h\"\n #include \"ipc_unixsocket.h\"\n@@ -29,7 +30,8 @@ public:\n \tint init() 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 {}\ndiff --git a/src/libcamera/proxy/ipa_proxy_thread.cpp b/src/libcamera/proxy/ipa_proxy_thread.cpp\nindex 368ccca1cf60..b06734371b39 100644\n--- a/src/libcamera/proxy/ipa_proxy_thread.cpp\n+++ b/src/libcamera/proxy/ipa_proxy_thread.cpp\n@@ -10,6 +10,7 @@\n #include <ipa/ipa_interface.h>\n #include <ipa/ipa_module_info.h>\n \n+#include \"camera_sensor.h\"\n #include \"ipa_context_wrapper.h\"\n #include \"ipa_module.h\"\n #include \"ipa_proxy.h\"\n@@ -29,7 +30,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 +128,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)\ndiff --git a/test/ipa/ipa_wrappers_test.cpp b/test/ipa/ipa_wrappers_test.cpp\nindex fae1d56b67c7..2cd10f981ecc 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@@ -60,9 +61,19 @@ 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 sizes: (\"\n+\t\t\t     << sensorInfo.outputSize.width << \"x\"\n+\t\t\t     << sensorInfo.outputSize.height << \")\" << endl;\n+\t\t\treturn report(Op_configure, TestFail);\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@@ -287,13 +298,19 @@ protected:\n \t\tint ret;\n \n \t\t/* Test configure(). */\n+\t\tCameraSensorInfo sensorInfo = { \"sensor\", 8,\n+\t\t\t\t\t\t{ 2576, 1956 },\n+\t\t\t\t\t\t{ 8, 8, 2560, 1940 },\n+\t\t\t\t\t\t{ 2560, 1940 },\n+\t\t\t\t\t\t96000000,\n+\t\t\t\t\t\t2918, };\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 \n",
    "prefixes": [
        "libcamera-devel",
        "v3",
        "13/13"
    ]
}