[{"id":28780,"web_url":"https://patchwork.libcamera.org/comment/28780/","msgid":"<7huybkwgxnale2vdrcpzt3miigcqdaibwmetm7mg2xxkfobckz@smdvqvoddalf>","date":"2024-02-28T08:36:53","subject":"Re: [PATCH 6/9] libcamera: v4l2_subdevice: Rename\n\tV4L2SubdeviceFormat::mbus_code to code","submitter":{"id":143,"url":"https://patchwork.libcamera.org/api/people/143/","name":"Jacopo Mondi","email":"jacopo.mondi@ideasonboard.com"},"content":"Hi Laurent\n\nOn Tue, Feb 27, 2024 at 04:09:50PM +0200, Laurent Pinchart wrote:\n> The V4L2SubdeviceFormat::mbus_code member doesn't follow the libcamera\n> coding 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>\n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nmakes sense!\nReviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n\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(-)\n>\n> diff --git a/include/libcamera/internal/v4l2_subdevice.h b/include/libcamera/internal/v4l2_subdevice.h\n> index 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>\n> diff --git a/src/libcamera/camera_sensor.cpp b/src/libcamera/camera_sensor.cpp\n> index 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);\n> diff --git a/src/libcamera/pipeline/imx8-isi/imx8-isi.cpp b/src/libcamera/pipeline/imx8-isi/imx8-isi.cpp\n> index 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);\n> diff --git a/src/libcamera/pipeline/ipu3/cio2.cpp b/src/libcamera/pipeline/ipu3/cio2.cpp\n> index 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;\n> diff --git a/src/libcamera/pipeline/ipu3/imgu.cpp b/src/libcamera/pipeline/ipu3/imgu.cpp\n> index 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);\n> diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> index 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\n> diff --git a/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp b/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp\n> index 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)\n> diff --git a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp\n> index 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>\n> diff --git a/src/libcamera/pipeline/rpi/vc4/vc4.cpp b/src/libcamera/pipeline/rpi/vc4/vc4.cpp\n> index 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 &&\n> diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp\n> index 911051b28498..1145e80847ba 100644\n> --- a/src/libcamera/pipeline/simple/simple.cpp\n> +++ b/src/libcamera/pipeline/simple/simple.cpp\n> @@ -562,13 +562,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> @@ -576,7 +576,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> @@ -706,7 +706,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> @@ -1120,7 +1120,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,\n> diff --git a/src/libcamera/pipeline/vimc/vimc.cpp b/src/libcamera/pipeline/vimc/vimc.cpp\n> index 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;\n> diff --git a/src/libcamera/v4l2_subdevice.cpp b/src/libcamera/v4l2_subdevice.cpp\n> index d48d12f26042..19ddecf714c6 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;\n> diff --git a/test/camera-sensor.cpp b/test/camera-sensor.cpp\n> index 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)\n> diff --git a/test/v4l2_videodevice/v4l2_videodevice_test.cpp b/test/v4l2_videodevice/v4l2_videodevice_test.cpp\n> index 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> --\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 6F980BD160\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 28 Feb 2024 08:36:58 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 1473762867;\n\tWed, 28 Feb 2024 09:36:58 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id CB61462865\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 28 Feb 2024 09:36:56 +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 32BB1672;\n\tWed, 28 Feb 2024 09:36:44 +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=\"hckd3ZbC\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1709109404;\n\tbh=qe+TMQCrmY7nuLot/Pt1HJxfBUCfHErbovolYnCommA=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=hckd3ZbCMuJZwh/Jddzx6TuBT3t5Rpft8338ODZmPdbjC3kpCxYzjfOkNvKKr9jdR\n\tQow+5UdMwkOFP8QZzfkD6asIsi9wFGBIZDqqSHNSUKArLcwuRtkKk6reob+gdziXXm\n\t9o8oyLsPzr42s+M6L7IZhmhvrXyU54WQ3wO8EKvU=","Date":"Wed, 28 Feb 2024 09:36:53 +0100","From":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Subject":"Re: [PATCH 6/9] libcamera: v4l2_subdevice: Rename\n\tV4L2SubdeviceFormat::mbus_code to code","Message-ID":"<7huybkwgxnale2vdrcpzt3miigcqdaibwmetm7mg2xxkfobckz@smdvqvoddalf>","References":"<20240227140953.26093-1-laurent.pinchart@ideasonboard.com>\n\t<20240227140953.26093-7-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20240227140953.26093-7-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","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]