summaryrefslogtreecommitdiffstats
path: root/target/linux/bcm27xx/patches-6.6/950-0693-drivers-media-pisp_be-Add-back-V4L2_PIX_FMT_RPI_BE-f.patch
blob: e8bae67b2e90c95886ca7ae161851f24d5c9920c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
From 5c522d33c5e30f423100a52972ffbeac7581e7f3 Mon Sep 17 00:00:00 2001
From: Naushir Patuck <naush@raspberrypi.com>
Date: Thu, 26 Oct 2023 08:55:24 +0100
Subject: [PATCH 0693/1085] drivers: media: pisp_be: Add back
 V4L2_PIX_FMT_RPI_BE format

Add the opaque V4L2_PIX_FMT_RPI_BE format back to the format list as it
is needed for the verification test suite. Also set the default format
to YUV420 non-multiplanar.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
---
 drivers/media/platform/raspberrypi/pisp_be/pisp_be.c     | 9 ++++++---
 .../media/platform/raspberrypi/pisp_be/pisp_be_formats.h | 5 +++++
 2 files changed, 11 insertions(+), 3 deletions(-)

--- a/drivers/media/platform/raspberrypi/pisp_be/pisp_be.c
+++ b/drivers/media/platform/raspberrypi/pisp_be/pisp_be.c
@@ -1230,8 +1230,11 @@ static int try_format(struct v4l2_format
 		return verify_be_pix_format(f, node);
 
 	fmt = find_format(pixfmt);
-	if (!fmt)
-		fmt = find_format(V4L2_PIX_FMT_YUV420M);
+	if (!fmt) {
+		dev_dbg(pispbe->dev, "%s: [%s] Format not found, defaulting to YUV420\n",
+			__func__, NODE_NAME(node));
+		fmt = find_format(V4L2_PIX_FMT_YUV420);
+	}
 
 	f->fmt.pix_mp.pixelformat = fmt->fourcc;
 	f->fmt.pix_mp.num_planes = fmt->num_planes;
@@ -1576,7 +1579,7 @@ static void node_set_default_format(stru
 	} else {
 		struct v4l2_format f = {0};
 
-		f.fmt.pix_mp.pixelformat = V4L2_PIX_FMT_YUV420M;
+		f.fmt.pix_mp.pixelformat = V4L2_PIX_FMT_YUV420;
 		f.fmt.pix_mp.width = 1920;
 		f.fmt.pix_mp.height = 1080;
 		f.type = node->buf_type;
--- a/drivers/media/platform/raspberrypi/pisp_be/pisp_be_formats.h
+++ b/drivers/media/platform/raspberrypi/pisp_be/pisp_be_formats.h
@@ -457,6 +457,11 @@ static const struct pisp_be_format suppo
 		.colorspace_mask    = V4L2_COLORSPACE_MASK_RAW,
 		.colorspace_default = V4L2_COLORSPACE_RAW,
 	},
+	/* Opaque BE format for HW verification. */
+	{
+		.fourcc		    = V4L2_PIX_FMT_RPI_BE,
+		.align		    = 32,
+	},
 };
 
 static const struct pisp_be_format meta_out_supported_formats[] = {