7fe0c50740fdfb2e01218761472a7708f101203a
[openwrt/staging/ansuel.git] /
1 From 8d53cc5b4b2a6f9baed7a0aa801a39ad9dce9bf8 Mon Sep 17 00:00:00 2001
2 From: Naushir Patuck <naush@raspberrypi.com>
3 Date: Thu, 26 Oct 2023 08:55:24 +0100
4 Subject: [PATCH] drivers: media: pisp_be: Add back V4L2_PIX_FMT_RPI_BE format
5
6 Add the opaque V4L2_PIX_FMT_RPI_BE format back to the format list as it
7 is needed for the verification test suite. Also set the default format
8 to YUV420 non-multiplanar.
9
10 Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
11 ---
12 drivers/media/platform/raspberrypi/pisp_be/pisp_be.c | 9 ++++++---
13 .../media/platform/raspberrypi/pisp_be/pisp_be_formats.h | 5 +++++
14 2 files changed, 11 insertions(+), 3 deletions(-)
15
16 --- a/drivers/media/platform/raspberrypi/pisp_be/pisp_be.c
17 +++ b/drivers/media/platform/raspberrypi/pisp_be/pisp_be.c
18 @@ -1230,8 +1230,11 @@ static int try_format(struct v4l2_format
19 return verify_be_pix_format(f, node);
20
21 fmt = find_format(pixfmt);
22 - if (!fmt)
23 - fmt = find_format(V4L2_PIX_FMT_YUV420M);
24 + if (!fmt) {
25 + dev_dbg(pispbe->dev, "%s: [%s] Format not found, defaulting to YUV420\n",
26 + __func__, NODE_NAME(node));
27 + fmt = find_format(V4L2_PIX_FMT_YUV420);
28 + }
29
30 f->fmt.pix_mp.pixelformat = fmt->fourcc;
31 f->fmt.pix_mp.num_planes = fmt->num_planes;
32 @@ -1576,7 +1579,7 @@ static void node_set_default_format(stru
33 } else {
34 struct v4l2_format f = {0};
35
36 - f.fmt.pix_mp.pixelformat = V4L2_PIX_FMT_YUV420M;
37 + f.fmt.pix_mp.pixelformat = V4L2_PIX_FMT_YUV420;
38 f.fmt.pix_mp.width = 1920;
39 f.fmt.pix_mp.height = 1080;
40 f.type = node->buf_type;
41 --- a/drivers/media/platform/raspberrypi/pisp_be/pisp_be_formats.h
42 +++ b/drivers/media/platform/raspberrypi/pisp_be/pisp_be_formats.h
43 @@ -457,6 +457,11 @@ static const struct pisp_be_format suppo
44 .colorspace_mask = V4L2_COLORSPACE_MASK_RAW,
45 .colorspace_default = V4L2_COLORSPACE_RAW,
46 },
47 + /* Opaque BE format for HW verification. */
48 + {
49 + .fourcc = V4L2_PIX_FMT_RPI_BE,
50 + .align = 32,
51 + },
52 };
53
54 static const struct pisp_be_format meta_out_supported_formats[] = {