Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp371954pxa; Fri, 14 Aug 2020 06:42:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzLylY1VVlGdxFNsMppvaBYSXQdPi/ALqNeXCLYaIYJv4a/VIsZEio7QnzJ5aOX8xuX0t6B X-Received: by 2002:a17:906:7492:: with SMTP id e18mr2420168ejl.375.1597412562104; Fri, 14 Aug 2020 06:42:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597412562; cv=none; d=google.com; s=arc-20160816; b=MB268hJZhBs+UJfXPdtdP1ZJZfjzBGJMuBbf3JHBPo/1GN6b3cSXQMwLudjtr2G+Ee PWoMwqZmnAICWlEWS2xLeu1berhnOdjeyRkV8kNWxTS5ZXJB+K0YhAZPUmDQiwxRZ04r l2nXWMUbdt8374hTGNOZZhl6Mbex6fA8WlpLIlOVvnMuM9HY6HIeGhi+cgWdGvhC5ZN2 Z8/7l9UssUNGl4lqUhLQXtKZZfY7YnS7AlNe/hjAqaQHYi2pAjhGWFxPc5D+19q0rzCG dx6z7IjwhW3pBQ00+RKIBqJBN1e8iHOBjSjX9S/fjE+mvZaYmQV/WPj3qZhtED2vWUeY 1TFQ== 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=vBQk04Xv4CLfp4FxuIn/RWCPyP99lSXOXbv7ZUfq108=; b=TDSVMy79jfUnMOdq/X5VIRdXna/zLFMfW3HVDxhdpCdm5LXlzQht62xxE3vq2ub0r6 nvBmj6Bjqym3TMp38rK5kM/v+Wx+XKgtW3b/MRlVFPN3hE6eNfAi0IkSNgmjXTAWtJ+Q FVxUL40xqSVmxpThXvMQnE5P3ABJ0MT4m8BtkliYQ1m0PwqiO5iedpeBViNPazSR/kFp 8D6rDacwxH3g9boN8H93pSEkXrJrrolmbCvF1FfQuxm/rPLFm6n9RZCFIsJo+f6EySHd beelZacQxdT8dkE7odjlesmpy/H8ocMjC8aux4+ARdA1Z+uakz8sGeo9c0JLQDEmEjV5 mmQg== 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=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b12si5241691edf.20.2020.08.14.06.42.18; Fri, 14 Aug 2020 06:42:42 -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=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728879AbgHNNh6 (ORCPT + 99 others); Fri, 14 Aug 2020 09:37:58 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:43382 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728865AbgHNNhs (ORCPT ); Fri, 14 Aug 2020 09:37:48 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: ezequiel) with ESMTPSA id C476029A807 From: Ezequiel Garcia To: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Tomasz Figa , kernel@collabora.com, Jonas Karlman , Hans Verkuil , Alexandre Courbot , Jeffrey Kardatzke , Nicolas Dufresne , Philipp Zabel , Maxime Ripard , Paul Kocialkowski , Jernej Skrabec Subject: [PATCH v3 14/19] media: cedrus: h264: Properly configure reference field Date: Fri, 14 Aug 2020 10:36:29 -0300 Message-Id: <20200814133634.95665-15-ezequiel@collabora.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200814133634.95665-1-ezequiel@collabora.com> References: <20200814133634.95665-1-ezequiel@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jernej Skrabec 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 Reviewed-by: Nicolas Dufresne --- 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/staging/media/sunxi/cedrus/cedrus_h264.c index c8f626fdd3dd..1e89a8438f36 100644 --- a/drivers/staging/media/sunxi/cedrus/cedrus_h264.c +++ b/drivers/staging/media/sunxi/cedrus/cedrus_h264.c @@ -182,7 +182,6 @@ static void _cedrus_write_ref_list(struct cedrus_ctx *ctx, for (i = 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; @@ -197,12 +196,11 @@ static void _cedrus_write_ref_list(struct cedrus_ctx *ctx, if (buf_idx < 0) continue; - ref_buf = to_vb2_v4l2_buffer(cap_q->bufs[buf_idx]); - cedrus_buf = vb2_v4l2_to_cedrus_buffer(ref_buf); + cedrus_buf = vb2_to_cedrus_buffer(cap_q->bufs[buf_idx]); position = cedrus_buf->codec.h264.position; sram_array[i] |= position << 1; - if (ref_buf->field == V4L2_FIELD_BOTTOM) + if (ref_list[i].fields & V4L2_H264_BOTTOM_FIELD_REF) sram_array[i] |= BIT(0); } -- 2.27.0