Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp1542177ybg; Thu, 4 Jun 2020 12:20:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxyFcNSwvoO3Bkavk6W7HYujDIydkbz84j47dfRls+ZQ+OoGIzfAgsDR7Zkyk++taZCrxH9 X-Received: by 2002:a50:aca3:: with SMTP id x32mr5623225edc.194.1591298436419; Thu, 04 Jun 2020 12:20:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591298436; cv=none; d=google.com; s=arc-20160816; b=NQ3wdcwwpG1ktjyt2A/bxmf3GBsZkOObRQOoOr+MbmR/yQWfx5VmsKounCi/HSnseD h6p0Uh/Kh1hzBRO4G/ox9UU56yMgMkSn6ct1BgLws8sps7armUMlFFaUW28Xs9oLu5Ij 8n8a1J0o0Bt+hcYvZg6u/TtsSycrckCj6tpa8+5Z37Vk4QhxsDG/9h23vrTXGtw/Dd07 PKK+MVMZzT4PO7fGpJaVC1YbJdhXehFLPPENshcito/Xodn3RdBqMfeZdX/cuXoT/2Dl IL7ZKh4Ai9HfgVmacA/O+tpUeKXLXdv5EMAZIDGDUCuLHT/yBZIMAw1oO4xF7djddHCP sE2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=W5em4hmaTdpAi1bEYTveRpvm8x9bJu6ZacBiW7wMmAc=; b=XixyGv1J3zrZ0lYSWteGND5BhX6WmJ1d5hZcR6MZAUDQ6geIL9wn5+R2U5qECBHlIj d9jlCSJXz7CRSiDJ+NnXoy9hT+MIBBAqkQiP5JZaUBM/q7uA4JHA0Bod22fEinBC4DtC C6wnVFxw8/hg8TyqaOtS9yqHVDSuCcDVv6Qq5k3gKwNZalha7C5KDRdRgVRCUinO1giY MA6xah4dkw/ZaT2qXpezBJagGHXdILV8fWj582i3bu07uQdt/zRJI+hx6RUXlFh+HUBj Z7NVfUIbFHbMiknSAEjVyT6isvxt+4gbAENnel16QUDHUf7fLW3r6XY44uChVoZck/sF mUqA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=siol.net Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n1si2112445edy.216.2020.06.04.12.20.13; Thu, 04 Jun 2020 12:20:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=siol.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729184AbgFDSzY (ORCPT + 99 others); Thu, 4 Jun 2020 14:55:24 -0400 Received: from mailoutvs43.siol.net ([185.57.226.234]:52691 "EHLO mail.siol.net" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728476AbgFDSzV (ORCPT ); Thu, 4 Jun 2020 14:55:21 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.siol.net (Postfix) with ESMTP id 35193521138; Thu, 4 Jun 2020 20:55:18 +0200 (CEST) X-Virus-Scanned: amavisd-new at psrvmta10.zcs-production.pri Received: from mail.siol.net ([127.0.0.1]) by localhost (psrvmta10.zcs-production.pri [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id XznPkMjjbkV1; Thu, 4 Jun 2020 20:55:17 +0200 (CEST) Received: from mail.siol.net (localhost [127.0.0.1]) by mail.siol.net (Postfix) with ESMTPS id D034552118B; Thu, 4 Jun 2020 20:55:17 +0200 (CEST) Received: from kista.localdomain (cpe-194-152-20-232.static.triera.net [194.152.20.232]) (Authenticated sender: 031275009) by mail.siol.net (Postfix) with ESMTPSA id 82AC452123C; Thu, 4 Jun 2020 20:55:15 +0200 (CEST) From: Jernej Skrabec To: paul.kocialkowski@bootlin.com, mripard@kernel.org Cc: mchehab@kernel.org, wens@csie.org, hverkuil-cisco@xs4all.nl, gregkh@linuxfoundation.org, jonas@kwiboo.se, nicolas@ndufresne.ca, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 2/3] media: cedrus: h264: Properly configure reference field Date: Thu, 4 Jun 2020 20:57:44 +0200 Message-Id: <20200604185745.23568-3-jernej.skrabec@siol.net> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200604185745.23568-1-jernej.skrabec@siol.net> References: <20200604185745.23568-1-jernej.skrabec@siol.net> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When interlaced H264 content is being decoded, references must indicate which field is being referenced. Currently this was done by checking capture buffer flags. However, that is not correct because capture buffer may hold both fields. Fix this by checking newly introduced flags in reference lists. Signed-off-by: Jernej Skrabec --- drivers/staging/media/sunxi/cedrus/cedrus_h264.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_h264.c b/drivers/s= taging/media/sunxi/cedrus/cedrus_h264.c index cce527bbdf86..c87717d17ec5 100644 --- a/drivers/staging/media/sunxi/cedrus/cedrus_h264.c +++ b/drivers/staging/media/sunxi/cedrus/cedrus_h264.c @@ -183,7 +183,6 @@ static void _cedrus_write_ref_list(struct cedrus_ctx = *ctx, for (i =3D 0; i < num_ref; i++) { const struct v4l2_h264_dpb_entry *dpb; const struct cedrus_buffer *cedrus_buf; - const struct vb2_v4l2_buffer *ref_buf; unsigned int position; int buf_idx; u8 dpb_idx; @@ -198,12 +197,11 @@ static void _cedrus_write_ref_list(struct cedrus_ct= x *ctx, if (buf_idx < 0) continue; =20 - ref_buf =3D to_vb2_v4l2_buffer(cap_q->bufs[buf_idx]); - cedrus_buf =3D vb2_v4l2_to_cedrus_buffer(ref_buf); + cedrus_buf =3D vb2_to_cedrus_buffer(cap_q->bufs[buf_idx]); position =3D cedrus_buf->codec.h264.position; =20 sram_array[i] |=3D position << 1; - if (ref_buf->field =3D=3D V4L2_FIELD_BOTTOM) + if (ref_list[i].flags & V4L2_H264_REFERENCE_FLAG_BOTTOM_FIELD) sram_array[i] |=3D BIT(0); } =20 --=20 2.27.0