aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/bcm27xx/patches-5.4/950-0938-staging-vc04_services-codec-Fix-incorrect-buffer-cle.patch
diff options
context:
space:
mode:
authorÁlvaro Fernández Rojas <noltari@gmail.com>2021-02-18 18:04:33 +0100
committerÁlvaro Fernández Rojas <noltari@gmail.com>2021-02-18 23:42:32 +0100
commitf07e572f6447465d8938679533d604e402b0f066 (patch)
treecb333bd2a67e59e7c07659514850a0fd55fc825e /target/linux/bcm27xx/patches-5.4/950-0938-staging-vc04_services-codec-Fix-incorrect-buffer-cle.patch
parent5d3a6fd970619dfc55f8259035c3027d7613a2a6 (diff)
downloadupstream-f07e572f6447465d8938679533d604e402b0f066.tar.gz
upstream-f07e572f6447465d8938679533d604e402b0f066.tar.bz2
upstream-f07e572f6447465d8938679533d604e402b0f066.zip
bcm27xx: import latest patches from the RPi foundation
bcm2708: boot tested on RPi B+ v1.2 bcm2709: boot tested on RPi 3B v1.2 and RPi 4B v1.1 4G bcm2710: boot tested on RPi 3B v1.2 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.4/950-0938-staging-vc04_services-codec-Fix-incorrect-buffer-cle.patch')
-rw-r--r--target/linux/bcm27xx/patches-5.4/950-0938-staging-vc04_services-codec-Fix-incorrect-buffer-cle.patch52
1 files changed, 52 insertions, 0 deletions
diff --git a/target/linux/bcm27xx/patches-5.4/950-0938-staging-vc04_services-codec-Fix-incorrect-buffer-cle.patch b/target/linux/bcm27xx/patches-5.4/950-0938-staging-vc04_services-codec-Fix-incorrect-buffer-cle.patch
new file mode 100644
index 0000000000..14736dc2dc
--- /dev/null
+++ b/target/linux/bcm27xx/patches-5.4/950-0938-staging-vc04_services-codec-Fix-incorrect-buffer-cle.patch
@@ -0,0 +1,52 @@
+From 84fa15b87a5f938c064ee2d9fca43248865ffbec Mon Sep 17 00:00:00 2001
+From: Dave Stevenson <dave.stevenson@raspberrypi.com>
+Date: Thu, 13 Aug 2020 16:58:18 +0100
+Subject: [PATCH] staging: vc04_services: codec: Fix incorrect buffer
+ cleanup
+
+The allocated input and output buffers are initialised in
+buf_init and should only be cleared up in buf_cleanup.
+stop_streaming was (incorrectly) cleaning up the buffers to
+avoid an issue in videobuf2 that had been fixed by the orphaned
+buffer support.
+
+Remove the erroneous cleanup.
+
+Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
+---
+ .../bcm2835-codec/bcm2835-v4l2-codec.c | 17 +----------------
+ 1 file changed, 1 insertion(+), 16 deletions(-)
+
+--- a/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c
++++ b/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c
+@@ -2320,10 +2320,7 @@ static void bcm2835_codec_stop_streaming
+ struct bcm2835_codec_q_data *q_data = get_q_data(ctx, q->type);
+ struct vchiq_mmal_port *port = get_port_data(ctx, q->type);
+ struct vb2_v4l2_buffer *vbuf;
+- struct vb2_v4l2_buffer *vb2;
+- struct v4l2_m2m_buffer *m2m;
+- struct m2m_mmal_buffer *buf;
+- int ret, i;
++ int ret;
+
+ v4l2_dbg(1, debug, &ctx->dev->v4l2_dev, "%s: type: %d - return buffers\n",
+ __func__, q->type);
+@@ -2363,18 +2360,6 @@ static void bcm2835_codec_stop_streaming
+ }
+ }
+
+- /*
+- * Release the VCSM handle here as otherwise REQBUFS(0) aborts because
+- * someone is using the dmabuf before giving the driver a chance to do
+- * anything about it.
+- */
+- for (i = 0; i < q->num_buffers; i++) {
+- vb2 = to_vb2_v4l2_buffer(q->bufs[i]);
+- m2m = container_of(vb2, struct v4l2_m2m_buffer, vb);
+- buf = container_of(m2m, struct m2m_mmal_buffer, m2m);
+-
+- bcm2835_codec_mmal_buf_cleanup(&buf->mmal);
+- }
+
+ /* If both ports disabled, then disable the component */
+ if (!ctx->component->input[0].enabled &&