Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp2298703ybg; Fri, 5 Jun 2020 10:19:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwbncdqpKgiUutuBAfpdUubM97WmJOPwOBGyUoB1PqM+XE9kTCrnfzxBlkcFVTXUafIChgf X-Received: by 2002:a17:906:b7cd:: with SMTP id fy13mr9475902ejb.443.1591377541071; Fri, 05 Jun 2020 10:19:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591377541; cv=none; d=google.com; s=arc-20160816; b=TEpos6aV4UJgKemApmTkbKibnoc/pILNskVkaKIkoSsV23kcg2p7aY20EgZJZYBWEc /R/ATm4bd5E1gWedFLARAyfXXiMPv+XmW5a3lzprSxkh4gcTp5DGGPMSyALGOLohIr0g sgIGtUSXirAa6JtvVQtj1Id73l1lmlNpYBGODpCZ1Qyl1ertbZiNsjRs+RTLCdmBkRw1 DSEjR1vAwfBrz8FC+JYLLkE9UiCoar4XGYxSYUrmlgy7I+w1yk595upx54ZH1naaN/Sl 0sb6GGNOVobGA7/DYGLNCoR1EiKkI+TbXpZGhsz9WA+ZaBynkbulentZuW1tqaQhPfcc WcyA== 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 :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature; bh=mKwEVWcuU9C/nuiwJL6rIyPwKlGow9qq7XqSXfkexXo=; b=SuvFOOaZ3Vb01k43XQiqk/101UPFANAblOtWdX1kSfxJpr1lgoSv0sdDvGGrAdlOXN NOXDb/as+3UMTyAv+zJu4ffUfV1r/IqkePPpf2VKdiC2Q4U+AXnwr/CDLAByxaSe05y6 f1tBjJ9DXcYICNz7uO9b4XLVVoyY8FtcFKwGJ9QbMzA3wbfLp9UZcYg+mk0SJkt4ktqY f6J8wFfzCTgANUUj96t5CiUR1/20iAmIHmx3X9wEnf1GYel9PXMMkFxQesdx3knKD9rt JWkGTxHzbyVVYKiUq0YeTT3Le/i+S2zFCRC/J01GZAEIHIBpLW7VJnFY6ScYF2HiGA0T /L0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ndufresne-ca.20150623.gappssmtp.com header.s=20150623 header.b="JW744sp/"; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f23si4186229ejy.135.2020.06.05.10.18.38; Fri, 05 Jun 2020 10:19:01 -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; dkim=pass header.i=@ndufresne-ca.20150623.gappssmtp.com header.s=20150623 header.b="JW744sp/"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727783AbgFERQj (ORCPT + 99 others); Fri, 5 Jun 2020 13:16:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48828 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727107AbgFERQi (ORCPT ); Fri, 5 Jun 2020 13:16:38 -0400 Received: from mail-qt1-x841.google.com (mail-qt1-x841.google.com [IPv6:2607:f8b0:4864:20::841]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 680C4C08C5C3 for ; Fri, 5 Jun 2020 10:16:38 -0700 (PDT) Received: by mail-qt1-x841.google.com with SMTP id g62so5570735qtd.5 for ; Fri, 05 Jun 2020 10:16:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ndufresne-ca.20150623.gappssmtp.com; s=20150623; h=message-id:subject:from:to:cc:date:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=mKwEVWcuU9C/nuiwJL6rIyPwKlGow9qq7XqSXfkexXo=; b=JW744sp/ZMjgMWxCbk1XkfcVNgxRtWJfRjXsMlGfic0he3IcOG6TbcxkuoS6aVv+t8 kDDT5uGYJ5bjzaOwha4LHAMoOg6Lc3du03KhN9t/isduEood6I/Cd4VVWfqG/AR5aqRQ wHLEAUjBttw/BNHBpoZnVQwf0JU9LF//utPqtTRBcVqB4gVrBNzRsRhqt+aZeb6ljsKR 91ZwfT3zsbqz3vAFDlgJzxFOMtHOxedLf2wfwdvbjTDkDsqo7Pq3FIt8qNYvO34vWM6r XYnk3HQGO9F3lI3Y2P9upf3S/zZx/j+5pluLh1M3B+eeB7PDjz55IADa/ghUI3Tj+b3z zywA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=mKwEVWcuU9C/nuiwJL6rIyPwKlGow9qq7XqSXfkexXo=; b=Er99yP0l26xTaED6qBAuHgHEa4GdfrXvYuvWuf+Hwrdft4gVQSTFQ7raZMPbXaxO/t CcsQRFscmaQSgEDe5AoU/kuBijvoGIHxPeJYuAB/Lx6Y2t8zb6eBc+UHIIoGGKBpjMEo 749ZfoBmk4bRlTKFAisLECfVRI1P17UoVxWQdY8gn62LErORrZpnBVQm8r7dqV9JW4xm MGrLK+iEznJ6t15BDGCYfNtxwkbVst3HdqMrLnmH2MGBJil+2frqaYU+5TFDzpmvJ/3u rnQ93aawAvAMs4oRtz8rQR1lybFJtoN+85juRANTtsjyw1YQ96sdyEwY7lGzGkn+22qO UJjg== X-Gm-Message-State: AOAM533jQlMBnbDuttCLI2RMzan+MydGGK8Jc7AoZO7rQS2SsfzC1Toc +Ilkv63/Zceu6A3+rf1FQQPxxQ== X-Received: by 2002:ac8:42ce:: with SMTP id g14mr10938312qtm.117.1591377397661; Fri, 05 Jun 2020 10:16:37 -0700 (PDT) Received: from skullcanyon ([192.222.193.21]) by smtp.gmail.com with ESMTPSA id z4sm330982qtu.33.2020.06.05.10.16.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jun 2020 10:16:36 -0700 (PDT) Message-ID: <7e74e15b7b3f9fc765182f1a43cfcf1e0e9602fc.camel@ndufresne.ca> Subject: Re: [PATCH 2/3] media: cedrus: h264: Properly configure reference field From: Nicolas Dufresne To: Jernej Skrabec , paul.kocialkowski@bootlin.com, mripard@kernel.org Cc: mchehab@kernel.org, wens@csie.org, hverkuil-cisco@xs4all.nl, gregkh@linuxfoundation.org, jonas@kwiboo.se, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org, linux-arm-kernel@lists.infradead.org Date: Fri, 05 Jun 2020 13:16:35 -0400 In-Reply-To: <20200604185745.23568-3-jernej.skrabec@siol.net> References: <20200604185745.23568-1-jernej.skrabec@siol.net> <20200604185745.23568-3-jernej.skrabec@siol.net> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.2 (3.36.2-1.fc32) 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 Le jeudi 04 juin 2020 à 20:57 +0200, Jernej Skrabec a écrit : > 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 Perhaps an additional patch could cleanup the miss-leading comment in v4l2_h264_dpb_entry definition. 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 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 = 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_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].flags & V4L2_H264_REFERENCE_FLAG_BOTTOM_FIELD) > sram_array[i] |= BIT(0); > } >