[PATCH 6.19 615/844] media: stm32: dcmipp: byteproc: disable compose for all bayers

From: Sasha Levin

Date: Sat Feb 28 2026 - 15:43:16 EST


From: Alain Volmat <alain.volmat@xxxxxxxxxxx>

[ Upstream commit 3363aa2640f1738ad7fc56ea56f5e0301ad97196 ]

Avoid possibility to perform compose on all frames which mbus code is
within the bayer range or jpeg format.

Fixes: 822c72eb1519 ("media: stm32: dcmipp: add bayer 10~14 bits formats")
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Alain Volmat <alain.volmat@xxxxxxxxxxx>
Signed-off-by: Sakari Ailus <sakari.ailus@xxxxxxxxxxxxxxx>
Signed-off-by: Hans Verkuil <hverkuil+cisco@xxxxxxxxxx>
Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>
---
.../media/platform/st/stm32/stm32-dcmipp/dcmipp-byteproc.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-byteproc.c b/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-byteproc.c
index db76a02a1848a..ec1d773d5ad12 100644
--- a/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-byteproc.c
+++ b/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-byteproc.c
@@ -130,11 +130,8 @@ static void dcmipp_byteproc_adjust_compose(struct v4l2_rect *r,
r->left = 0;

/* Compose is not possible for JPEG or Bayer formats */
- if (fmt->code == MEDIA_BUS_FMT_JPEG_1X8 ||
- fmt->code == MEDIA_BUS_FMT_SBGGR8_1X8 ||
- fmt->code == MEDIA_BUS_FMT_SGBRG8_1X8 ||
- fmt->code == MEDIA_BUS_FMT_SGRBG8_1X8 ||
- fmt->code == MEDIA_BUS_FMT_SRGGB8_1X8) {
+ if (fmt->code >= MEDIA_BUS_FMT_SBGGR8_1X8 &&
+ fmt->code <= MEDIA_BUS_FMT_JPEG_1X8) {
r->width = fmt->width;
r->height = fmt->height;
return;
--
2.51.0