]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
media: stm32: dcmipp: byteproc: disable compose for all bayers
authorAlain Volmat <alain.volmat@foss.st.com>
Fri, 19 Dec 2025 14:30:36 +0000 (15:30 +0100)
committerHans Verkuil <hverkuil+cisco@kernel.org>
Fri, 16 Jan 2026 13:08:52 +0000 (14:08 +0100)
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@vger.kernel.org
Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-byteproc.c

index db76a02a1848abbd3eb5e88b906ed2e0d1b7e563..ec1d773d5ad123eac4930b7a451e25c5bf0d1892 100644 (file)
@@ -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;