| Message ID | 20261102170303.1973892-4-jernej.skrabec@gmail.com (mailing list archive) |
|---|---|
| State | New |
| Headers |
Return-Path: <linux-sunxi+bounces-27054-sunxi=pue.re@lists.linux.dev>
X-Original-To: noreply@patchwork.local
Delivered-To: noreply@patchwork.local
Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
by mxe881.netcup.net (Postfix) with ESMTPS id C54641C3410
for <noreply@patchwork.local>; Mon, 2 Nov 2026 19:02:11 +0100 (CET)
Authentication-Results: mxe881;
dkim=pass header.d=gmail.com;
spf=pass (sender IP is 172.105.105.114)
smtp.mailfrom=linux-sunxi+bounces-27054-noreply=patchwork.local@lists.linux.dev
smtp.helo=tor.lore.kernel.org
Received-SPF: pass (mxe881: domain of lists.linux.dev designates
172.105.105.114 as permitted sender) client-ip=172.105.105.114;
envelope-from=linux-sunxi+bounces-27054-noreply=patchwork.local@lists.linux.dev;
helo=tor.lore.kernel.org;
Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org
[100.77.114.92])
by tor.lore.kernel.org (Postfix) with ESMTP id 804691A516B
for <noreply@patchwork.local>; Mon, 2 Nov 2026 17:34:19 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org;
arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
t=1793639004;
b=YdRgeTqp+pCRyFN4TUcIZHr+lhbch12XVumc7WhXnMyEPbzG/7luSPfdN8HHlRRQi/kw
MiDxpF3/UtTgrEaM5yi6IFbBqMz3YK07hHa5Aqc2EAyGl2fw8mEIcJ4kROB6aP5udVYVh
r4LUi5ZIUyYAeLPEWTqv4WVek0MJZLEsgaNyzpDSRBYaD89Y4rOaIuki0Jj8DOcV3LpLP
hffdj2Wu/ag844k6CoqCvSe0a0m7Zl5Ex5Bon20Af8JMNHZrhXQEm7jbw9GE/2XwLKCt/
KPmnsUSUbbjot7XgyymcyESJfRRNByTBDmutBp+5aBKn7myw5SazKlT+6awDaExFY2Q==
ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1793639004;
h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
X-Google-DKIM-Signature:X-Forwarded-Encrypted:X-Gm-Message-State:
X-Gm-Gg:X-Received:Received:From:To:Cc:Subject:Date:Message-ID:
X-Mailer:In-Reply-To:References:X-Mailing-List:List-Id:List-Post:
List-Help:List-Subscribe:List-Unsubscribe:List-Owner:Precedence:
MIME-Version:Content-Transfer-Encoding;
bh=MWiUrUc26qsUdMY2n/PhpO+pC2qChhSw9kx320KNwbA=;
b=MjAWVePghCD4fHVphuKgNx8eE9ImBjOu76LeQP8rWDzAMQe4T+Tbg6llYZE0f53EMzkP
/9r4ZDCyk+BjQyl8nL4h5rLbWfB8+pSy7FEcS3ZGfFmpOV+IjuOWgStsIwTuKg2ZzEhd2
ZS9FJ3CsAqfJAQZluHxcHgEuaAFAAoHeQoWIOZVLMFOXGQ8zomiokQ6CLbtIf3NhOg0EV
JiMpNYjDaNt3QNdLk/Yep0S7X+5MZcSPZRMrpLbjLoHjjviiD/qleILoDd45hfzACfCil
/YrYlloFau+a9t4r8SwjUq314zqroan2ZdFuvVLIWBudlGaLy1F9TTgczl/d0iav0Og==
ARC-Authentication-Results: i=2; smtp.subspace.kernel.org;
dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256
header.s=20260707 header.b=G3UT0rCj;
dmarc=pass header.from=gmail.com;
spf=pass smtp.mailfrom=gmail.com;
arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
Received: from localhost.localdomain (localhost [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id 032DB606C573;
Mon, 2 Nov 2026 17:03:24 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key,
unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256
header.s=20260707 header.b=G3UT0rCj
X-Original-To: linux-sunxi@lists.linux.dev
Authentication-Results: smtp.subspace.kernel.org;
arc=none smtp.remote-ip=209.85.221.43
ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
t=1793639003;
b=RpNGkE5AeIP6aW/ZaAQWRcr5LseGybAM74DAHAmiW+X1XZOpIJPXhLkgtmztpALnL9PY
ztwPbmukLBo6cIv/fvDdiAAV5Jg0ZkprCkXCyk51RQnJmS3PYxW3OG+L0L9GVt1uaQkGv
KUivRvmiQeDd8wPhklAeorgleGUZeoHg4Etvk3eOZ4LuvpW4DhMAD0DbvMzQmSaUsJyCb
/dQIwKxHJNPxMcTKvy+W5eV20+B6Gi06IIEcFW8oxGPa4brQtBBKCAlnrcVsUSZg5wFjO
8r99mfxydjkq/tpYnFaGm1M3uN5L7ViVkJu+6sa8600HCLiQHpKZBGfwMxuL6jOOOmg==
ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1793639003;
h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received:
From:To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References:
MIME-Version:Content-Transfer-Encoding;
bh=MWiUrUc26qsUdMY2n/PhpO+pC2qChhSw9kx320KNwbA=;
b=ogXPeXsJTNiLOdWOMGOMovsBHlPX3rA3o5HkIoJcaqOVLzYWURxSRTtrYGqlz0zrnxBc
bRqqJQ6zRG28Q0rpiDiZ0VBRjUc95CaUm0lt0sXEi9lPf/y7nHLwSwsbJa8bxNRhaB/WB
Fskz29rkdpFJeOBUnlPSP9sGa3MH8XZIc7A9db6034EhAfuMrCAGxkyd0JuRYkSjYsHr+
QHvJKhV/MhenBZNdjUxw+75fwJSOflFtmbNsqDo51JJJoO35Z2DIXTCHUqtMOkhMuOYUQ
bqA2PnO6+a8iteRV9HMHO7wA1XEt2RcBgWl/tH3pZ3Zsz11KGW3TDyvA8wohWHUknWQ==
ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
dmarc=pass header.from=gmail.com;
spf=pass smtp.mailfrom=gmail.com;
dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256
header.s=20260707 header.b=G3UT0rCj;
arc=none smtp.remote-ip=209.85.221.43
Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com
[209.85.221.43])
(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
key-exchange X25519 server-signature ECDSA (prime256v1) server-digest
SHA256)
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id 86BDC606C56D
for <linux-sunxi@lists.linux.dev>; Mon, 2 Nov 2026 17:03:23 +0000 (UTC)
DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 86BDC606C56D
Authentication-Results: smtp.subspace.kernel.org;
dmarc=pass (p=none dis=none) header.from=gmail.com
Authentication-Results: smtp.subspace.kernel.org;
spf=pass smtp.mailfrom=gmail.com
Received: by mail-wr1-f43.google.com with SMTP id
ffacd0b85a97d-48af4d4e61fso1989198f8f.2
for <linux-sunxi@lists.linux.dev>;
Mon, 02 Nov 2026 09:03:23 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20260707; t=1793639002; x=1794243802;
darn=lists.linux.dev;
h=content-transfer-encoding:mime-version:references:in-reply-to
:message-id:date:subject:cc:to:from:from:to:cc:subject:date
:message-id:reply-to:content-type;
bh=MWiUrUc26qsUdMY2n/PhpO+pC2qChhSw9kx320KNwbA=;
b=G3UT0rCj1iBXy7FDUShUTSETpGHEjmKraLcN+E1+5ZgdP1sA3GpMlnc7+kSjMjOZD1
SXmgK1Fzmysnyx/S07IaIedChSp3zcJvQPqT1aOE9siDbO60w//cYHydbIWfcH6QcKBK
tG77AD1XzCxKnvaQpAb3tw8JSrFdhgGE6DfAFIXlhNQkVcPo3nXRTLtJ+u8ykn72YDKY
fSNm1l8TgXDaQaayG69M2VQKcfuqohSMUPGYSGSBJmWIcAmeXBTXx6nK/BbAuy1mln6r
pScl1PB1b9oeuhLk6MZZk24q0VT7lnTx8zd9cgkcKW3nYGWDkJYVqVhWIXIKweaDnieP
ZU2Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20260707; t=1793639002; x=1794243802;
h=content-transfer-encoding:mime-version:references:in-reply-to
:message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
:to:cc:subject:date:message-id:reply-to:content-type;
bh=MWiUrUc26qsUdMY2n/PhpO+pC2qChhSw9kx320KNwbA=;
b=VZ1Mx9xgXZaL9Lm+xqOALYt7+NyP3sXuTB8oaUUtgpvIw3Cd3S3qRu9dYQ2Bhs+UZR
UsgILBL6ex8SpnmQ72n28UiToE0p4vNwTE/h0dJPGSpOknfaTP0nvL2a/pZ9rY4evmHX
53xnXFmXHePU6LIVfBMIWHVUQjKxPm87riQofoAMLOUxRIrWcIE3Liyg/SxV1WeGkZQV
H3awY4w7/O1BsIrdjCwTpyosyu99VjbJwCgie30UF69pJsn3zJOxv/bYMxFglvs6NROw
4WX7Tk2kPFgifolnchmY/ivuccSQyaDq1E+Am6XDHv2bc51d4Dqsha45vtl6DAFtamIt
psGA==
X-Forwarded-Encrypted: i=1;
AKwUvBwDF/Y75eqbsI0BH9Wwp+aEMEk6BqziEtPV5PTarhsaChgufuOBO/oweS25OGy+hv5jspmoWYviZIG/Aw==@lists.linux.dev
X-Gm-Message-State: APuU4Z+r/JmlwxqOsQ7LpfNMw9y3MIChtG01KozE5HP0Dw2erBGG/L4Z
t0DreO9Qs1VtflEMEy/caOiAlHkWy5BqFTNEmYkkPmFBB+5do9XbvYJy
X-Gm-Gg: AYBFou1baEHBl3XdrxAt/dXuf4sG+dUyM1cHu3IouRKwf/ISsozCrKVhLGRaqukilqe
zxSmzBf58fn0aQNR8JGDG3H7zCQGRlKVpGi1m1rIxr2qhY9XtfKT4k9S68xiaMNSD4nuMpgSART
B131htKR4AbK1YOMa8JE8Bm2wkdS6MLRyzG8kqIqsOiYx41rKKqhMIbzWYVikcLH1V0Y9KEDDy6
TIPOR4igvBZgCR71L0D4tAN0bdn6AEZDv8Bv9D6SENLFtqvUU7ww41NhMPtwCzE/ynpg7D+XJLj
R9Jfgo3o5txTNR+uQP1qlbOtWNyMcHG+82qIIORcRyvQNI9y73ERMMTyacLK+D8tIGqBCiDcEqR
Dgi+uBQeYzGBDtxEdO8jOiY4nfcGgmAZBq0bHCILLmxX7tBlCZ9A1wTD5RaSmett7gy2H6JGjXg
M7HrmlQW++a03zo3xtqtKDku1Z4Dg6h37SgOyRjySP2I/I+57oZ8ek0T2FnT86FFX06OL44kNKY
r2Q2njSCpdq/9GskG5Blx/0nrmrxLbZDF0Fo/gAdChsFFvwrAQWA9tq2aQDcKhnHbQ8Z4DYMm+X
KcGoJAuMqbKyV0Hx6IShVV7Y7BRz4sdxL/1HjKbHhDv/jnKR1pV8TS7K7dqQ/kor3xVJxtiD4RC
mbvQJ1hjK1S/xOd1ClNLyqfgB+9sw+c5ArNxwTwENnHdwPx0hqEjYHC7u4DafzznrwzWnMu+x6a
9tpXdlhs9TaGRGhTSkneD6ZD3J5wWRZzeoZKC8ora+wiMiMNN44Z9V3WdhoRJkmYaaFsjxO6PuW
scRqFN2U+lCEJGCYwWhv6NSP9XiaUCN0flhbUecT88zbUgdWHUUm9r+DwbdHbV0hvl0MXQ=
X-Received: by 2002:a05:6000:1acb:b0:48b:a7:6396 with SMTP id
ffacd0b85a97d-48e6e4f56dbmr22985553f8f.41.1793639001832;
Mon, 02 Nov 2026 09:03:21 -0800 (PST)
Received: from jernej-laptop (194-152-27-116.dynamic.telemach.net.
[194.152.27.116])
by smtp.gmail.com with ESMTPSA id
ffacd0b85a97d-48e71a4d3cesm23362309f8f.7.2026.11.02.09.03.20
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Mon, 02 Nov 2026 09:03:21 -0800 (PST)
From: Jernej Skrabec <jernej.skrabec@gmail.com>
To: Mauro Carvalho Chehab <mchehab@kernel.org>,
Hans Verkuil <hverkuil@kernel.org>
Cc: Maxime Ripard <mripard@kernel.org>,
Paul Kocialkowski <paulk@sys-base.io>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Chen-Yu Tsai <wens@kernel.org>,
Samuel Holland <samuel@sholland.org>,
Nicolas Dufresne <nicolas.dufresne@collabora.com>,
linux-media@vger.kernel.org,
linux-staging@lists.linux.dev,
linux-arm-kernel@lists.infradead.org,
linux-sunxi@lists.linux.dev,
linux-kernel@vger.kernel.org,
Jernej Skrabec <jernej.skrabec@gmail.com>
Subject: [PATCH 03/10] staging: media: cedrus: h264: mark long-term references
in the frame info
Date: Mon, 2 Nov 2026 18:02:56 +0100
Message-ID: <20261102170303.1973892-4-jernej.skrabec@gmail.com>
X-Mailer: git-send-email 2.56.0
In-Reply-To: <20261102170303.1973892-1-jernej.skrabec@gmail.com>
References: <20261102170303.1973892-1-jernej.skrabec@gmail.com>
X-Mailing-List: linux-sunxi@lists.linux.dev
List-Id: <linux-sunxi.lists.linux.dev>
List-Post: <mailto:linux-sunxi@lists.linux.dev>
List-Help: <mailto:linux-sunxi+help@lists.linux.dev>
List-Subscribe: <mailto:linux-sunxi+subscribe@lists.linux.dev>
List-Unsubscribe: <mailto:linux-sunxi+unsubscribe@lists.linux.dev>
List-Owner: <mailto:linux-sunxi+owner@lists.linux.dev>
Precedence: list
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Rspamd-Server: rspamd-worker-8404
X-Spamd-Result: default: False [-0.69 / 15.00];
BAYES_HAM(-5.50)[100.00%];
RBL_SENDERSCORE(2.00)[172.105.105.114:from];
SUSPICIOUS_RECIPS(1.50)[];
DMARC_POLICY_SOFTFAIL(1.00)[gmail.com : SPF not aligned (relaxed),
No valid DKIM,none];
R_MISSING_CHARSET(0.50)[];
MAILLIST(-0.18)[generic];
MIME_GOOD(-0.10)[text/plain];
BAD_REP_POLICIES(0.10)[];
HAS_LIST_UNSUB(-0.01)[];
ARC_ALLOW(0.00)[subspace.kernel.org:s=arc20261015:i=2];
TAGGED_RCPT(0.00)[];
RCPT_COUNT_TWELVE(0.00)[14];
DBL_BLOCKED_OPENRESOLVER(0.00)[tor.lore.kernel.org:helo,tor.lore.kernel.org:rdns];
FROM_HAS_DN(0.00)[];
FORGED_SENDER_MAILLIST(0.00)[];
FREEMAIL_CC(0.00)[kernel.org,sys-base.io,linuxfoundation.org,sholland.org,collabora.com,vger.kernel.org,lists.linux.dev,lists.infradead.org,gmail.com];
RCVD_VIA_SMTP_AUTH(0.00)[];
FROM_NEQ_ENVFROM(0.00)[jernejskrabec@gmail.com,linux-sunxi@lists.linux.dev];
ASN(0.00)[asn:63949, ipnet:172.105.96.0/20, country:SG];
FREEMAIL_FROM(0.00)[gmail.com];
R_SPF_ALLOW(0.00)[+ip4:172.105.105.114];
TO_DN_SOME(0.00)[];
RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[100.77.114.92:received,194.152.27.116:received,209.85.221.43:received];
RCVD_COUNT_FIVE(0.00)[6];
FORGED_RECIPIENTS_MAILLIST(0.00)[];
RCVD_TLS_LAST(0.00)[];
MIME_TRACE(0.00)[0:+];
TAGGED_FROM(0.00)[bounces-27054-noreply=patchwork.local];
MID_RHS_MATCH_FROM(0.00)[];
RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[172.105.105.114:from]
X-Rspamd-Queue-Id: C54641C3410
X-MORS-Enabled: yes
X-MORS-DOMAIN: patchwork.local
X-MORS-HOSTING: hosting172546
X-MORS-USER: hosting172546
X-getmail-retrieved-from-mailbox: INBOX
|
| Series |
staging: media: cedrus: assorted fixes and VP8 4K support
|
|
Commit Message
Jernej Skrabec
Nov. 2, 2026, 5:02 p.m. UTC
The frame info of a reference has a reference type for each field, in
bits 1:0 for the top field and 5:4 for the bottom one, which is 1 for a
long-term reference. The driver never sets it, so the hardware handles
long-term references like short-term ones, also where they differ, like
in temporal direct and implicit weighted prediction. The vendor library
sets it.
This fixes MR8_BT_B and MR9_BT_B of the H.264 conformance suite.
Fixes: 6eb9b758e307 ("media: cedrus: Add H264 decoding support")
Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
---
drivers/staging/media/sunxi/cedrus/cedrus_h264.c | 12 +++++++++++-
drivers/staging/media/sunxi/cedrus/cedrus_regs.h | 8 ++++++++
2 files changed, 19 insertions(+), 1 deletion(-)
Comments
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Medium] media: cedrus: h264: lost long-term flag in cedrus_write_frame_list() -- commit 2185109fe892e8452d1ff6c43246f08d7ba7e368 Author: Jernej Skrabec <jernej.skrabec@gmail.com> staging: media: cedrus: h264: mark long-term references in the frame info This commit updates cedrus_fill_ref_pic() and cedrus_write_frame_list() to populate the top and bottom field reference type bits in the H.264 SRAM framebuffer list entry so that long-term reference pictures are marked as long-term instead of short-term. > diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_h264.c b/drivers/staging/media/sunxi/cedrus/cedrus_h264.c > index 892193c12b2f3..a716955655f7d 100644 > --- a/drivers/staging/media/sunxi/cedrus/cedrus_h264.c > +++ b/drivers/staging/media/sunxi/cedrus/cedrus_h264.c [ ... ] > @@ -128,6 +136,7 @@ static int cedrus_write_frame_list(struct cedrus_ctx *ctx, > cedrus_fill_ref_pic(ctx, cedrus_buf, > dpb->top_field_order_cnt, > dpb->bottom_field_order_cnt, > + dpb->flags & V4L2_H264_DPB_ENTRY_FLAG_LONG_TERM, > &pic_list[position]); > } > > @@ -174,6 +183,7 @@ static int cedrus_write_frame_list(struct cedrus_ctx *ctx, > cedrus_fill_ref_pic(ctx, output_buf, > decode->top_field_order_cnt, > decode->bottom_field_order_cnt, > + false, > &pic_list[position]); [Severity: Medium] When decoding the second field of an interlaced complementary field pair into the same capture buffer (run->dst), the already-decoded first field is present in decode->dpb[] with a matching timestamp. In cedrus_write_frame_list(), the DPB loop skips calling cedrus_fill_ref_pic() for that entry: for (i = 0; i < ARRAY_SIZE(decode->dpb); i++) { ... if (run->dst->vb2_buf.timestamp == dpb->reference_ts) { output = position; continue; } and instead populates pic_list[position] via the cedrus_fill_ref_pic() call on output_buf above with long_term hardcoded to false. If the first field was marked as a long-term reference (for example, an IDR field with long_term_reference_flag set or via MMCO), its DPB entry has V4L2_H264_DPB_ENTRY_FLAG_LONG_TERM set and the second field can reference it at pic_list[position]. By passing false here instead of preserving the DPB entry's V4L2_H264_DPB_ENTRY_FLAG_LONG_TERM flag when output >= 0, won't pic_list[position] be programmed as VE_H264_FRAME_INFO_REF_TYPE_SHORT_TERM instead of VE_H264_FRAME_INFO_REF_TYPE_LONG_TERM when decoding the second field?
Hi, Le lundi 02 novembre 2026 à 18:02 +0100, Jernej Skrabec a écrit : > The frame info of a reference has a reference type for each field, in > bits 1:0 for the top field and 5:4 for the bottom one, which is 1 for a > long-term reference. The driver never sets it, so the hardware handles > long-term references like short-term ones, also where they differ, like > in temporal direct and implicit weighted prediction. The vendor library > sets it. > > This fixes MR8_BT_B and MR9_BT_B of the H.264 conformance suite. > > Fixes: 6eb9b758e307 ("media: cedrus: Add H264 decoding support") > Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com> > --- > drivers/staging/media/sunxi/cedrus/cedrus_h264.c | 12 +++++++++++- > drivers/staging/media/sunxi/cedrus/cedrus_regs.h | 8 ++++++++ > 2 files changed, 19 insertions(+), 1 deletion(-) > > diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_h264.c b/drivers/staging/media/sunxi/cedrus/cedrus_h264.c > index 892193c12b2f..a716955655f7 100644 > --- a/drivers/staging/media/sunxi/cedrus/cedrus_h264.c > +++ b/drivers/staging/media/sunxi/cedrus/cedrus_h264.c > @@ -69,13 +69,21 @@ static void cedrus_fill_ref_pic(struct cedrus_ctx *ctx, > struct cedrus_buffer *buf, > unsigned int top_field_order_cnt, > unsigned int bottom_field_order_cnt, > + bool long_term, > struct cedrus_h264_sram_ref_pic *pic) > { > struct vb2_buffer *vbuf = &buf->m2m_buf.vb.vb2_buf; > + u32 frame_info, ref_type; > > pic->top_field_order_cnt = cpu_to_le32(top_field_order_cnt); > pic->bottom_field_order_cnt = cpu_to_le32(bottom_field_order_cnt); > - pic->frame_info = cpu_to_le32(buf->codec.h264.pic_type << 8); > + > + ref_type = long_term ? VE_H264_FRAME_INFO_REF_TYPE_LONG_TERM : > + VE_H264_FRAME_INFO_REF_TYPE_SHORT_TERM; > + frame_info = VE_H264_FRAME_INFO_TOP_REF_TYPE(ref_type) | > + VE_H264_FRAME_INFO_BOT_REF_TYPE(ref_type) | > + VE_H264_FRAME_INFO_PIC_TYPE(buf->codec.h264.pic_type); > + pic->frame_info = cpu_to_le32(frame_info); > > pic->luma_ptr = cpu_to_le32(cedrus_buf_addr(vbuf, &ctx->dst_fmt, 0)); > pic->chroma_ptr = cpu_to_le32(cedrus_buf_addr(vbuf, &ctx->dst_fmt, 1)); > @@ -128,6 +136,7 @@ static int cedrus_write_frame_list(struct cedrus_ctx *ctx, > cedrus_fill_ref_pic(ctx, cedrus_buf, > dpb->top_field_order_cnt, > dpb->bottom_field_order_cnt, > + dpb->flags & V4L2_H264_DPB_ENTRY_FLAG_LONG_TERM, > &pic_list[position]); > } > > @@ -174,6 +183,7 @@ static int cedrus_write_frame_list(struct cedrus_ctx *ctx, > cedrus_fill_ref_pic(ctx, output_buf, > decode->top_field_order_cnt, > decode->bottom_field_order_cnt, > + false, nit: Not a hard objection, but I really hate boolean parameters. It could be a simple as: + false, /* short term reference */ Or using an enum. My preference being documented here, its yours to decide. Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> > &pic_list[position]); > > cedrus_h264_write_sram(dev, CEDRUS_SRAM_H264_FRAMEBUFFER_LIST, > diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_regs.h b/drivers/staging/media/sunxi/cedrus/cedrus_regs.h > index 05e6cbc548ab..961fe023bb43 100644 > --- a/drivers/staging/media/sunxi/cedrus/cedrus_regs.h > +++ b/drivers/staging/media/sunxi/cedrus/cedrus_regs.h > @@ -616,6 +616,14 @@ > #define VE_AVC_SRAM_PORT_OFFSET 0x2e0 > #define VE_AVC_SRAM_PORT_DATA 0x2e4 > > +/* Frame info word of a frame buffer list entry in the AVC SRAM */ > +#define VE_H264_FRAME_INFO_PIC_TYPE(v) SHIFT_AND_MASK_BITS(v, 9, 8) > +#define VE_H264_FRAME_INFO_BOT_REF_TYPE(v) SHIFT_AND_MASK_BITS(v, 5, 4) > +#define VE_H264_FRAME_INFO_TOP_REF_TYPE(v) SHIFT_AND_MASK_BITS(v, 1, 0) > + > +#define VE_H264_FRAME_INFO_REF_TYPE_SHORT_TERM 0 > +#define VE_H264_FRAME_INFO_REF_TYPE_LONG_TERM 1 > + > #define VE_VP8_PPS 0x214 > #define VE_VP8_PPS_PIC_TYPE_P_FRAME BIT(31) > #define VE_VP8_PPS_LAST_SHARPNESS_LEVEL(v) SHIFT_AND_MASK_BITS(v, 30, 28)
Dne ponedeljek, 2. november 2026 ob 19:50:44 Srednjeevropski standardni čas je Nicolas Dufresne napisal(a): > Hi, > > Le lundi 02 novembre 2026 à 18:02 +0100, Jernej Skrabec a écrit : > > The frame info of a reference has a reference type for each field, in > > bits 1:0 for the top field and 5:4 for the bottom one, which is 1 for a > > long-term reference. The driver never sets it, so the hardware handles > > long-term references like short-term ones, also where they differ, like > > in temporal direct and implicit weighted prediction. The vendor library > > sets it. > > > > This fixes MR8_BT_B and MR9_BT_B of the H.264 conformance suite. > > > > Fixes: 6eb9b758e307 ("media: cedrus: Add H264 decoding support") > > Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com> > > --- > > drivers/staging/media/sunxi/cedrus/cedrus_h264.c | 12 +++++++++++- > > drivers/staging/media/sunxi/cedrus/cedrus_regs.h | 8 ++++++++ > > 2 files changed, 19 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_h264.c b/drivers/staging/media/sunxi/cedrus/cedrus_h264.c > > index 892193c12b2f..a716955655f7 100644 > > --- a/drivers/staging/media/sunxi/cedrus/cedrus_h264.c > > +++ b/drivers/staging/media/sunxi/cedrus/cedrus_h264.c > > @@ -69,13 +69,21 @@ static void cedrus_fill_ref_pic(struct cedrus_ctx *ctx, > > struct cedrus_buffer *buf, > > unsigned int top_field_order_cnt, > > unsigned int bottom_field_order_cnt, > > + bool long_term, > > struct cedrus_h264_sram_ref_pic *pic) > > { > > struct vb2_buffer *vbuf = &buf->m2m_buf.vb.vb2_buf; > > + u32 frame_info, ref_type; > > > > pic->top_field_order_cnt = cpu_to_le32(top_field_order_cnt); > > pic->bottom_field_order_cnt = cpu_to_le32(bottom_field_order_cnt); > > - pic->frame_info = cpu_to_le32(buf->codec.h264.pic_type << 8); > > + > > + ref_type = long_term ? VE_H264_FRAME_INFO_REF_TYPE_LONG_TERM : > > + VE_H264_FRAME_INFO_REF_TYPE_SHORT_TERM; > > + frame_info = VE_H264_FRAME_INFO_TOP_REF_TYPE(ref_type) | > > + VE_H264_FRAME_INFO_BOT_REF_TYPE(ref_type) | > > + VE_H264_FRAME_INFO_PIC_TYPE(buf->codec.h264.pic_type); > > + pic->frame_info = cpu_to_le32(frame_info); > > > > pic->luma_ptr = cpu_to_le32(cedrus_buf_addr(vbuf, &ctx->dst_fmt, 0)); > > pic->chroma_ptr = cpu_to_le32(cedrus_buf_addr(vbuf, &ctx->dst_fmt, 1)); > > @@ -128,6 +136,7 @@ static int cedrus_write_frame_list(struct cedrus_ctx *ctx, > > cedrus_fill_ref_pic(ctx, cedrus_buf, > > dpb->top_field_order_cnt, > > dpb->bottom_field_order_cnt, > > + dpb->flags & V4L2_H264_DPB_ENTRY_FLAG_LONG_TERM, > > &pic_list[position]); > > } > > > > @@ -174,6 +183,7 @@ static int cedrus_write_frame_list(struct cedrus_ctx *ctx, > > cedrus_fill_ref_pic(ctx, output_buf, > > decode->top_field_order_cnt, > > decode->bottom_field_order_cnt, > > + false, > > nit: Not a hard objection, but I really hate boolean parameters. It could be a > simple as: > > + false, /* short term reference */ > > Or using an enum. My preference being documented here, its yours to decide. I'll use VE_H264_FRAME_INFO_REF_TYPE_* as parameter. I have to fix sashiko issue anyway. I'll keep your Reviewed-by, unless you object. Best regards, Jernej > > Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> > > > &pic_list[position]); > > > > cedrus_h264_write_sram(dev, CEDRUS_SRAM_H264_FRAMEBUFFER_LIST, > > diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_regs.h b/drivers/staging/media/sunxi/cedrus/cedrus_regs.h > > index 05e6cbc548ab..961fe023bb43 100644 > > --- a/drivers/staging/media/sunxi/cedrus/cedrus_regs.h > > +++ b/drivers/staging/media/sunxi/cedrus/cedrus_regs.h > > @@ -616,6 +616,14 @@ > > #define VE_AVC_SRAM_PORT_OFFSET 0x2e0 > > #define VE_AVC_SRAM_PORT_DATA 0x2e4 > > > > +/* Frame info word of a frame buffer list entry in the AVC SRAM */ > > +#define VE_H264_FRAME_INFO_PIC_TYPE(v) SHIFT_AND_MASK_BITS(v, 9, 8) > > +#define VE_H264_FRAME_INFO_BOT_REF_TYPE(v) SHIFT_AND_MASK_BITS(v, 5, 4) > > +#define VE_H264_FRAME_INFO_TOP_REF_TYPE(v) SHIFT_AND_MASK_BITS(v, 1, 0) > > + > > +#define VE_H264_FRAME_INFO_REF_TYPE_SHORT_TERM 0 > > +#define VE_H264_FRAME_INFO_REF_TYPE_LONG_TERM 1 > > + > > #define VE_VP8_PPS 0x214 > > #define VE_VP8_PPS_PIC_TYPE_P_FRAME BIT(31) > > #define VE_VP8_PPS_LAST_SHARPNESS_LEVEL(v) SHIFT_AND_MASK_BITS(v, 30, 28) >
Le mardi 03 novembre 2026 à 19:06 +0100, Jernej Škrabec a écrit : > Dne ponedeljek, 2. november 2026 ob 19:50:44 Srednjeevropski standardni čas je Nicolas Dufresne napisal(a): > > Hi, > > > > Le lundi 02 novembre 2026 à 18:02 +0100, Jernej Skrabec a écrit : > > > The frame info of a reference has a reference type for each field, in > > > bits 1:0 for the top field and 5:4 for the bottom one, which is 1 for a > > > long-term reference. The driver never sets it, so the hardware handles > > > long-term references like short-term ones, also where they differ, like > > > in temporal direct and implicit weighted prediction. The vendor library > > > sets it. > > > > > > This fixes MR8_BT_B and MR9_BT_B of the H.264 conformance suite. > > > > > > Fixes: 6eb9b758e307 ("media: cedrus: Add H264 decoding support") > > > Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com> > > > --- > > > drivers/staging/media/sunxi/cedrus/cedrus_h264.c | 12 +++++++++++- > > > drivers/staging/media/sunxi/cedrus/cedrus_regs.h | 8 ++++++++ > > > 2 files changed, 19 insertions(+), 1 deletion(-) > > > > > > diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_h264.c b/drivers/staging/media/sunxi/cedrus/cedrus_h264.c > > > index 892193c12b2f..a716955655f7 100644 > > > --- a/drivers/staging/media/sunxi/cedrus/cedrus_h264.c > > > +++ b/drivers/staging/media/sunxi/cedrus/cedrus_h264.c > > > @@ -69,13 +69,21 @@ static void cedrus_fill_ref_pic(struct cedrus_ctx *ctx, > > > struct cedrus_buffer *buf, > > > unsigned int top_field_order_cnt, > > > unsigned int bottom_field_order_cnt, > > > + bool long_term, > > > struct cedrus_h264_sram_ref_pic *pic) > > > { > > > struct vb2_buffer *vbuf = &buf->m2m_buf.vb.vb2_buf; > > > + u32 frame_info, ref_type; > > > > > > pic->top_field_order_cnt = cpu_to_le32(top_field_order_cnt); > > > pic->bottom_field_order_cnt = cpu_to_le32(bottom_field_order_cnt); > > > - pic->frame_info = cpu_to_le32(buf->codec.h264.pic_type << 8); > > > + > > > + ref_type = long_term ? VE_H264_FRAME_INFO_REF_TYPE_LONG_TERM : > > > + VE_H264_FRAME_INFO_REF_TYPE_SHORT_TERM; > > > + frame_info = VE_H264_FRAME_INFO_TOP_REF_TYPE(ref_type) | > > > + VE_H264_FRAME_INFO_BOT_REF_TYPE(ref_type) | > > > + VE_H264_FRAME_INFO_PIC_TYPE(buf->codec.h264.pic_type); > > > + pic->frame_info = cpu_to_le32(frame_info); > > > > > > pic->luma_ptr = cpu_to_le32(cedrus_buf_addr(vbuf, &ctx->dst_fmt, 0)); > > > pic->chroma_ptr = cpu_to_le32(cedrus_buf_addr(vbuf, &ctx->dst_fmt, 1)); > > > @@ -128,6 +136,7 @@ static int cedrus_write_frame_list(struct cedrus_ctx *ctx, > > > cedrus_fill_ref_pic(ctx, cedrus_buf, > > > dpb->top_field_order_cnt, > > > dpb->bottom_field_order_cnt, > > > + dpb->flags & V4L2_H264_DPB_ENTRY_FLAG_LONG_TERM, > > > &pic_list[position]); > > > } > > > > > > @@ -174,6 +183,7 @@ static int cedrus_write_frame_list(struct cedrus_ctx *ctx, > > > cedrus_fill_ref_pic(ctx, output_buf, > > > decode->top_field_order_cnt, > > > decode->bottom_field_order_cnt, > > > + false, > > > > nit: Not a hard objection, but I really hate boolean parameters. It could be a > > simple as: > > > > + false, /* short term reference */ > > > > Or using an enum. My preference being documented here, its yours to decide. > > I'll use VE_H264_FRAME_INFO_REF_TYPE_* as parameter. I have to fix sashiko > issue anyway. > > I'll keep your Reviewed-by, unless you object. wfm > > Best regards, > Jernej > > > > > Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> > > > > > &pic_list[position]); > > > > > > cedrus_h264_write_sram(dev, CEDRUS_SRAM_H264_FRAMEBUFFER_LIST, > > > diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_regs.h b/drivers/staging/media/sunxi/cedrus/cedrus_regs.h > > > index 05e6cbc548ab..961fe023bb43 100644 > > > --- a/drivers/staging/media/sunxi/cedrus/cedrus_regs.h > > > +++ b/drivers/staging/media/sunxi/cedrus/cedrus_regs.h > > > @@ -616,6 +616,14 @@ > > > #define VE_AVC_SRAM_PORT_OFFSET 0x2e0 > > > #define VE_AVC_SRAM_PORT_DATA 0x2e4 > > > > > > +/* Frame info word of a frame buffer list entry in the AVC SRAM */ > > > +#define VE_H264_FRAME_INFO_PIC_TYPE(v) SHIFT_AND_MASK_BITS(v, 9, 8) > > > +#define VE_H264_FRAME_INFO_BOT_REF_TYPE(v) SHIFT_AND_MASK_BITS(v, 5, 4) > > > +#define VE_H264_FRAME_INFO_TOP_REF_TYPE(v) SHIFT_AND_MASK_BITS(v, 1, 0) > > > + > > > +#define VE_H264_FRAME_INFO_REF_TYPE_SHORT_TERM 0 > > > +#define VE_H264_FRAME_INFO_REF_TYPE_LONG_TERM 1 > > > + > > > #define VE_VP8_PPS 0x214 > > > #define VE_VP8_PPS_PIC_TYPE_P_FRAME BIT(31) > > > #define VE_VP8_PPS_LAST_SHARPNESS_LEVEL(v) SHIFT_AND_MASK_BITS(v, 30, 28) > > > > >
diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_h264.c b/drivers/staging/media/sunxi/cedrus/cedrus_h264.c index 892193c12b2f..a716955655f7 100644 --- a/drivers/staging/media/sunxi/cedrus/cedrus_h264.c +++ b/drivers/staging/media/sunxi/cedrus/cedrus_h264.c @@ -69,13 +69,21 @@ static void cedrus_fill_ref_pic(struct cedrus_ctx *ctx, struct cedrus_buffer *buf, unsigned int top_field_order_cnt, unsigned int bottom_field_order_cnt, + bool long_term, struct cedrus_h264_sram_ref_pic *pic) { struct vb2_buffer *vbuf = &buf->m2m_buf.vb.vb2_buf; + u32 frame_info, ref_type; pic->top_field_order_cnt = cpu_to_le32(top_field_order_cnt); pic->bottom_field_order_cnt = cpu_to_le32(bottom_field_order_cnt); - pic->frame_info = cpu_to_le32(buf->codec.h264.pic_type << 8); + + ref_type = long_term ? VE_H264_FRAME_INFO_REF_TYPE_LONG_TERM : + VE_H264_FRAME_INFO_REF_TYPE_SHORT_TERM; + frame_info = VE_H264_FRAME_INFO_TOP_REF_TYPE(ref_type) | + VE_H264_FRAME_INFO_BOT_REF_TYPE(ref_type) | + VE_H264_FRAME_INFO_PIC_TYPE(buf->codec.h264.pic_type); + pic->frame_info = cpu_to_le32(frame_info); pic->luma_ptr = cpu_to_le32(cedrus_buf_addr(vbuf, &ctx->dst_fmt, 0)); pic->chroma_ptr = cpu_to_le32(cedrus_buf_addr(vbuf, &ctx->dst_fmt, 1)); @@ -128,6 +136,7 @@ static int cedrus_write_frame_list(struct cedrus_ctx *ctx, cedrus_fill_ref_pic(ctx, cedrus_buf, dpb->top_field_order_cnt, dpb->bottom_field_order_cnt, + dpb->flags & V4L2_H264_DPB_ENTRY_FLAG_LONG_TERM, &pic_list[position]); } @@ -174,6 +183,7 @@ static int cedrus_write_frame_list(struct cedrus_ctx *ctx, cedrus_fill_ref_pic(ctx, output_buf, decode->top_field_order_cnt, decode->bottom_field_order_cnt, + false, &pic_list[position]); cedrus_h264_write_sram(dev, CEDRUS_SRAM_H264_FRAMEBUFFER_LIST, diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_regs.h b/drivers/staging/media/sunxi/cedrus/cedrus_regs.h index 05e6cbc548ab..961fe023bb43 100644 --- a/drivers/staging/media/sunxi/cedrus/cedrus_regs.h +++ b/drivers/staging/media/sunxi/cedrus/cedrus_regs.h @@ -616,6 +616,14 @@ #define VE_AVC_SRAM_PORT_OFFSET 0x2e0 #define VE_AVC_SRAM_PORT_DATA 0x2e4 +/* Frame info word of a frame buffer list entry in the AVC SRAM */ +#define VE_H264_FRAME_INFO_PIC_TYPE(v) SHIFT_AND_MASK_BITS(v, 9, 8) +#define VE_H264_FRAME_INFO_BOT_REF_TYPE(v) SHIFT_AND_MASK_BITS(v, 5, 4) +#define VE_H264_FRAME_INFO_TOP_REF_TYPE(v) SHIFT_AND_MASK_BITS(v, 1, 0) + +#define VE_H264_FRAME_INFO_REF_TYPE_SHORT_TERM 0 +#define VE_H264_FRAME_INFO_REF_TYPE_LONG_TERM 1 + #define VE_VP8_PPS 0x214 #define VE_VP8_PPS_PIC_TYPE_P_FRAME BIT(31) #define VE_VP8_PPS_LAST_SHARPNESS_LEVEL(v) SHIFT_AND_MASK_BITS(v, 30, 28)