aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/bcm27xx/patches-5.10/950-0502-staging-bcm2835-codec-Add-support-for-pixel-aspect-r.patch
diff options
context:
space:
mode:
authorÁlvaro Fernández Rojas <noltari@gmail.com>2021-08-21 10:54:34 +0200
committerÁlvaro Fernández Rojas <noltari@gmail.com>2021-08-21 19:07:07 +0200
commit8299d1f057439f94c6a4412e2e5c5082b82a30c9 (patch)
tree1bf678d61f11f7394493be464c7876e496f7faed /target/linux/bcm27xx/patches-5.10/950-0502-staging-bcm2835-codec-Add-support-for-pixel-aspect-r.patch
parent33b6885975ce376ff075362b7f0890326043111b (diff)
downloadupstream-8299d1f057439f94c6a4412e2e5c5082b82a30c9.tar.gz
upstream-8299d1f057439f94c6a4412e2e5c5082b82a30c9.tar.bz2
upstream-8299d1f057439f94c6a4412e2e5c5082b82a30c9.zip
bcm27xx: add kernel 5.10 support
Rebased RPi foundation patches on linux 5.10.59, removed applied and reverted patches, wireless patches and defconfig patches. bcm2708: boot tested on RPi B+ v1.2 bcm2709: boot tested on RPi 4B v1.1 4G bcm2711: boot tested on RPi 4B v1.1 4G Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Diffstat (limited to 'target/linux/bcm27xx/patches-5.10/950-0502-staging-bcm2835-codec-Add-support-for-pixel-aspect-r.patch')
-rw-r--r--target/linux/bcm27xx/patches-5.10/950-0502-staging-bcm2835-codec-Add-support-for-pixel-aspect-r.patch82
1 files changed, 82 insertions, 0 deletions
diff --git a/target/linux/bcm27xx/patches-5.10/950-0502-staging-bcm2835-codec-Add-support-for-pixel-aspect-r.patch b/target/linux/bcm27xx/patches-5.10/950-0502-staging-bcm2835-codec-Add-support-for-pixel-aspect-r.patch
new file mode 100644
index 0000000000..ed5e3f7fa1
--- /dev/null
+++ b/target/linux/bcm27xx/patches-5.10/950-0502-staging-bcm2835-codec-Add-support-for-pixel-aspect-r.patch
@@ -0,0 +1,82 @@
+From 5a1f76940af2691627837bb4f181a672abfaffa2 Mon Sep 17 00:00:00 2001
+From: Dave Stevenson <dave.stevenson@raspberrypi.com>
+Date: Tue, 2 Feb 2021 15:50:18 +0000
+Subject: [PATCH] staging/bcm2835-codec: Add support for pixel aspect
+ ratio
+
+If the format is detected by the driver and a V4L2_EVENT_SOURCE_CHANGE
+event is generated, then pass on the pixel aspect ratio as well.
+
+Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
+---
+ .../bcm2835-codec/bcm2835-v4l2-codec.c | 31 +++++++++++++++++++
+ 1 file changed, 31 insertions(+)
+
+--- a/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c
++++ b/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c
+@@ -602,6 +602,7 @@ struct bcm2835_codec_q_data {
+ unsigned int crop_width;
+ unsigned int crop_height;
+ bool selection_set;
++ struct v4l2_fract aspect_ratio;
+
+ unsigned int sizeimage;
+ unsigned int sequence;
+@@ -981,6 +982,9 @@ static void handle_fmt_changed(struct bc
+ if (format->es.video.color_space)
+ color_mmal2v4l(ctx, format->es.video.color_space);
+
++ q_data->aspect_ratio.numerator = format->es.video.par.num;
++ q_data->aspect_ratio.denominator = format->es.video.par.den;
++
+ queue_res_chg_event(ctx);
+ }
+
+@@ -1657,6 +1661,29 @@ static int vidioc_g_parm(struct file *fi
+ return 0;
+ }
+
++static int vidioc_g_pixelaspect(struct file *file, void *fh, int type,
++ struct v4l2_fract *f)
++{
++ struct bcm2835_codec_ctx *ctx = file2ctx(file);
++
++ /*
++ * The selection API takes V4L2_BUF_TYPE_VIDEO_CAPTURE and
++ * V4L2_BUF_TYPE_VIDEO_OUTPUT, even if the device implements the MPLANE
++ * API. The V4L2 core will have converted the MPLANE variants to
++ * non-MPLANE.
++ * Open code this instead of using get_q_data in this case.
++ */
++ if (ctx->dev->role != DECODE)
++ return -ENOIOCTLCMD;
++
++ if (type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
++ return -EINVAL;
++
++ *f = ctx->q_data[V4L2_M2M_DST].aspect_ratio;
++
++ return 0;
++}
++
+ static int vidioc_subscribe_evt(struct v4l2_fh *fh,
+ const struct v4l2_event_subscription *sub)
+ {
+@@ -2082,6 +2109,8 @@ static const struct v4l2_ioctl_ops bcm28
+ .vidioc_g_parm = vidioc_g_parm,
+ .vidioc_s_parm = vidioc_s_parm,
+
++ .vidioc_g_pixelaspect = vidioc_g_pixelaspect,
++
+ .vidioc_subscribe_event = vidioc_subscribe_evt,
+ .vidioc_unsubscribe_event = v4l2_event_unsubscribe,
+
+@@ -2640,6 +2669,8 @@ static int bcm2835_codec_open(struct fil
+ ctx->q_data[V4L2_M2M_DST].crop_width,
+ ctx->q_data[V4L2_M2M_DST].height,
+ ctx->q_data[V4L2_M2M_DST].fmt);
++ ctx->q_data[V4L2_M2M_DST].aspect_ratio.numerator = 1;
++ ctx->q_data[V4L2_M2M_DST].aspect_ratio.denominator = 1;
+
+ ctx->colorspace = V4L2_COLORSPACE_REC709;
+ ctx->bitrate = 10 * 1000 * 1000;