From 54929aca289c3ab386cb8267008df4c05dbfab6d Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Thu, 26 Jun 2025 12:45:26 +0100 Subject: [PATCH] drivers: media: rpi: cfe: Avoid unpack operation for 16-bit formats The unpack operation is redundant for 16-bit sensor formats, don't set the hardware to do it in these cases. Signed-off-by: Naushir Patuck --- drivers/media/platform/raspberrypi/rp1_cfe/cfe.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/raspberrypi/rp1_cfe/cfe.c b/drivers/media/platform/raspberrypi/rp1_cfe/cfe.c index e7b63495b39101..19189f2ef185fb 100644 --- a/drivers/media/platform/raspberrypi/rp1_cfe/cfe.c +++ b/drivers/media/platform/raspberrypi/rp1_cfe/cfe.c @@ -884,7 +884,9 @@ static void cfe_start_channel(struct cfe_node *node) width = source_fmt->width; height = source_fmt->height; - if (node->vid_fmt.fmt.pix.pixelformat == + /* We don't need to repack in the case of 16-bit output. */ + if (fmt->depth != 16 && + node->vid_fmt.fmt.pix.pixelformat == fmt->remap[CFE_REMAP_16BIT]) mode = CSI2_MODE_REMAP; else if (node->vid_fmt.fmt.pix.pixelformat ==