]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
media: bcm2835-unicam: Allow setting of unpacked formats
authorNaushir Patuck <naush@raspberrypi.com>
Wed, 27 Nov 2024 11:15:13 +0000 (11:15 +0000)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Thu, 19 Dec 2024 11:50:18 +0000 (12:50 +0100)
When matching formats via try_fmt/set_fmt ioctls, test for the unpacked
formats as well as packed formats. This allows userland clients setup
unpacking to 16-bits from the 10/12/14-packed CSI2 formats.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/platform/broadcom/bcm2835-unicam.c

index 36fb186a042136b2d69166d6fd1020b80c303c6c..d573d4d898811bd6b8315a801257a8e705532722 100644 (file)
@@ -547,7 +547,8 @@ unicam_find_format_by_fourcc(u32 fourcc, u32 pad)
        }
 
        for (i = 0; i < num_formats; ++i) {
-               if (formats[i].fourcc == fourcc)
+               if (formats[i].fourcc == fourcc ||
+                   formats[i].unpacked_fourcc == fourcc)
                        return &formats[i];
        }