Re: [PATCH v4 14/15] media: atomisp: allow raw Bayer capture

From: Andy Shevchenko

Date: Mon Aug 31 2026 - 07:53:01 EST


On Fri, Aug 28, 2026 at 06:14:56PM +0200, Maurizio Casciano wrote:
> AtomISP currently rejects all raw formats and silently substitutes
> YUV420. This prevents userspace camera processing stacks from obtaining
> unprocessed sensor frames.
>
> Enumerate only the raw format matching the sensor media-bus code and
> reconcile raw requests with the code selected by the sensor. Userspace
> opts in by selecting that raw V4L2 pixel format with VIDIOC_S_FMT.
>
> Raw formats expose the full sensor transport frame so ISP2401 can use
> its copy pipeline. Processed formats retain the existing global padding
> behavior; selecting a smaller receiver crop remains a userspace pipeline
> decision.

...

> Link: https://lore.kernel.org/linux-media/apCc_pt5dDxGJrei@ashevche-desk.local/
> Link: https://lore.kernel.org/linux-media/apF0Cds9fnqQ7XRg@kekkonen.localdomain/

Drop these.

...

> void atomisp_get_padding(struct atomisp_device *isp, struct v4l2_area size,

> u32 min_pad_w = ISP2400_MIN_PAD_W;
> u32 min_pad_h = ISP2400_MIN_PAD_H;
> struct v4l2_mbus_framefmt *sink;
> -
> if (!input->crop_support) {
> pad->width = pad_w;
> pad->height = pad_h;

Stray change.

...

> - size.width = f->width;
> - size.height = f->height;
> - atomisp_get_padding(isp, size, &padding);
> + if (fmt->sh_fmt == IA_CSS_FRAME_FORMAT_RAW) {
> + padding = (struct v4l2_area) { };
> + } else {
> + size.width = f->width;
> + size.height = f->height;
> + atomisp_get_padding(isp, size, &padding);
> + }

Compound literal is not needed here. With the previous suggestions this becomes

if (fmt->sh_fmt == IA_CSS_FRAME_FORMAT_RAW)
padding = {};
else
atomisp_get_padding(isp, f, &padding);

...

> ffmt.code);
> return -EINVAL;
> }

Not enough context, but I assume a blank line is good to have here.

> + if (fmt->sh_fmt == IA_CSS_FRAME_FORMAT_RAW &&
> + fmt->mbus_code != snr_fmt->mbus_code) {
> + fmt = snr_fmt;
> + f->pixelformat = fmt->pixelformat;
> + }

...

> + if (format->sh_fmt == IA_CSS_FRAME_FORMAT_RAW)
> + padding = (struct v4l2_area) { };

padding = {};

should suffice.

--
With Best Regards,
Andy Shevchenko