[{"id":28836,"web_url":"https://patchwork.libcamera.org/comment/28836/","msgid":"<s5ufkiotmvzmsspnu3wb6uldhys5tavtse4hhd6l2sh3lsnsy6@pxmkjw3pqndx>","date":"2024-03-04T17:50:02","subject":"Re: [PATCH/RFC 18/32] libcamera: camera_sensor: Expose the Bayer\n\torder","submitter":{"id":143,"url":"https://patchwork.libcamera.org/api/people/143/","name":"Jacopo Mondi","email":"jacopo.mondi@ideasonboard.com"},"content":"And this can be fast-tracked as well imho\n\nReviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n\nOn Fri, Mar 01, 2024 at 11:21:07PM +0200, Laurent Pinchart wrote:\n> Pipeline handlers may need to know the Bayer order produced by the\n> sensor when a Transform is applied (horizontal or vertical flip). This\n> is currently implemented manually in the Raspberry Pi pipeline handler.\n> Move the implementation to the CameraSensor class to make it usable in\n> other pipeline handlers.\n>\n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> ---\n>  include/libcamera/internal/camera_sensor.h    |  4 +-\n>  .../pipeline/rpi/common/pipeline_base.cpp     | 54 +++----------------\n>  .../pipeline/rpi/common/pipeline_base.h       |  6 +--\n>  src/libcamera/sensor/camera_sensor.cpp        | 37 ++++++++++++-\n>  4 files changed, 45 insertions(+), 56 deletions(-)\n>\n> diff --git a/include/libcamera/internal/camera_sensor.h b/include/libcamera/internal/camera_sensor.h\n> index 750d6d729cac..d05f48ebeebe 100644\n> --- a/include/libcamera/internal/camera_sensor.h\n> +++ b/include/libcamera/internal/camera_sensor.h\n> @@ -22,12 +22,12 @@\n>\n>  #include <libcamera/ipa/core_ipa_interface.h>\n>\n> +#include \"libcamera/internal/bayer_format.h\"\n>  #include \"libcamera/internal/formats.h\"\n>  #include \"libcamera/internal/v4l2_subdevice.h\"\n>\n>  namespace libcamera {\n>\n> -class BayerFormat;\n>  class CameraLens;\n>  class MediaEntity;\n>  class SensorConfiguration;\n> @@ -69,6 +69,7 @@ public:\n>  \tconst ControlList &properties() const { return properties_; }\n>  \tint sensorInfo(IPACameraSensorInfo *info) const;\n>  \tTransform computeTransform(Orientation *orientation) const;\n> +\tBayerFormat::Order bayerOrder(Transform t) const;\n>\n>  \tconst ControlInfoMap &controls() const;\n>  \tControlList getControls(const std::vector<uint32_t> &ids);\n> @@ -114,6 +115,7 @@ private:\n>  \tRectangle activeArea_;\n>  \tconst BayerFormat *bayerFormat_;\n>  \tbool supportFlips_;\n> +\tbool flipsAlterBayerOrder_;\n>  \tOrientation mountingOrientation_;\n>\n>  \tControlList properties_;\n> diff --git a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp\n> index 9449c3dc458c..7e420b3f90a4 100644\n> --- a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp\n> +++ b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp\n> @@ -235,24 +235,16 @@ CameraConfiguration::Status RPiCameraConfiguration::validate()\n>  \tfor (auto &raw : rawStreams_) {\n>  \t\tStreamConfiguration *rawStream = raw.cfg;\n>\n> -\t\t/* Adjust the RAW stream to match the computed sensor format. */\n> -\t\tBayerFormat sensorBayer = BayerFormat::fromMbusCode(sensorFormat_.code);\n> -\n>  \t\t/*\n> -\t\t * Some sensors change their Bayer order when they are h-flipped\n> -\t\t * or v-flipped, according to the transform. If this one does, we\n> -\t\t * must advertise the transformed Bayer order in the raw stream.\n> -\t\t * Note how we must fetch the \"native\" (i.e. untransformed) Bayer\n> -\t\t * order, because the sensor may currently be flipped!\n> +\t\t * Some sensors change their Bayer order when they are\n> +\t\t * h-flipped or v-flipped, according to the transform. Adjust\n> +\t\t * the RAW stream to match the computed sensor format by\n> +\t\t * applying the sensor Bayer order resulting from the transform\n> +\t\t * to the user request.\n>  \t\t */\n> -\t\tif (data_->flipsAlterBayerOrder_) {\n> -\t\t\tsensorBayer.order = data_->nativeBayerOrder_;\n> -\t\t\tsensorBayer = sensorBayer.transform(combinedTransform_);\n> -\t\t}\n>\n> -\t\t/* Apply the sensor adjusted Bayer order to the user request. */\n>  \t\tBayerFormat cfgBayer = BayerFormat::fromPixelFormat(rawStream->pixelFormat);\n> -\t\tcfgBayer.order = sensorBayer.order;\n> +\t\tcfgBayer.order = data_->sensor_->bayerOrder(combinedTransform_);\n>\n>  \t\tif (rawStream->pixelFormat != cfgBayer.toPixelFormat()) {\n>  \t\t\trawStream->pixelFormat = cfgBayer.toPixelFormat();\n> @@ -840,40 +832,6 @@ int PipelineHandlerBase::registerCamera(std::unique_ptr<RPi::CameraData> &camera\n>  \t */\n>  \tdata->properties_.set(properties::ScalerCropMaximum, Rectangle{});\n>\n> -\t/*\n> -\t * We cache two things about the sensor in relation to transforms\n> -\t * (meaning horizontal and vertical flips): if they affect the Bayer\n> -\t * ordering, and what the \"native\" Bayer order is, when no transforms\n> -\t * are applied.\n> -\t *\n> -\t * If flips are supported verify if they affect the Bayer ordering\n> -\t * and what the \"native\" Bayer order is, when no transforms are\n> -\t * applied.\n> -\t *\n> -\t * We note that the sensor's cached list of supported formats is\n> -\t * already in the \"native\" order, with any flips having been undone.\n> -\t */\n> -\tconst V4L2Subdevice *sensor = data->sensor_->device();\n> -\tconst struct v4l2_query_ext_ctrl *hflipCtrl = sensor->controlInfo(V4L2_CID_HFLIP);\n> -\tif (hflipCtrl) {\n> -\t\t/* We assume it will support vflips too... */\n> -\t\tdata->flipsAlterBayerOrder_ = hflipCtrl->flags & V4L2_CTRL_FLAG_MODIFY_LAYOUT;\n> -\t}\n> -\n> -\t/* Look for a valid Bayer format. */\n> -\tBayerFormat bayerFormat;\n> -\tfor (const auto &iter : data->sensorFormats_) {\n> -\t\tbayerFormat = BayerFormat::fromMbusCode(iter.first);\n> -\t\tif (bayerFormat.isValid())\n> -\t\t\tbreak;\n> -\t}\n> -\n> -\tif (!bayerFormat.isValid()) {\n> -\t\tLOG(RPI, Error) << \"No Bayer format found\";\n> -\t\treturn -EINVAL;\n> -\t}\n> -\tdata->nativeBayerOrder_ = bayerFormat.order;\n> -\n>  \tret = platformRegister(cameraData, frontend, backend);\n>  \tif (ret)\n>  \t\treturn ret;\n> diff --git a/src/libcamera/pipeline/rpi/common/pipeline_base.h b/src/libcamera/pipeline/rpi/common/pipeline_base.h\n> index 267eef1102f1..0608bbe5f0c7 100644\n> --- a/src/libcamera/pipeline/rpi/common/pipeline_base.h\n> +++ b/src/libcamera/pipeline/rpi/common/pipeline_base.h\n> @@ -48,7 +48,7 @@ class CameraData : public Camera::Private\n>  public:\n>  \tCameraData(PipelineHandler *pipe)\n>  \t\t: Camera::Private(pipe), state_(State::Stopped),\n> -\t\t  flipsAlterBayerOrder_(false), dropFrameCount_(0), buffersAllocated_(false),\n> +\t\t  dropFrameCount_(0), buffersAllocated_(false),\n>  \t\t  ispOutputCount_(0), ispOutputTotal_(0)\n>  \t{\n>  \t}\n> @@ -131,10 +131,6 @@ public:\n>\n>  \tstd::queue<Request *> requestQueue_;\n>\n> -\t/* Store the \"native\" Bayer order (that is, with no transforms applied). */\n> -\tbool flipsAlterBayerOrder_;\n> -\tBayerFormat::Order nativeBayerOrder_;\n> -\n>  \t/* For handling digital zoom. */\n>  \tIPACameraSensorInfo sensorInfo_;\n>  \tRectangle ispCrop_; /* crop in ISP (camera mode) pixels */\n> diff --git a/src/libcamera/sensor/camera_sensor.cpp b/src/libcamera/sensor/camera_sensor.cpp\n> index 402025566544..5c4f35324055 100644\n> --- a/src/libcamera/sensor/camera_sensor.cpp\n> +++ b/src/libcamera/sensor/camera_sensor.cpp\n> @@ -58,7 +58,7 @@ LOG_DEFINE_CATEGORY(CameraSensor)\n>  CameraSensor::CameraSensor(const MediaEntity *entity)\n>  \t: entity_(entity), pad_(UINT_MAX), staticProps_(nullptr),\n>  \t  bayerFormat_(nullptr), supportFlips_(false),\n> -\t  properties_(properties::properties)\n> +\t  flipsAlterBayerOrder_(false), properties_(properties::properties)\n>  {\n>  }\n>\n> @@ -271,9 +271,14 @@ int CameraSensor::validateSensorDriver()\n>  \tconst struct v4l2_query_ext_ctrl *hflipInfo = subdev_->controlInfo(V4L2_CID_HFLIP);\n>  \tconst struct v4l2_query_ext_ctrl *vflipInfo = subdev_->controlInfo(V4L2_CID_VFLIP);\n>  \tif (hflipInfo && !(hflipInfo->flags & V4L2_CTRL_FLAG_READ_ONLY) &&\n> -\t    vflipInfo && !(vflipInfo->flags & V4L2_CTRL_FLAG_READ_ONLY))\n> +\t    vflipInfo && !(vflipInfo->flags & V4L2_CTRL_FLAG_READ_ONLY)) {\n>  \t\tsupportFlips_ = true;\n>\n> +\t\tif (hflipInfo->flags & V4L2_CTRL_FLAG_MODIFY_LAYOUT ||\n> +\t\t    vflipInfo->flags & V4L2_CTRL_FLAG_MODIFY_LAYOUT)\n> +\t\t\tflipsAlterBayerOrder_ = true;\n> +\t}\n> +\n>  \tif (!supportFlips_)\n>  \t\tLOG(CameraSensor, Debug)\n>  \t\t\t<< \"Camera sensor does not support horizontal/vertical flip\";\n> @@ -1041,6 +1046,34 @@ Transform CameraSensor::computeTransform(Orientation *orientation) const\n>  \treturn transform;\n>  }\n>\n> +/**\n> + * \\brief Compute the Bayer order that results from the given Transform\n> + * \\param[in] t The Transform to apply to the sensor\n> + *\n> + * Some sensors change their Bayer order when they are h-flipped or v-flipped.\n> + * This function computes and returns the Bayer order that would result from the\n> + * given transform applied to the sensor.\n> + *\n> + * This function is valid only when the sensor produces raw Bayer formats.\n> + *\n> + * \\return The Bayer order produced by the sensor when the Transform is applied\n> + */\n> +BayerFormat::Order CameraSensor::bayerOrder(Transform t) const\n> +{\n> +\t/* Return a defined by meaningless value for non-Bayer sensors. */\n> +\tif (!bayerFormat_)\n> +\t\treturn BayerFormat::Order::BGGR;\n> +\n> +\tif (!flipsAlterBayerOrder_)\n> +\t\treturn bayerFormat_->order;\n> +\n> +\t/*\n> +\t * Apply the transform to the native (i.e. untransformed) Bayer order,\n> +\t * using the rest of the Bayer format supplied by the caller.\n> +\t */\n> +\treturn bayerFormat_->transform(t).order;\n> +}\n> +\n>  /**\n>   * \\brief Retrieve the supported V4L2 controls and their information\n>   *\n> --\n> Regards,\n>\n> Laurent Pinchart\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 2DA47C326B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  4 Mar 2024 17:50:08 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 5255B62867;\n\tMon,  4 Mar 2024 18:50:07 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 43A11627FC\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  4 Mar 2024 18:50:05 +0100 (CET)","from ideasonboard.com (93-61-96-190.ip145.fastwebnet.it\n\t[93.61.96.190])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id B305E2E7;\n\tMon,  4 Mar 2024 18:49:48 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"Ewcmv9DF\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1709574588;\n\tbh=otLG6tBfFMiS25uLnqnUaawipvikMm6CkLNbxbpiiig=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=Ewcmv9DFOe/4RWSkYsNTqmwoVLhGHnwnKMhK9JOmMBGPQbVyhkYFxc5yGqdy8lxdj\n\tyPJa4A7OXxdtgRxfKWgQI4FZgd9+BgtOOofMlZhRrOG+OJh52yOtH/4Hc6Hn6/ywxT\n\t5URdj/RCnRjwe1SeVr6HI/OnycZEHaJuVZysYy9A=","Date":"Mon, 4 Mar 2024 18:50:02 +0100","From":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Subject":"Re: [PATCH/RFC 18/32] libcamera: camera_sensor: Expose the Bayer\n\torder","Message-ID":"<s5ufkiotmvzmsspnu3wb6uldhys5tavtse4hhd6l2sh3lsnsy6@pxmkjw3pqndx>","References":"<20240301212121.9072-1-laurent.pinchart@ideasonboard.com>\n\t<20240301212121.9072-19-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20240301212121.9072-19-laurent.pinchart@ideasonboard.com>","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>","Cc":"libcamera-devel@lists.libcamera.org, Sakari Ailus <sakari.ailus@iki.fi>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":28842,"web_url":"https://patchwork.libcamera.org/comment/28842/","msgid":"<20240304225622.GH9233@pendragon.ideasonboard.com>","date":"2024-03-04T22:56:22","subject":"Re: [PATCH/RFC 18/32] libcamera: camera_sensor: Expose the Bayer\n\torder","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Mon, Mar 04, 2024 at 06:50:02PM +0100, Jacopo Mondi wrote:\n> And this can be fast-tracked as well imho\n\nHow about \"[PATCH/RFC 14/32] libcamera: camera_sensor: Move related\nclasses to subdirectory\" ? Patches 15/32 to 18/32 depend on it. I could\nrebase, but...\n\nYou have also reviewed the refactoring of V4L2Subdevice (01/32 to\n09/32), and acked most of it. I'd like to merge that too if possible.\n03/32, 04/32, 07/32 and 09/32 are missing your Rb.\n\nDoes anyone else want to review all those patches too ?\n\n> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n> \n> On Fri, Mar 01, 2024 at 11:21:07PM +0200, Laurent Pinchart wrote:\n> > Pipeline handlers may need to know the Bayer order produced by the\n> > sensor when a Transform is applied (horizontal or vertical flip). This\n> > is currently implemented manually in the Raspberry Pi pipeline handler.\n> > Move the implementation to the CameraSensor class to make it usable in\n> > other pipeline handlers.\n> >\n> > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> > ---\n> >  include/libcamera/internal/camera_sensor.h    |  4 +-\n> >  .../pipeline/rpi/common/pipeline_base.cpp     | 54 +++----------------\n> >  .../pipeline/rpi/common/pipeline_base.h       |  6 +--\n> >  src/libcamera/sensor/camera_sensor.cpp        | 37 ++++++++++++-\n> >  4 files changed, 45 insertions(+), 56 deletions(-)\n> >\n> > diff --git a/include/libcamera/internal/camera_sensor.h b/include/libcamera/internal/camera_sensor.h\n> > index 750d6d729cac..d05f48ebeebe 100644\n> > --- a/include/libcamera/internal/camera_sensor.h\n> > +++ b/include/libcamera/internal/camera_sensor.h\n> > @@ -22,12 +22,12 @@\n> >\n> >  #include <libcamera/ipa/core_ipa_interface.h>\n> >\n> > +#include \"libcamera/internal/bayer_format.h\"\n> >  #include \"libcamera/internal/formats.h\"\n> >  #include \"libcamera/internal/v4l2_subdevice.h\"\n> >\n> >  namespace libcamera {\n> >\n> > -class BayerFormat;\n> >  class CameraLens;\n> >  class MediaEntity;\n> >  class SensorConfiguration;\n> > @@ -69,6 +69,7 @@ public:\n> >  \tconst ControlList &properties() const { return properties_; }\n> >  \tint sensorInfo(IPACameraSensorInfo *info) const;\n> >  \tTransform computeTransform(Orientation *orientation) const;\n> > +\tBayerFormat::Order bayerOrder(Transform t) const;\n> >\n> >  \tconst ControlInfoMap &controls() const;\n> >  \tControlList getControls(const std::vector<uint32_t> &ids);\n> > @@ -114,6 +115,7 @@ private:\n> >  \tRectangle activeArea_;\n> >  \tconst BayerFormat *bayerFormat_;\n> >  \tbool supportFlips_;\n> > +\tbool flipsAlterBayerOrder_;\n> >  \tOrientation mountingOrientation_;\n> >\n> >  \tControlList properties_;\n> > diff --git a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp\n> > index 9449c3dc458c..7e420b3f90a4 100644\n> > --- a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp\n> > +++ b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp\n> > @@ -235,24 +235,16 @@ CameraConfiguration::Status RPiCameraConfiguration::validate()\n> >  \tfor (auto &raw : rawStreams_) {\n> >  \t\tStreamConfiguration *rawStream = raw.cfg;\n> >\n> > -\t\t/* Adjust the RAW stream to match the computed sensor format. */\n> > -\t\tBayerFormat sensorBayer = BayerFormat::fromMbusCode(sensorFormat_.code);\n> > -\n> >  \t\t/*\n> > -\t\t * Some sensors change their Bayer order when they are h-flipped\n> > -\t\t * or v-flipped, according to the transform. If this one does, we\n> > -\t\t * must advertise the transformed Bayer order in the raw stream.\n> > -\t\t * Note how we must fetch the \"native\" (i.e. untransformed) Bayer\n> > -\t\t * order, because the sensor may currently be flipped!\n> > +\t\t * Some sensors change their Bayer order when they are\n> > +\t\t * h-flipped or v-flipped, according to the transform. Adjust\n> > +\t\t * the RAW stream to match the computed sensor format by\n> > +\t\t * applying the sensor Bayer order resulting from the transform\n> > +\t\t * to the user request.\n> >  \t\t */\n> > -\t\tif (data_->flipsAlterBayerOrder_) {\n> > -\t\t\tsensorBayer.order = data_->nativeBayerOrder_;\n> > -\t\t\tsensorBayer = sensorBayer.transform(combinedTransform_);\n> > -\t\t}\n> >\n> > -\t\t/* Apply the sensor adjusted Bayer order to the user request. */\n> >  \t\tBayerFormat cfgBayer = BayerFormat::fromPixelFormat(rawStream->pixelFormat);\n> > -\t\tcfgBayer.order = sensorBayer.order;\n> > +\t\tcfgBayer.order = data_->sensor_->bayerOrder(combinedTransform_);\n> >\n> >  \t\tif (rawStream->pixelFormat != cfgBayer.toPixelFormat()) {\n> >  \t\t\trawStream->pixelFormat = cfgBayer.toPixelFormat();\n> > @@ -840,40 +832,6 @@ int PipelineHandlerBase::registerCamera(std::unique_ptr<RPi::CameraData> &camera\n> >  \t */\n> >  \tdata->properties_.set(properties::ScalerCropMaximum, Rectangle{});\n> >\n> > -\t/*\n> > -\t * We cache two things about the sensor in relation to transforms\n> > -\t * (meaning horizontal and vertical flips): if they affect the Bayer\n> > -\t * ordering, and what the \"native\" Bayer order is, when no transforms\n> > -\t * are applied.\n> > -\t *\n> > -\t * If flips are supported verify if they affect the Bayer ordering\n> > -\t * and what the \"native\" Bayer order is, when no transforms are\n> > -\t * applied.\n> > -\t *\n> > -\t * We note that the sensor's cached list of supported formats is\n> > -\t * already in the \"native\" order, with any flips having been undone.\n> > -\t */\n> > -\tconst V4L2Subdevice *sensor = data->sensor_->device();\n> > -\tconst struct v4l2_query_ext_ctrl *hflipCtrl = sensor->controlInfo(V4L2_CID_HFLIP);\n> > -\tif (hflipCtrl) {\n> > -\t\t/* We assume it will support vflips too... */\n> > -\t\tdata->flipsAlterBayerOrder_ = hflipCtrl->flags & V4L2_CTRL_FLAG_MODIFY_LAYOUT;\n> > -\t}\n> > -\n> > -\t/* Look for a valid Bayer format. */\n> > -\tBayerFormat bayerFormat;\n> > -\tfor (const auto &iter : data->sensorFormats_) {\n> > -\t\tbayerFormat = BayerFormat::fromMbusCode(iter.first);\n> > -\t\tif (bayerFormat.isValid())\n> > -\t\t\tbreak;\n> > -\t}\n> > -\n> > -\tif (!bayerFormat.isValid()) {\n> > -\t\tLOG(RPI, Error) << \"No Bayer format found\";\n> > -\t\treturn -EINVAL;\n> > -\t}\n> > -\tdata->nativeBayerOrder_ = bayerFormat.order;\n> > -\n> >  \tret = platformRegister(cameraData, frontend, backend);\n> >  \tif (ret)\n> >  \t\treturn ret;\n> > diff --git a/src/libcamera/pipeline/rpi/common/pipeline_base.h b/src/libcamera/pipeline/rpi/common/pipeline_base.h\n> > index 267eef1102f1..0608bbe5f0c7 100644\n> > --- a/src/libcamera/pipeline/rpi/common/pipeline_base.h\n> > +++ b/src/libcamera/pipeline/rpi/common/pipeline_base.h\n> > @@ -48,7 +48,7 @@ class CameraData : public Camera::Private\n> >  public:\n> >  \tCameraData(PipelineHandler *pipe)\n> >  \t\t: Camera::Private(pipe), state_(State::Stopped),\n> > -\t\t  flipsAlterBayerOrder_(false), dropFrameCount_(0), buffersAllocated_(false),\n> > +\t\t  dropFrameCount_(0), buffersAllocated_(false),\n> >  \t\t  ispOutputCount_(0), ispOutputTotal_(0)\n> >  \t{\n> >  \t}\n> > @@ -131,10 +131,6 @@ public:\n> >\n> >  \tstd::queue<Request *> requestQueue_;\n> >\n> > -\t/* Store the \"native\" Bayer order (that is, with no transforms applied). */\n> > -\tbool flipsAlterBayerOrder_;\n> > -\tBayerFormat::Order nativeBayerOrder_;\n> > -\n> >  \t/* For handling digital zoom. */\n> >  \tIPACameraSensorInfo sensorInfo_;\n> >  \tRectangle ispCrop_; /* crop in ISP (camera mode) pixels */\n> > diff --git a/src/libcamera/sensor/camera_sensor.cpp b/src/libcamera/sensor/camera_sensor.cpp\n> > index 402025566544..5c4f35324055 100644\n> > --- a/src/libcamera/sensor/camera_sensor.cpp\n> > +++ b/src/libcamera/sensor/camera_sensor.cpp\n> > @@ -58,7 +58,7 @@ LOG_DEFINE_CATEGORY(CameraSensor)\n> >  CameraSensor::CameraSensor(const MediaEntity *entity)\n> >  \t: entity_(entity), pad_(UINT_MAX), staticProps_(nullptr),\n> >  \t  bayerFormat_(nullptr), supportFlips_(false),\n> > -\t  properties_(properties::properties)\n> > +\t  flipsAlterBayerOrder_(false), properties_(properties::properties)\n> >  {\n> >  }\n> >\n> > @@ -271,9 +271,14 @@ int CameraSensor::validateSensorDriver()\n> >  \tconst struct v4l2_query_ext_ctrl *hflipInfo = subdev_->controlInfo(V4L2_CID_HFLIP);\n> >  \tconst struct v4l2_query_ext_ctrl *vflipInfo = subdev_->controlInfo(V4L2_CID_VFLIP);\n> >  \tif (hflipInfo && !(hflipInfo->flags & V4L2_CTRL_FLAG_READ_ONLY) &&\n> > -\t    vflipInfo && !(vflipInfo->flags & V4L2_CTRL_FLAG_READ_ONLY))\n> > +\t    vflipInfo && !(vflipInfo->flags & V4L2_CTRL_FLAG_READ_ONLY)) {\n> >  \t\tsupportFlips_ = true;\n> >\n> > +\t\tif (hflipInfo->flags & V4L2_CTRL_FLAG_MODIFY_LAYOUT ||\n> > +\t\t    vflipInfo->flags & V4L2_CTRL_FLAG_MODIFY_LAYOUT)\n> > +\t\t\tflipsAlterBayerOrder_ = true;\n> > +\t}\n> > +\n> >  \tif (!supportFlips_)\n> >  \t\tLOG(CameraSensor, Debug)\n> >  \t\t\t<< \"Camera sensor does not support horizontal/vertical flip\";\n> > @@ -1041,6 +1046,34 @@ Transform CameraSensor::computeTransform(Orientation *orientation) const\n> >  \treturn transform;\n> >  }\n> >\n> > +/**\n> > + * \\brief Compute the Bayer order that results from the given Transform\n> > + * \\param[in] t The Transform to apply to the sensor\n> > + *\n> > + * Some sensors change their Bayer order when they are h-flipped or v-flipped.\n> > + * This function computes and returns the Bayer order that would result from the\n> > + * given transform applied to the sensor.\n> > + *\n> > + * This function is valid only when the sensor produces raw Bayer formats.\n> > + *\n> > + * \\return The Bayer order produced by the sensor when the Transform is applied\n> > + */\n> > +BayerFormat::Order CameraSensor::bayerOrder(Transform t) const\n> > +{\n> > +\t/* Return a defined by meaningless value for non-Bayer sensors. */\n> > +\tif (!bayerFormat_)\n> > +\t\treturn BayerFormat::Order::BGGR;\n> > +\n> > +\tif (!flipsAlterBayerOrder_)\n> > +\t\treturn bayerFormat_->order;\n> > +\n> > +\t/*\n> > +\t * Apply the transform to the native (i.e. untransformed) Bayer order,\n> > +\t * using the rest of the Bayer format supplied by the caller.\n> > +\t */\n> > +\treturn bayerFormat_->transform(t).order;\n> > +}\n> > +\n> >  /**\n> >   * \\brief Retrieve the supported V4L2 controls and their information\n> >   *","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id DA88DC326B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  4 Mar 2024 22:56:22 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 2182162872;\n\tMon,  4 Mar 2024 23:56:22 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 4664262867\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  4 Mar 2024 23:56:21 +0100 (CET)","from pendragon.ideasonboard.com (89-27-53-110.bb.dnainternet.fi\n\t[89.27.53.110])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 647F622E8;\n\tMon,  4 Mar 2024 23:56:04 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"M/Jzuiqc\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1709592964;\n\tbh=VrvEo1llsP82U7M6hI0t3Mh9P5eADksBR1WmycCPH+g=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=M/JzuiqcjJSN3PLdgIrk7+BbckCVP0gZR7jRMHwZxJaCQwvGClxRoOHy8LjwRpsla\n\tZ0AJicsu+lAAoL5Rl3KGAV/Z5ardF3/jmAS+P27y7Kr+FRPqWnQFVrKhemcRKtJKHc\n\t8lX/LchHlgLjWMuNuJ5JJWcDhHra6p+V2FMs6R0E=","Date":"Tue, 5 Mar 2024 00:56:22 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","Subject":"Re: [PATCH/RFC 18/32] libcamera: camera_sensor: Expose the Bayer\n\torder","Message-ID":"<20240304225622.GH9233@pendragon.ideasonboard.com>","References":"<20240301212121.9072-1-laurent.pinchart@ideasonboard.com>\n\t<20240301212121.9072-19-laurent.pinchart@ideasonboard.com>\n\t<s5ufkiotmvzmsspnu3wb6uldhys5tavtse4hhd6l2sh3lsnsy6@pxmkjw3pqndx>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<s5ufkiotmvzmsspnu3wb6uldhys5tavtse4hhd6l2sh3lsnsy6@pxmkjw3pqndx>","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>","Cc":"libcamera-devel@lists.libcamera.org, Sakari Ailus <sakari.ailus@iki.fi>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":28870,"web_url":"https://patchwork.libcamera.org/comment/28870/","msgid":"<e1f8cd22-4ef3-4010-a1f4-82049d77107d@ideasonboard.com>","date":"2024-03-05T13:56:43","subject":"Re: [PATCH/RFC 18/32] libcamera: camera_sensor: Expose the Bayer\n\torder","submitter":{"id":156,"url":"https://patchwork.libcamera.org/api/people/156/","name":"Dan Scally","email":"dan.scally@ideasonboard.com"},"content":"Hi Laurent - thanks for the patch; this will handily solve a problem I have\n\nOn 01/03/2024 21:21, Laurent Pinchart wrote:\n> Pipeline handlers may need to know the Bayer order produced by the\n> sensor when a Transform is applied (horizontal or vertical flip). This\n> is currently implemented manually in the Raspberry Pi pipeline handler.\n> Move the implementation to the CameraSensor class to make it usable in\n> other pipeline handlers.\n>\n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n\nReviewed-by: Daniel Scally <dan.scally@ideasonboard.com>\n\n> ---\n>   include/libcamera/internal/camera_sensor.h    |  4 +-\n>   .../pipeline/rpi/common/pipeline_base.cpp     | 54 +++----------------\n>   .../pipeline/rpi/common/pipeline_base.h       |  6 +--\n>   src/libcamera/sensor/camera_sensor.cpp        | 37 ++++++++++++-\n>   4 files changed, 45 insertions(+), 56 deletions(-)\n>\n> diff --git a/include/libcamera/internal/camera_sensor.h b/include/libcamera/internal/camera_sensor.h\n> index 750d6d729cac..d05f48ebeebe 100644\n> --- a/include/libcamera/internal/camera_sensor.h\n> +++ b/include/libcamera/internal/camera_sensor.h\n> @@ -22,12 +22,12 @@\n>   \n>   #include <libcamera/ipa/core_ipa_interface.h>\n>   \n> +#include \"libcamera/internal/bayer_format.h\"\n>   #include \"libcamera/internal/formats.h\"\n>   #include \"libcamera/internal/v4l2_subdevice.h\"\n>   \n>   namespace libcamera {\n>   \n> -class BayerFormat;\n>   class CameraLens;\n>   class MediaEntity;\n>   class SensorConfiguration;\n> @@ -69,6 +69,7 @@ public:\n>   \tconst ControlList &properties() const { return properties_; }\n>   \tint sensorInfo(IPACameraSensorInfo *info) const;\n>   \tTransform computeTransform(Orientation *orientation) const;\n> +\tBayerFormat::Order bayerOrder(Transform t) const;\n>   \n>   \tconst ControlInfoMap &controls() const;\n>   \tControlList getControls(const std::vector<uint32_t> &ids);\n> @@ -114,6 +115,7 @@ private:\n>   \tRectangle activeArea_;\n>   \tconst BayerFormat *bayerFormat_;\n>   \tbool supportFlips_;\n> +\tbool flipsAlterBayerOrder_;\n>   \tOrientation mountingOrientation_;\n>   \n>   \tControlList properties_;\n> diff --git a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp\n> index 9449c3dc458c..7e420b3f90a4 100644\n> --- a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp\n> +++ b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp\n> @@ -235,24 +235,16 @@ CameraConfiguration::Status RPiCameraConfiguration::validate()\n>   \tfor (auto &raw : rawStreams_) {\n>   \t\tStreamConfiguration *rawStream = raw.cfg;\n>   \n> -\t\t/* Adjust the RAW stream to match the computed sensor format. */\n> -\t\tBayerFormat sensorBayer = BayerFormat::fromMbusCode(sensorFormat_.code);\n> -\n>   \t\t/*\n> -\t\t * Some sensors change their Bayer order when they are h-flipped\n> -\t\t * or v-flipped, according to the transform. If this one does, we\n> -\t\t * must advertise the transformed Bayer order in the raw stream.\n> -\t\t * Note how we must fetch the \"native\" (i.e. untransformed) Bayer\n> -\t\t * order, because the sensor may currently be flipped!\n> +\t\t * Some sensors change their Bayer order when they are\n> +\t\t * h-flipped or v-flipped, according to the transform. Adjust\n> +\t\t * the RAW stream to match the computed sensor format by\n> +\t\t * applying the sensor Bayer order resulting from the transform\n> +\t\t * to the user request.\n>   \t\t */\n> -\t\tif (data_->flipsAlterBayerOrder_) {\n> -\t\t\tsensorBayer.order = data_->nativeBayerOrder_;\n> -\t\t\tsensorBayer = sensorBayer.transform(combinedTransform_);\n> -\t\t}\n>   \n> -\t\t/* Apply the sensor adjusted Bayer order to the user request. */\n>   \t\tBayerFormat cfgBayer = BayerFormat::fromPixelFormat(rawStream->pixelFormat);\n> -\t\tcfgBayer.order = sensorBayer.order;\n> +\t\tcfgBayer.order = data_->sensor_->bayerOrder(combinedTransform_);\n>   \n>   \t\tif (rawStream->pixelFormat != cfgBayer.toPixelFormat()) {\n>   \t\t\trawStream->pixelFormat = cfgBayer.toPixelFormat();\n> @@ -840,40 +832,6 @@ int PipelineHandlerBase::registerCamera(std::unique_ptr<RPi::CameraData> &camera\n>   \t */\n>   \tdata->properties_.set(properties::ScalerCropMaximum, Rectangle{});\n>   \n> -\t/*\n> -\t * We cache two things about the sensor in relation to transforms\n> -\t * (meaning horizontal and vertical flips): if they affect the Bayer\n> -\t * ordering, and what the \"native\" Bayer order is, when no transforms\n> -\t * are applied.\n> -\t *\n> -\t * If flips are supported verify if they affect the Bayer ordering\n> -\t * and what the \"native\" Bayer order is, when no transforms are\n> -\t * applied.\n> -\t *\n> -\t * We note that the sensor's cached list of supported formats is\n> -\t * already in the \"native\" order, with any flips having been undone.\n> -\t */\n> -\tconst V4L2Subdevice *sensor = data->sensor_->device();\n> -\tconst struct v4l2_query_ext_ctrl *hflipCtrl = sensor->controlInfo(V4L2_CID_HFLIP);\n> -\tif (hflipCtrl) {\n> -\t\t/* We assume it will support vflips too... */\n> -\t\tdata->flipsAlterBayerOrder_ = hflipCtrl->flags & V4L2_CTRL_FLAG_MODIFY_LAYOUT;\n> -\t}\n> -\n> -\t/* Look for a valid Bayer format. */\n> -\tBayerFormat bayerFormat;\n> -\tfor (const auto &iter : data->sensorFormats_) {\n> -\t\tbayerFormat = BayerFormat::fromMbusCode(iter.first);\n> -\t\tif (bayerFormat.isValid())\n> -\t\t\tbreak;\n> -\t}\n> -\n> -\tif (!bayerFormat.isValid()) {\n> -\t\tLOG(RPI, Error) << \"No Bayer format found\";\n> -\t\treturn -EINVAL;\n> -\t}\n> -\tdata->nativeBayerOrder_ = bayerFormat.order;\n> -\n>   \tret = platformRegister(cameraData, frontend, backend);\n>   \tif (ret)\n>   \t\treturn ret;\n> diff --git a/src/libcamera/pipeline/rpi/common/pipeline_base.h b/src/libcamera/pipeline/rpi/common/pipeline_base.h\n> index 267eef1102f1..0608bbe5f0c7 100644\n> --- a/src/libcamera/pipeline/rpi/common/pipeline_base.h\n> +++ b/src/libcamera/pipeline/rpi/common/pipeline_base.h\n> @@ -48,7 +48,7 @@ class CameraData : public Camera::Private\n>   public:\n>   \tCameraData(PipelineHandler *pipe)\n>   \t\t: Camera::Private(pipe), state_(State::Stopped),\n> -\t\t  flipsAlterBayerOrder_(false), dropFrameCount_(0), buffersAllocated_(false),\n> +\t\t  dropFrameCount_(0), buffersAllocated_(false),\n>   \t\t  ispOutputCount_(0), ispOutputTotal_(0)\n>   \t{\n>   \t}\n> @@ -131,10 +131,6 @@ public:\n>   \n>   \tstd::queue<Request *> requestQueue_;\n>   \n> -\t/* Store the \"native\" Bayer order (that is, with no transforms applied). */\n> -\tbool flipsAlterBayerOrder_;\n> -\tBayerFormat::Order nativeBayerOrder_;\n> -\n>   \t/* For handling digital zoom. */\n>   \tIPACameraSensorInfo sensorInfo_;\n>   \tRectangle ispCrop_; /* crop in ISP (camera mode) pixels */\n> diff --git a/src/libcamera/sensor/camera_sensor.cpp b/src/libcamera/sensor/camera_sensor.cpp\n> index 402025566544..5c4f35324055 100644\n> --- a/src/libcamera/sensor/camera_sensor.cpp\n> +++ b/src/libcamera/sensor/camera_sensor.cpp\n> @@ -58,7 +58,7 @@ LOG_DEFINE_CATEGORY(CameraSensor)\n>   CameraSensor::CameraSensor(const MediaEntity *entity)\n>   \t: entity_(entity), pad_(UINT_MAX), staticProps_(nullptr),\n>   \t  bayerFormat_(nullptr), supportFlips_(false),\n> -\t  properties_(properties::properties)\n> +\t  flipsAlterBayerOrder_(false), properties_(properties::properties)\n>   {\n>   }\n>   \n> @@ -271,9 +271,14 @@ int CameraSensor::validateSensorDriver()\n>   \tconst struct v4l2_query_ext_ctrl *hflipInfo = subdev_->controlInfo(V4L2_CID_HFLIP);\n>   \tconst struct v4l2_query_ext_ctrl *vflipInfo = subdev_->controlInfo(V4L2_CID_VFLIP);\n>   \tif (hflipInfo && !(hflipInfo->flags & V4L2_CTRL_FLAG_READ_ONLY) &&\n> -\t    vflipInfo && !(vflipInfo->flags & V4L2_CTRL_FLAG_READ_ONLY))\n> +\t    vflipInfo && !(vflipInfo->flags & V4L2_CTRL_FLAG_READ_ONLY)) {\n>   \t\tsupportFlips_ = true;\n>   \n> +\t\tif (hflipInfo->flags & V4L2_CTRL_FLAG_MODIFY_LAYOUT ||\n> +\t\t    vflipInfo->flags & V4L2_CTRL_FLAG_MODIFY_LAYOUT)\n> +\t\t\tflipsAlterBayerOrder_ = true;\n> +\t}\n> +\n>   \tif (!supportFlips_)\n>   \t\tLOG(CameraSensor, Debug)\n>   \t\t\t<< \"Camera sensor does not support horizontal/vertical flip\";\n> @@ -1041,6 +1046,34 @@ Transform CameraSensor::computeTransform(Orientation *orientation) const\n>   \treturn transform;\n>   }\n>   \n> +/**\n> + * \\brief Compute the Bayer order that results from the given Transform\n> + * \\param[in] t The Transform to apply to the sensor\n> + *\n> + * Some sensors change their Bayer order when they are h-flipped or v-flipped.\n> + * This function computes and returns the Bayer order that would result from the\n> + * given transform applied to the sensor.\n> + *\n> + * This function is valid only when the sensor produces raw Bayer formats.\n> + *\n> + * \\return The Bayer order produced by the sensor when the Transform is applied\n> + */\n> +BayerFormat::Order CameraSensor::bayerOrder(Transform t) const\n> +{\n> +\t/* Return a defined by meaningless value for non-Bayer sensors. */\n> +\tif (!bayerFormat_)\n> +\t\treturn BayerFormat::Order::BGGR;\n> +\n> +\tif (!flipsAlterBayerOrder_)\n> +\t\treturn bayerFormat_->order;\n> +\n> +\t/*\n> +\t * Apply the transform to the native (i.e. untransformed) Bayer order,\n> +\t * using the rest of the Bayer format supplied by the caller.\n> +\t */\n> +\treturn bayerFormat_->transform(t).order;\n> +}\n> +\n>   /**\n>    * \\brief Retrieve the supported V4L2 controls and their information\n>    *","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 0C403BD160\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  5 Mar 2024 13:56:49 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 49F4A6286F;\n\tTue,  5 Mar 2024 14:56:48 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id A5F4561C8D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  5 Mar 2024 14:56:47 +0100 (CET)","from [192.168.0.43]\n\t(cpc141996-chfd3-2-0-cust928.12-3.cable.virginm.net [86.13.91.161])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 930F28D0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  5 Mar 2024 14:56:30 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"Ha5Nz2fN\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1709646990;\n\tbh=GAxsj32C7u5x8ygLPggRbQhw9UohN8WhD1oSAxcRH+A=;\n\th=Date:Subject:To:References:From:In-Reply-To:From;\n\tb=Ha5Nz2fNr8HA8N0F6368xRn7kWd8ajSZWxdIMx52muqbgitaFQvQxiepbJiU+01Cn\n\tD+K8Ms7fMZXJlGYOGZwpVqgJJb8QHVZrbA6YWobmBxgl4DcAtzVROoi7BIP+71hyVH\n\tfR/nS2M4RauA4Z0Xzy/3XXv1Sow+tlwBj/b3fbVs=","Message-ID":"<e1f8cd22-4ef3-4010-a1f4-82049d77107d@ideasonboard.com>","Date":"Tue, 5 Mar 2024 13:56:43 +0000","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH/RFC 18/32] libcamera: camera_sensor: Expose the Bayer\n\torder","Content-Language":"en-US","To":"libcamera-devel@lists.libcamera.org","References":"<20240301212121.9072-1-laurent.pinchart@ideasonboard.com>\n\t<20240301212121.9072-19-laurent.pinchart@ideasonboard.com>","From":"Dan Scally <dan.scally@ideasonboard.com>","Autocrypt":"addr=dan.scally@ideasonboard.com; keydata=\n\t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","In-Reply-To":"<20240301212121.9072-19-laurent.pinchart@ideasonboard.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"7bit","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]