Patch Detail
Show a patch.
GET /api/patches/19597/?format=api
{ "id": 19597, "url": "https://patchwork.libcamera.org/api/patches/19597/?format=api", "web_url": "https://patchwork.libcamera.org/patch/19597/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/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": "<20240301212121.9072-7-laurent.pinchart@ideasonboard.com>", "date": "2024-03-01T21:20:55", "name": "[PATCH/RFC,06/32] libcamera: v4l2_subdevice: Rename V4L2SubdeviceFormat::mbus_code to code", "commit_ref": null, "pull_url": null, "state": "rfc", "archived": false, "hash": "bbb411e3f01eb78bfbf232434c44be5205832902", "submitter": { "id": 2, "url": "https://patchwork.libcamera.org/api/people/2/?format=api", "name": "Laurent Pinchart", "email": "laurent.pinchart@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/19597/mbox/", "series": [ { "id": 4197, "url": "https://patchwork.libcamera.org/api/series/4197/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4197", "date": "2024-03-01T21:20:49", "name": "libcamera: Support the upstream Unicam driver", "version": 1, "mbox": "https://patchwork.libcamera.org/series/4197/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/19597/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/19597/checks/", "tags": {}, "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 3B634C3260\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 1 Mar 2024 21:21:31 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id A687862872;\n\tFri, 1 Mar 2024 22:21:30 +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 E653D62871\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 1 Mar 2024 22:21:28 +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 420742D6B;\n\tFri, 1 Mar 2024 22:21:14 +0100 (CET)" ], "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"axNfcypq\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1709328074;\n\tbh=pRl8v5ykoABSG91wzLr7CkpJAEIISEK18+aMOEaAGbo=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=axNfcypq7ABrWt8Fe2VQh46RePGf1bFA6/cMLconE8z7Zy+DsFqBu/9HBHixFagBc\n\t98RouYdzHTAapP1JbdCDyqFX95I6ElLeBoPMUPNKTnArqZt3WfCStqRTk5+5il5AR7\n\tLxoM8oTtMaCt3FEK+8T/Jf7G/SjbSOcvvdPI8Z7I=", "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Subject": "[PATCH/RFC 06/32] libcamera: v4l2_subdevice: Rename\n\tV4L2SubdeviceFormat::mbus_code to code", "Date": "Fri, 1 Mar 2024 23:20:55 +0200", "Message-ID": "<20240301212121.9072-7-laurent.pinchart@ideasonboard.com>", "X-Mailer": "git-send-email 2.43.0", "In-Reply-To": "<20240301212121.9072-1-laurent.pinchart@ideasonboard.com>", "References": "<20240301212121.9072-1-laurent.pinchart@ideasonboard.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "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": "Sakari Ailus <sakari.ailus@iki.fi>", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "The V4L2SubdeviceFormat::mbus_code member doesn't follow the libcamera\ncoding style as it should use camelCase. Fix it by renaming it to just\n'code', to shorten lines in addition to fixing the coding style.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\nReviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n---\n include/libcamera/internal/v4l2_subdevice.h | 2 +-\n src/libcamera/camera_sensor.cpp | 8 ++++----\n src/libcamera/pipeline/imx8-isi/imx8-isi.cpp | 10 +++++-----\n src/libcamera/pipeline/ipu3/cio2.cpp | 8 ++++----\n src/libcamera/pipeline/ipu3/imgu.cpp | 4 ++--\n src/libcamera/pipeline/rkisp1/rkisp1.cpp | 2 +-\n src/libcamera/pipeline/rkisp1/rkisp1_path.cpp | 2 +-\n .../pipeline/rpi/common/pipeline_base.cpp | 16 ++++++++--------\n src/libcamera/pipeline/rpi/vc4/vc4.cpp | 2 +-\n src/libcamera/pipeline/simple/simple.cpp | 10 +++++-----\n src/libcamera/pipeline/vimc/vimc.cpp | 4 ++--\n src/libcamera/v4l2_subdevice.cpp | 12 ++++++------\n test/camera-sensor.cpp | 2 +-\n test/v4l2_videodevice/v4l2_videodevice_test.cpp | 2 +-\n 14 files changed, 42 insertions(+), 42 deletions(-)", "diff": "diff --git a/include/libcamera/internal/v4l2_subdevice.h b/include/libcamera/internal/v4l2_subdevice.h\nindex a87981341d75..1115cfa55594 100644\n--- a/include/libcamera/internal/v4l2_subdevice.h\n+++ b/include/libcamera/internal/v4l2_subdevice.h\n@@ -61,7 +61,7 @@ struct V4L2SubdeviceCapability final : v4l2_subdev_capability {\n };\n \n struct V4L2SubdeviceFormat {\n-\tuint32_t mbus_code;\n+\tuint32_t code;\n \tSize size;\n \tstd::optional<ColorSpace> colorSpace;\n \ndiff --git a/src/libcamera/camera_sensor.cpp b/src/libcamera/camera_sensor.cpp\nindex 55c9c74b10c2..af5d97f35de1 100644\n--- a/src/libcamera/camera_sensor.cpp\n+++ b/src/libcamera/camera_sensor.cpp\n@@ -770,7 +770,7 @@ V4L2SubdeviceFormat CameraSensor::getFormat(const std::vector<unsigned int> &mbu\n \t}\n \n \tV4L2SubdeviceFormat format{\n-\t\t.mbus_code = bestCode,\n+\t\t.code = bestCode,\n \t\t.size = *bestSize,\n \t\t.colorSpace = ColorSpace::Raw,\n \t};\n@@ -892,12 +892,12 @@ int CameraSensor::applyConfiguration(const SensorConfiguration &config,\n \t\t\t size.height != config.outputSize.height)\n \t\t\t\tcontinue;\n \n-\t\t\tsubdevFormat.mbus_code = code;\n+\t\t\tsubdevFormat.code = code;\n \t\t\tsubdevFormat.size = size;\n \t\t\tbreak;\n \t\t}\n \t}\n-\tif (!subdevFormat.mbus_code) {\n+\tif (!subdevFormat.code) {\n \t\tLOG(CameraSensor, Error) << \"Invalid output size in sensor configuration\";\n \t\treturn -EINVAL;\n \t}\n@@ -1061,7 +1061,7 @@ int CameraSensor::sensorInfo(IPACameraSensorInfo *info) const\n \tif (ret)\n \t\treturn ret;\n \n-\tinfo->bitsPerPixel = MediaBusFormatInfo::info(format.mbus_code).bitsPerPixel;\n+\tinfo->bitsPerPixel = MediaBusFormatInfo::info(format.code).bitsPerPixel;\n \tinfo->outputSize = format.size;\n \n \tstd::optional<int32_t> cfa = properties_.get(properties::draft::ColorFilterArrangement);\ndiff --git a/src/libcamera/pipeline/imx8-isi/imx8-isi.cpp b/src/libcamera/pipeline/imx8-isi/imx8-isi.cpp\nindex 9bdfff0b155e..a3782aea2ba9 100644\n--- a/src/libcamera/pipeline/imx8-isi/imx8-isi.cpp\n+++ b/src/libcamera/pipeline/imx8-isi/imx8-isi.cpp\n@@ -554,7 +554,7 @@ CameraConfiguration::Status ISICameraConfiguration::validate()\n \tPixelFormat pixelFormat = config_[0].pixelFormat;\n \n \tV4L2SubdeviceFormat sensorFormat{};\n-\tsensorFormat.mbus_code = data_->getMediaBusFormat(&pixelFormat);\n+\tsensorFormat.code = data_->getMediaBusFormat(&pixelFormat);\n \tsensorFormat.size = maxSize;\n \n \tLOG(ISI, Debug) << \"Computed sensor configuration: \" << sensorFormat;\n@@ -569,7 +569,7 @@ CameraConfiguration::Status ISICameraConfiguration::validate()\n \t * the smallest larger format without considering the aspect ratio\n \t * as the ISI can freely scale.\n \t */\n-\tauto sizes = sensor->sizes(sensorFormat.mbus_code);\n+\tauto sizes = sensor->sizes(sensorFormat.code);\n \tSize bestSize;\n \n \tfor (const Size &s : sizes) {\n@@ -595,7 +595,7 @@ CameraConfiguration::Status ISICameraConfiguration::validate()\n \t\treturn Invalid;\n \t}\n \n-\tsensorFormat_.mbus_code = sensorFormat.mbus_code;\n+\tsensorFormat_.code = sensorFormat.code;\n \tsensorFormat_.size = bestSize;\n \n \tLOG(ISI, Debug) << \"Selected sensor format: \" << sensorFormat_;\n@@ -632,7 +632,7 @@ StreamConfiguration PipelineHandlerISI::generateYUVConfiguration(Camera *camera,\n \n \t/* Adjust the requested size to the sensor's capabilities. */\n \tV4L2SubdeviceFormat sensorFmt;\n-\tsensorFmt.mbus_code = mbusCode;\n+\tsensorFmt.code = mbusCode;\n \tsensorFmt.size = size;\n \n \tint ret = data->sensor_->tryFormat(&sensorFmt);\n@@ -891,7 +891,7 @@ int PipelineHandlerISI::configure(Camera *camera, CameraConfiguration *c)\n \t\tunsigned int isiCode = ISICameraConfiguration::formatsMap_.at(config.pixelFormat);\n \n \t\tV4L2SubdeviceFormat isiFormat{};\n-\t\tisiFormat.mbus_code = isiCode;\n+\t\tisiFormat.code = isiCode;\n \t\tisiFormat.size = config.size;\n \n \t\tret = pipe->isi->setFormat(1, &isiFormat);\ndiff --git a/src/libcamera/pipeline/ipu3/cio2.cpp b/src/libcamera/pipeline/ipu3/cio2.cpp\nindex 7400cb0b644c..43c816baf6ef 100644\n--- a/src/libcamera/pipeline/ipu3/cio2.cpp\n+++ b/src/libcamera/pipeline/ipu3/cio2.cpp\n@@ -202,7 +202,7 @@ int CIO2Device::configure(const Size &size, const Transform &transform,\n \tif (ret)\n \t\treturn ret;\n \n-\tconst auto &itInfo = mbusCodesToPixelFormat.find(sensorFormat.mbus_code);\n+\tconst auto &itInfo = mbusCodesToPixelFormat.find(sensorFormat.code);\n \tif (itInfo == mbusCodesToPixelFormat.end())\n \t\treturn -EINVAL;\n \n@@ -230,13 +230,13 @@ StreamConfiguration CIO2Device::generateConfiguration(Size size) const\n \t/* Query the sensor static information for closest match. */\n \tstd::vector<unsigned int> mbusCodes = utils::map_keys(mbusCodesToPixelFormat);\n \tV4L2SubdeviceFormat sensorFormat = getSensorFormat(mbusCodes, size);\n-\tif (!sensorFormat.mbus_code) {\n+\tif (!sensorFormat.code) {\n \t\tLOG(IPU3, Error) << \"Sensor does not support mbus code\";\n \t\treturn {};\n \t}\n \n \tcfg.size = sensorFormat.size;\n-\tcfg.pixelFormat = mbusCodesToPixelFormat.at(sensorFormat.mbus_code);\n+\tcfg.pixelFormat = mbusCodesToPixelFormat.at(sensorFormat.code);\n \tcfg.bufferCount = kBufferCount;\n \n \treturn cfg;\n@@ -326,7 +326,7 @@ V4L2SubdeviceFormat CIO2Device::getSensorFormat(const std::vector<unsigned int>\n \t}\n \n \tV4L2SubdeviceFormat format{};\n-\tformat.mbus_code = bestCode;\n+\tformat.code = bestCode;\n \tformat.size = bestSize;\n \n \treturn format;\ndiff --git a/src/libcamera/pipeline/ipu3/imgu.cpp b/src/libcamera/pipeline/ipu3/imgu.cpp\nindex 531879f18183..2202438a75e0 100644\n--- a/src/libcamera/pipeline/ipu3/imgu.cpp\n+++ b/src/libcamera/pipeline/ipu3/imgu.cpp\n@@ -504,7 +504,7 @@ int ImgUDevice::configure(const PipeConfig &pipeConfig, V4L2DeviceFormat *inputF\n \tLOG(IPU3, Debug) << \"ImgU BDS rectangle = \" << bds;\n \n \tV4L2SubdeviceFormat gdcFormat = {};\n-\tgdcFormat.mbus_code = MEDIA_BUS_FMT_FIXED;\n+\tgdcFormat.code = MEDIA_BUS_FMT_FIXED;\n \tgdcFormat.size = pipeConfig.gdc;\n \n \tret = imgu_->setFormat(PAD_INPUT, &gdcFormat);\n@@ -543,7 +543,7 @@ int ImgUDevice::configureVideoDevice(V4L2VideoDevice *dev, unsigned int pad,\n \t\t\t\t V4L2DeviceFormat *outputFormat)\n {\n \tV4L2SubdeviceFormat imguFormat = {};\n-\timguFormat.mbus_code = MEDIA_BUS_FMT_FIXED;\n+\timguFormat.code = MEDIA_BUS_FMT_FIXED;\n \timguFormat.size = cfg.size;\n \n \tint ret = imgu_->setFormat(pad, &imguFormat);\ndiff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\nindex 586b46d64630..abb21968413a 100644\n--- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n+++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n@@ -761,7 +761,7 @@ int PipelineHandlerRkISP1::configure(Camera *camera, CameraConfiguration *c)\n \n \t/* YUYV8_2X8 is required on the ISP source path pad for YUV output. */\n \tif (!isRaw_)\n-\t\tformat.mbus_code = MEDIA_BUS_FMT_YUYV8_2X8;\n+\t\tformat.code = MEDIA_BUS_FMT_YUYV8_2X8;\n \n \tLOG(RkISP1, Debug)\n \t\t<< \"Configuring ISP output pad with \" << format\ndiff --git a/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp b/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp\nindex b62b645cae24..9195aad2cff2 100644\n--- a/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp\n+++ b/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp\n@@ -365,7 +365,7 @@ int RkISP1Path::configure(const StreamConfiguration &config,\n \t * The configuration has been validated, the pixel format is guaranteed\n \t * to be supported and thus found in formatToMediaBus.\n \t */\n-\tispFormat.mbus_code = formatToMediaBus.at(config.pixelFormat);\n+\tispFormat.code = formatToMediaBus.at(config.pixelFormat);\n \n \tret = resizer_->setFormat(1, &ispFormat);\n \tif (ret < 0)\ndiff --git a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp\nindex e0bedcd8c664..9449c3dc458c 100644\n--- a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp\n+++ b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp\n@@ -37,10 +37,10 @@ namespace {\n \n constexpr unsigned int defaultRawBitDepth = 12;\n \n-PixelFormat mbusCodeToPixelFormat(unsigned int mbus_code,\n+PixelFormat mbusCodeToPixelFormat(unsigned int code,\n \t\t\t\t BayerFormat::Packing packingReq)\n {\n-\tBayerFormat bayer = BayerFormat::fromMbusCode(mbus_code);\n+\tBayerFormat bayer = BayerFormat::fromMbusCode(code);\n \n \tASSERT(bayer.isValid());\n \n@@ -221,7 +221,7 @@ CameraConfiguration::Status RPiCameraConfiguration::validate()\n \t * without modifications.\n \t */\n \tif (sensorConfig) {\n-\t\tBayerFormat bayer = BayerFormat::fromMbusCode(sensorFormat_.mbus_code);\n+\t\tBayerFormat bayer = BayerFormat::fromMbusCode(sensorFormat_.code);\n \n \t\tif (bayer.bitDepth != sensorConfig->bitDepth ||\n \t\t sensorFormat_.size != sensorConfig->outputSize) {\n@@ -236,7 +236,7 @@ CameraConfiguration::Status RPiCameraConfiguration::validate()\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_.mbus_code);\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@@ -377,8 +377,8 @@ V4L2DeviceFormat PipelineHandlerBase::toV4L2DeviceFormat(const V4L2VideoDevice *\n \t\t\t\t\t\t\t const V4L2SubdeviceFormat &format,\n \t\t\t\t\t\t\t BayerFormat::Packing packingReq)\n {\n-\tunsigned int mbus_code = format.mbus_code;\n-\tconst PixelFormat pix = mbusCodeToPixelFormat(mbus_code, packingReq);\n+\tunsigned int code = format.code;\n+\tconst PixelFormat pix = mbusCodeToPixelFormat(code, packingReq);\n \tV4L2DeviceFormat deviceFormat;\n \n \tdeviceFormat.fourcc = dev->toV4L2PixelFormat(pix);\n@@ -409,7 +409,7 @@ PipelineHandlerBase::generateConfiguration(Camera *camera, Span<const StreamRole\n \t\tcase StreamRole::Raw:\n \t\t\tsize = sensorSize;\n \t\t\tsensorFormat = data->findBestFormat(size, defaultRawBitDepth);\n-\t\t\tpixelFormat = mbusCodeToPixelFormat(sensorFormat.mbus_code,\n+\t\t\tpixelFormat = mbusCodeToPixelFormat(sensorFormat.code,\n \t\t\t\t\t\t\t BayerFormat::Packing::CSI2);\n \t\t\tASSERT(pixelFormat.isValid());\n \t\t\tcolorSpace = ColorSpace::Raw;\n@@ -990,7 +990,7 @@ V4L2SubdeviceFormat CameraData::findBestFormat(const Size &req, unsigned int bit\n \n \t\t\tif (score <= bestScore) {\n \t\t\t\tbestScore = score;\n-\t\t\t\tbestFormat.mbus_code = mbusCode;\n+\t\t\t\tbestFormat.code = mbusCode;\n \t\t\t\tbestFormat.size = size;\n \t\t\t}\n \ndiff --git a/src/libcamera/pipeline/rpi/vc4/vc4.cpp b/src/libcamera/pipeline/rpi/vc4/vc4.cpp\nindex 6b6ecd3ded7d..ad7dddde59f1 100644\n--- a/src/libcamera/pipeline/rpi/vc4/vc4.cpp\n+++ b/src/libcamera/pipeline/rpi/vc4/vc4.cpp\n@@ -426,7 +426,7 @@ CameraConfiguration::Status Vc4CameraData::platformValidate(RPi::RPiCameraConfig\n \t\tBayerFormat rawBayer = BayerFormat::fromPixelFormat(rawStream->pixelFormat);\n \n \t\t/* Apply the sensor bitdepth. */\n-\t\trawBayer.bitDepth = BayerFormat::fromMbusCode(rpiConfig->sensorFormat_.mbus_code).bitDepth;\n+\t\trawBayer.bitDepth = BayerFormat::fromMbusCode(rpiConfig->sensorFormat_.code).bitDepth;\n \n \t\t/* Default to CSI2 packing if the user request is unsupported. */\n \t\tif (rawBayer.packing != BayerFormat::Packing::CSI2 &&\ndiff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp\nindex e37b0d1c393f..3d0424969a89 100644\n--- a/src/libcamera/pipeline/simple/simple.cpp\n+++ b/src/libcamera/pipeline/simple/simple.cpp\n@@ -563,13 +563,13 @@ void SimpleCameraData::tryPipeline(unsigned int code, const Size &size)\n \t * corresponding possible V4L2 pixel formats on the video node.\n \t */\n \tV4L2SubdeviceFormat format{};\n-\tformat.mbus_code = code;\n+\tformat.code = code;\n \tformat.size = size;\n \n \tint ret = setupFormats(&format, V4L2Subdevice::TryFormat);\n \tif (ret < 0) {\n \t\t/* Pipeline configuration failed, skip this configuration. */\n-\t\tformat.mbus_code = code;\n+\t\tformat.code = code;\n \t\tformat.size = size;\n \t\tLOG(SimplePipeline, Debug)\n \t\t\t<< \"Sensor format \" << format\n@@ -577,7 +577,7 @@ void SimpleCameraData::tryPipeline(unsigned int code, const Size &size)\n \t\treturn;\n \t}\n \n-\tV4L2VideoDevice::Formats videoFormats = video_->formats(format.mbus_code);\n+\tV4L2VideoDevice::Formats videoFormats = video_->formats(format.code);\n \n \tLOG(SimplePipeline, Debug)\n \t\t<< \"Adding configuration for \" << format.size\n@@ -707,7 +707,7 @@ int SimpleCameraData::setupFormats(V4L2SubdeviceFormat *format,\n \t\t\tif (ret < 0)\n \t\t\t\treturn ret;\n \n-\t\t\tif (format->mbus_code != sourceFormat.mbus_code ||\n+\t\t\tif (format->code != sourceFormat.code ||\n \t\t\t format->size != sourceFormat.size) {\n \t\t\t\tLOG(SimplePipeline, Debug)\n \t\t\t\t\t<< \"Source '\" << source->entity()->name()\n@@ -1121,7 +1121,7 @@ int SimplePipelineHandler::configure(Camera *camera, CameraConfiguration *c)\n \n \tconst SimpleCameraData::Configuration *pipeConfig = config->pipeConfig();\n \tV4L2SubdeviceFormat format{};\n-\tformat.mbus_code = pipeConfig->code;\n+\tformat.code = pipeConfig->code;\n \tformat.size = pipeConfig->sensorSize;\n \n \tret = data->setupFormats(&format, V4L2Subdevice::ActiveFormat,\ndiff --git a/src/libcamera/pipeline/vimc/vimc.cpp b/src/libcamera/pipeline/vimc/vimc.cpp\nindex 5536941ac0d5..5e66ee1d26c1 100644\n--- a/src/libcamera/pipeline/vimc/vimc.cpp\n+++ b/src/libcamera/pipeline/vimc/vimc.cpp\n@@ -244,7 +244,7 @@ int PipelineHandlerVimc::configure(Camera *camera, CameraConfiguration *config)\n \n \t/* The scaler hardcodes a x3 scale-up ratio. */\n \tV4L2SubdeviceFormat subformat = {};\n-\tsubformat.mbus_code = MEDIA_BUS_FMT_SGRBG8_1X8;\n+\tsubformat.code = MEDIA_BUS_FMT_SGRBG8_1X8;\n \tsubformat.size = { cfg.size.width / 3, cfg.size.height / 3 };\n \n \tret = data->sensor_->setFormat(&subformat);\n@@ -255,7 +255,7 @@ int PipelineHandlerVimc::configure(Camera *camera, CameraConfiguration *config)\n \tif (ret)\n \t\treturn ret;\n \n-\tsubformat.mbus_code = pixelformats.find(cfg.pixelFormat)->second;\n+\tsubformat.code = pixelformats.find(cfg.pixelFormat)->second;\n \tret = data->debayer_->setFormat(1, &subformat);\n \tif (ret)\n \t\treturn ret;\ndiff --git a/src/libcamera/v4l2_subdevice.cpp b/src/libcamera/v4l2_subdevice.cpp\nindex e896977121d2..dadc4d1dab92 100644\n--- a/src/libcamera/v4l2_subdevice.cpp\n+++ b/src/libcamera/v4l2_subdevice.cpp\n@@ -729,7 +729,7 @@ const MediaBusFormatInfo &MediaBusFormatInfo::info(uint32_t code)\n */\n \n /**\n- * \\var V4L2SubdeviceFormat::mbus_code\n+ * \\var V4L2SubdeviceFormat::code\n * \\brief The image format bus code\n */\n \n@@ -776,10 +776,10 @@ std::ostream &operator<<(std::ostream &out, const V4L2SubdeviceFormat &f)\n {\n \tout << f.size << \"-\";\n \n-\tconst auto it = mediaBusFormatInfo.find(f.mbus_code);\n+\tconst auto it = mediaBusFormatInfo.find(f.code);\n \n \tif (it == mediaBusFormatInfo.end())\n-\t\tout << utils::hex(f.mbus_code, 4);\n+\t\tout << utils::hex(f.code, 4);\n \telse\n \t\tout << it->second.name;\n \n@@ -1069,7 +1069,7 @@ int V4L2Subdevice::getFormat(unsigned int pad, V4L2SubdeviceFormat *format,\n \n \tformat->size.width = subdevFmt.format.width;\n \tformat->size.height = subdevFmt.format.height;\n-\tformat->mbus_code = subdevFmt.format.code;\n+\tformat->code = subdevFmt.format.code;\n \tformat->colorSpace = toColorSpace(subdevFmt.format);\n \n \treturn 0;\n@@ -1095,7 +1095,7 @@ int V4L2Subdevice::setFormat(unsigned int pad, V4L2SubdeviceFormat *format,\n \tsubdevFmt.pad = pad;\n \tsubdevFmt.format.width = format->size.width;\n \tsubdevFmt.format.height = format->size.height;\n-\tsubdevFmt.format.code = format->mbus_code;\n+\tsubdevFmt.format.code = format->code;\n \tsubdevFmt.format.field = V4L2_FIELD_NONE;\n \tif (format->colorSpace) {\n \t\tfromColorSpace(format->colorSpace, subdevFmt.format);\n@@ -1115,7 +1115,7 @@ int V4L2Subdevice::setFormat(unsigned int pad, V4L2SubdeviceFormat *format,\n \n \tformat->size.width = subdevFmt.format.width;\n \tformat->size.height = subdevFmt.format.height;\n-\tformat->mbus_code = subdevFmt.format.code;\n+\tformat->code = subdevFmt.format.code;\n \tformat->colorSpace = toColorSpace(subdevFmt.format);\n \n \treturn 0;\ndiff --git a/test/camera-sensor.cpp b/test/camera-sensor.cpp\nindex 2a17cc79ea76..9503d7753fb9 100644\n--- a/test/camera-sensor.cpp\n+++ b/test/camera-sensor.cpp\n@@ -100,7 +100,7 @@ protected:\n \t\t\t\t\t\t\t\t MEDIA_BUS_FMT_SBGGR10_1X10,\n \t\t\t\t\t\t\t\t MEDIA_BUS_FMT_BGR888_1X24 },\n \t\t\t\t\t\t\t\tSize(1024, 768));\n-\t\tif (format.mbus_code != MEDIA_BUS_FMT_SBGGR10_1X10 ||\n+\t\tif (format.code != MEDIA_BUS_FMT_SBGGR10_1X10 ||\n \t\t format.size != Size(4096, 2160)) {\n \t\t\tcerr << \"Failed to get a suitable format, expected 4096x2160-0x\"\n \t\t\t << utils::hex(MEDIA_BUS_FMT_SBGGR10_1X10)\ndiff --git a/test/v4l2_videodevice/v4l2_videodevice_test.cpp b/test/v4l2_videodevice/v4l2_videodevice_test.cpp\nindex 125aafd65041..1113cf5bf8cf 100644\n--- a/test/v4l2_videodevice/v4l2_videodevice_test.cpp\n+++ b/test/v4l2_videodevice/v4l2_videodevice_test.cpp\n@@ -75,7 +75,7 @@ int V4L2VideoDeviceTest::init()\n \t\tformat.fourcc = V4L2PixelFormat(V4L2_PIX_FMT_SBGGR8);\n \n \t\tV4L2SubdeviceFormat subformat = {};\n-\t\tsubformat.mbus_code = MEDIA_BUS_FMT_SBGGR8_1X8;\n+\t\tsubformat.code = MEDIA_BUS_FMT_SBGGR8_1X8;\n \t\tsubformat.size = format.size;\n \n \t\tif (sensor_->setFormat(&subformat))\n", "prefixes": [ "PATCH/RFC", "06/32" ] }