unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
blob 0f318398744a26b5807491b9254d2cb4dd21c578 1805 bytes (raw)
name: gnu/packages/patches/amlogic-0038-WIP-drivers-meson-vdec-check-if-parser-has-really-pa.patch 	 # note: path name is non-authoritative(*)

 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
 
From 8d43f5852bdc1a6925e45c57de499ad61547cde1 Mon Sep 17 00:00:00 2001
From: Neil Armstrong <narmstrong@baylibre.com>
Date: Mon, 22 Nov 2021 09:15:21 +0000
Subject: [PATCH 38/73] WIP: drivers: meson: vdec: check if parser has really
 parser before marking input buffer as error

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
---
 drivers/staging/media/meson/vdec/esparser.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/media/meson/vdec/esparser.c b/drivers/staging/media/meson/vdec/esparser.c
index df5956c6141d..06f627b141fb 100644
--- a/drivers/staging/media/meson/vdec/esparser.c
+++ b/drivers/staging/media/meson/vdec/esparser.c
@@ -300,6 +300,7 @@ esparser_queue(struct amvdec_session *sess, struct vb2_v4l2_buffer *vbuf)
 	u32 num_dst_bufs = 0;
 	u32 offset;
 	u32 pad_size;
+	u32 wp, wp2;
 
 	/*
 	 * When max ref frame is held by VP9, this should be -= 3 to prevent a
@@ -354,15 +355,20 @@ esparser_queue(struct amvdec_session *sess, struct vb2_v4l2_buffer *vbuf)
 	}
 
 	pad_size = esparser_pad_start_code(core, vb, payload_size);
+	wp = amvdec_read_parser(core, PARSER_VIDEO_WP);
 	ret = esparser_write_data(core, phy, payload_size + pad_size);
+	wp2 = amvdec_read_parser(core, PARSER_VIDEO_WP);
 
 	if (ret <= 0) {
-		dev_warn(core->dev, "esparser: input parsing error\n");
-		amvdec_remove_ts(sess, vb->timestamp);
-		v4l2_m2m_buf_done(vbuf, VB2_BUF_STATE_ERROR);
 		amvdec_write_parser(core, PARSER_FETCH_CMD, 0);
 
-		return 0;
+		if (ret < 0 || wp2 == wp) {
+			dev_err(core->dev, "esparser: input parsing error ret %d (%x <=> %x)\n", ret, wp, wp2);
+			amvdec_remove_ts(sess, vb->timestamp);
+			v4l2_m2m_buf_done(vbuf, VB2_BUF_STATE_ERROR);
+
+			return 0;
+		}
 	}
 
 	atomic_inc(&sess->esparser_queued_bufs);
-- 
2.17.1


debug log:

solving 0f31839874 ...
found 0f31839874 in https://yhetil.org/guix-patches/C2ORkCSHJz-4jxwCauZznk4tZlP9KS4u_3Ywe4q2QrfJ7tvIswRWw4vX6OuzXDIHRriNNTQaCiYC67GgL30p8g80J9OcduCgaoZ8XNf-amE=@protonmail.com/

applying [1/1] https://yhetil.org/guix-patches/C2ORkCSHJz-4jxwCauZznk4tZlP9KS4u_3Ywe4q2QrfJ7tvIswRWw4vX6OuzXDIHRriNNTQaCiYC67GgL30p8g80J9OcduCgaoZ8XNf-amE=@protonmail.com/
diff --git a/gnu/packages/patches/amlogic-0038-WIP-drivers-meson-vdec-check-if-parser-has-really-pa.patch b/gnu/packages/patches/amlogic-0038-WIP-drivers-meson-vdec-check-if-parser-has-really-pa.patch
new file mode 100644
index 0000000000..0f31839874

1:23: space before tab in indent.
 	u32 num_dst_bufs = 0;
1:24: space before tab in indent.
 	u32 offset;
1:25: space before tab in indent.
 	u32 pad_size;
1:27: trailing whitespace.
 
1:28: space before tab in indent.
 	/*
Checking patch gnu/packages/patches/amlogic-0038-WIP-drivers-meson-vdec-check-if-parser-has-really-pa.patch...
Applied patch gnu/packages/patches/amlogic-0038-WIP-drivers-meson-vdec-check-if-parser-has-really-pa.patch cleanly.
warning: squelched 14 whitespace errors
warning: 19 lines add whitespace errors.

index at:
100644 0f318398744a26b5807491b9254d2cb4dd21c578	gnu/packages/patches/amlogic-0038-WIP-drivers-meson-vdec-check-if-parser-has-really-pa.patch

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).