Re: [PATCH v4 1/2] media: atomisp: csi2: Remove unimplemented DPCM decompression
From: Sakari Ailus
Date: Wed Apr 22 2026 - 08:46:17 EST
Hi Debjeet,
On Wed, Apr 22, 2026 at 05:50:05PM +0530, Debjeet Banerjee wrote:
> The source pad format handling attempted to map DPCM-compressed mbus
> codes to their uncompressed equivalents. However, the rest of the
> driver does not support DPCM decompression, making this dead code.
>
> Remove the DPCM unmapping logic and simplify to directly copy the sink
> pad format to the source pad. Add an explicit comment stating that
> DPCM is not supported.
>
> Signed-off-by: Debjeet Banerjee <debjeetbanerjee48@xxxxxxxxx>
> ---
> v4:
> - Complete removal of DPCM decompression attempt (per Sakari Ailus feedback)
> - Keep source pad simply copying sink pad format without unmapping
> - Replace detailed comment with explicit "DPCM is not supported" statement
>
> v3:
> - Drop "staging:" prefix in subject (per Andy Shevchenko)
>
> v2:
> - Rebased onto latest media tree (fix CI apply failure)
> - Fix missing linux-staging recipient (typo in v1)
> - Fix indentation
> ---
> drivers/staging/media/atomisp/pci/atomisp_csi2.c | 15 ++++-----------
> 1 file changed, 4 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/staging/media/atomisp/pci/atomisp_csi2.c b/drivers/staging/media/atomisp/pci/atomisp_csi2.c
> index e723304bec80..64419c1a805e 100644
> --- a/drivers/staging/media/atomisp/pci/atomisp_csi2.c
> +++ b/drivers/staging/media/atomisp/pci/atomisp_csi2.c
> @@ -107,17 +107,10 @@ int atomisp_csi2_set_ffmt(struct v4l2_subdev *sd,
> &tmp_ffmt);
> }
>
> - /*
> - * The source pad must expose the uncompressed format even when the sink
> - * pad receives DPCM-compressed data. The hardware decompresses DPCM
> - * (e.g. SGRBG10_DPCM8_1X8 -> SGRBG10_1X10) between sink and source,
> - * so propagate the sink format but map the mbus code to its uncompressed
> - * equivalent. atomisp_subdev_uncompressed_code() returns the code
> - * unchanged for formats that are not DPCM-compressed.
> - */
> - *actual_ffmt = *__csi2_get_format(csi2, sd_state, which, CSI2_PAD_SINK);
> - actual_ffmt->code = atomisp_subdev_uncompressed_code(actual_ffmt->code);
> - *ffmt = *actual_ffmt;
This won't apply to my atomisp branch.
> + /* Source pad format is copied from sink pad. DPCM is not supported. */
> + *actual_ffmt = *ffmt = *__csi2_get_format(csi2, sd_state, which,
> + CSI2_PAD_SINK);
> +
> return 0;
> }
>
--
Regards,
Sakari Ailus