Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp29310pxb; Wed, 30 Mar 2022 22:01:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzSw5TDYoZSL2vaRFh4nbUzDm+vj1UTbrCk9YdrkeANbLNqTXKCsGaRiFpiGc6olBJhHZjn X-Received: by 2002:a17:902:eb8f:b0:154:c7a4:937c with SMTP id q15-20020a170902eb8f00b00154c7a4937cmr3515012plg.111.1648702908091; Wed, 30 Mar 2022 22:01:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648702908; cv=none; d=google.com; s=arc-20160816; b=pmsEvVXGiT8gagStl2Y6M3KJOHH9sm9hDi6YZck9Lt53GrET6tfVsMdfKvzbzkaDtI I0LE/vnD1dxZ6RNZkGmcrH97nDFUGZav6U/zs56YsmU7vwkDK8qPXtblUVb0vyodbrHG TxJrfXGl+KSgZjGwXZUVNjF5eN7SgMICSKFFx/ov/ghz6Q17X9d8vM69csNSlSbRbzCR RrDz/mPb9RyZPJykMdvxyqVGmSBXzljtFSadJ94DU+Q3qZ8bgqsW+2AkWpB3BlQEVN4R 2MxhmrINhlpcPVjYW90dd7Pq3R2a7bAOW0n2CrNti7Z+FAtVLR+HzPyjgarQyt52lprH K4Vw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature; bh=yj+dTJ0VnoRREuPoo4m3X/ldrY0OYH7eZ2MxWJr6Y/k=; b=AuoNwDA0GXtA9rs8vouuJyXWvRZ2nQPi76U34HzAjOOtsDiSWOLVHJhQxls63B21hV o6p2pV+5hA+fxQ1x/yitpKfV3DWA0NmjHiVsRlDMMr920OVap23Cgltvn9MIedBktDy+ UVlXl1KiMuUO6UjDUHyh0oo4gIInpprEvPepFnxQ4QnG7ijQu6qejh2dRPuDlyd5lpec hAjCWXOsWi0c1Kg742mnitziZiBy8aqKj7ZJnBLObNq9kD9p8NlC2YXJA2wslJjm6yze Wz93ZjnzAcgDm/X79YNZ/XPaa3Lxa0R2J2HfLrb84q0CZXILDxSOHo0HtMnsiMAoMbq+ o08A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=YEdcao7w; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id w9-20020a170902e88900b00154a965e488si25760201plg.237.2022.03.30.22.01.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Mar 2022 22:01:48 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=YEdcao7w; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E569912F14D; Wed, 30 Mar 2022 20:37:56 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234506AbiC3PK4 (ORCPT + 99 others); Wed, 30 Mar 2022 11:10:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58354 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344931AbiC3PKy (ORCPT ); Wed, 30 Mar 2022 11:10:54 -0400 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 177D42626; Wed, 30 Mar 2022 08:09:08 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: nicolas) with ESMTPSA id 9A5FA1F45009 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1648652946; bh=Aosf9iB98FFVsCqRLj8GCfiWN6JEp+BHf9h03wTbGIk=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=YEdcao7wVc60/I8iiFZkfK5uufA4e1CsJmD1gv6g6tMXS/FHE7+PgXex4f8nDkcxY 4MM0HHbYOc+w0w9ga5u2cvx9lv2loTBden6mFEi+az0BWrzFI1FivbCQ8v7S4ourMW XgjUyg8kudAUZls+wdDSRtrf2oRnm9LjfX6IcL2L2rKc2G0TeJKfK9YrG/EbQmziCa sv3qplD09yb1czeXTEml6W/5L4dsCdo7/tLhL3cOQJ1nDOV8geXki2IgnaWlGkARJ0 2La002wbVNT4kXOI/lTPSQOcFm7w22qMvXf8uEwUjeUArEBxHxTf8u8ji09gtT6+Ko 0Fvp3ycIMdNNA== Message-ID: <00437ee75b96b457e2d53322883580b011d6e8a8.camel@collabora.com> Subject: Re: [PATCH v1 21/24] media: hantro: Stop using H.264 parameter pic_num From: Nicolas Dufresne To: Sebastian Fricke Cc: Ezequiel Garcia , Philipp Zabel , Mauro Carvalho Chehab , Greg Kroah-Hartman , kernel@collabora.com, linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Date: Wed, 30 Mar 2022 11:08:55 -0400 In-Reply-To: <20220330074250.jqyljbr53fgeci6q@basti-XPS-13-9310> References: <20220328195936.82552-1-nicolas.dufresne@collabora.com> <20220328195936.82552-22-nicolas.dufresne@collabora.com> <20220330074250.jqyljbr53fgeci6q@basti-XPS-13-9310> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.0 (3.44.0-1.fc36) MIME-Version: 1.0 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le mercredi 30 mars 2022 =C3=A0 09:42 +0200, Sebastian Fricke a =C3=A9crit= =C2=A0: > Hey Nicolas, >=20 > The term pic_num is now only present in the following files: > ``` > =E2=9D=AF rg 'pic_num' > staging/media/rkvdec/rkvdec-h264.c > 766: * Assign an invalid pic_num if DPB entry at that position is inacti= ve. > 768: * reference picture with pic_num 0, triggering output picture I should probably translate this one, since the HW uses frame_num, not pic_= num. >=20 > media/platform/amphion/vpu_windsor.c > 485: u32 pic_num; Amphion Windsor is a stateful driver, I cannot comment on the user of pic_n= um for that type of driver. >=20 > media/platform/mediatek/vcodec/vdec/vdec_h264_req_if.c > 97: unsigned short pic_num; > 346: dst_entry->pic_num =3D src_entry->pic_num; This is being sent to the firmware, so its a difficult change to make witho= ut testing it first. I do have HW to test this, but would prefer doing so in a seperate patchset. Note that MTK does not support field decoding, so pic_nu= m =3D=3D frame_num. So whatever it does here is likely correct. >=20 > media/v4l2-core/v4l2-h264.c > 143: * but with frame_num (wrapped). As for frame the pic_num and frame_= num > 306: /* this is pic_num for frame and frame_num (wrapped) for field, > 307: * but for frame pic_num is equal to frame_num (wrapped). > ``` >=20 > In v4l2-h264 and rkvdec-h264 it is only present as comment and the term > is not part of the specification. > In vpu_windsor it is actually never used. > And for the mediatek driver the same might apply. > It might be worth it to get rid of that term all together while you are > at it. Amphion Windsor is a stateful driver, I'd leave it to the maintainer to cle= anup unused variables if there is. In general the term is not invalid, its just = that the value can be trivially deduced from frame_num and the value depends on = the current picture parity, which makes it an unstable identifier. >=20 > On 28.03.2022 15:59, Nicolas Dufresne wrote: > > The hardware expects FrameNumWrap or long_term_frame_idx. Picture > > numbers are per field, and are mostly used during the memory > > management process, which is done in userland. This fixes two > > ITU conformance tests: > >=20 > > - MR6_BT_B > > - MR8_BT_B > >=20 > > Signed-off-by: Nicolas Dufresne > Reviewed-by: Sebastian Fricke >=20 > Greetings, > Sebastian > > --- > > drivers/staging/media/hantro/hantro_h264.c | 2 -- > > 1 file changed, 2 deletions(-) > >=20 > > diff --git a/drivers/staging/media/hantro/hantro_h264.c b/drivers/stagi= ng/media/hantro/hantro_h264.c > > index 0b4d2491be3b..228629fb3cdf 100644 > > --- a/drivers/staging/media/hantro/hantro_h264.c > > +++ b/drivers/staging/media/hantro/hantro_h264.c > > @@ -354,8 +354,6 @@ u16 hantro_h264_get_ref_nbr(struct hantro_ctx *ctx,= unsigned int dpb_idx) > >=20 > > if (!(dpb->flags & V4L2_H264_DPB_ENTRY_FLAG_ACTIVE)) > > return 0; > > - if (dpb->flags & V4L2_H264_DPB_ENTRY_FLAG_LONG_TERM) > > - return dpb->pic_num; > > return dpb->frame_num; > > } > >=20 > > --=20 > > 2.34.1 > >=20