Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp223932imw; Fri, 8 Jul 2022 01:35:27 -0700 (PDT) X-Google-Smtp-Source: AGRyM1t20JnvKWL/G9sPKN5nzWrSEtIHud5G4mDMB7aUIpSPkd7mJRJl6jOaNbXfyAWpO0bVvWwo X-Received: by 2002:a63:5302:0:b0:412:219:928f with SMTP id h2-20020a635302000000b004120219928fmr2240316pgb.425.1657269327421; Fri, 08 Jul 2022 01:35:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657269327; cv=none; d=google.com; s=arc-20160816; b=iDgd/2AQIAd19icudsTnjKuI3W88jR/xK4W8FNDg48lDekVD2JjxpmVB8W0daZr+Zh 6DKLW9xqM97Wfb5SR9Glq241gcJY1Tp69wBWnmLtl63AC+w2hepFWB9+nWsZGmrLchYA MqVcQLEDPLeufwj+Kg8BUDc6v1bzqm8WOuNSTVkg50o9kLyV0XeR2Cm7j9sxx5tMYOWz ecPllbDWGVdraM7HdyeORiavDntqWhvxk7iPJkNL7EVx1AI/i0ATES1XuB9u9+n9+Mjl 8Z57GM41ogsQhTTWnhZZlFAte3pnuPjcJAPKO+JeHoHiYQtyBouALQ6Ck5hiMqq234XB 8u0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=NxNH6JdOI+62mXFjnq30EqkZy/O6s2nl1b7WJgH2TXs=; b=HmvQ+2c/ZRgv5g13RNhPnd3V1LEBf1dnmJ559EREHHKk7HU6NLvpIqzD0qBtXTFZEq VDvzEf6Bu4OJfwZ1exh2gR9PTY6Bio6rOnT3D2X+jnccMRNyHdA7wi9I6mZXUUfHYPWG NER5II64XaSFsLSj2T8KRd3iXob56HlrAhmhbsOFef4J7NQgIp5WjAPnLNDjIzDpO6L6 6kob+AWvuHhHDxRhuORUYseWyPH+tfHe16GIHUGm9ndEOp9FCWZh0b4F8Z2hEjpgMtzr 3i4Xx6FFcd6Edt6Iw6bOcnFS1RJCEB6pa100fswfz0DCviXbqDSUTiSCHdNvI6delVPK kZHQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=xs4all.nl Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a13-20020a170902b58d00b0016c20ceec07si2554357pls.490.2022.07.08.01.35.12; Fri, 08 Jul 2022 01:35:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=xs4all.nl Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237803AbiGHIZM (ORCPT + 99 others); Fri, 8 Jul 2022 04:25:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58090 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237648AbiGHIZG (ORCPT ); Fri, 8 Jul 2022 04:25:06 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 958788238F; Fri, 8 Jul 2022 01:25:01 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id AF79DB824C3; Fri, 8 Jul 2022 08:24:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 757ADC341C0; Fri, 8 Jul 2022 08:24:56 +0000 (UTC) Message-ID: <22136ebe-b3b4-797f-beb0-3fb73d617dbe@xs4all.nl> Date: Fri, 8 Jul 2022 10:24:55 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Subject: Re: [PATCH v2] media: amphion: only insert the first sequence startcode for vc1l format Content-Language: en-US To: Ming Qian , mchehab@kernel.org Cc: shawnguo@kernel.org, robh+dt@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org References: <20220630013041.1251-1-ming.qian@nxp.com> From: Hans Verkuil In-Reply-To: <20220630013041.1251-1-ming.qian@nxp.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,NICE_REPLY_A,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 Hi Ming Qian, Since the v1 has already been merged, this patch no longer applies. Can you make a v3 on top of https://git.linuxtv.org/media_stage.git/? The only change that a v3 has to do is the removal of V4L2_FMT_FLAG_DYN_RESOLUTION. Regards, Hans On 6/30/22 03:30, Ming Qian wrote: > For some formats, the amphion vpu requires startcode > before sequence and frame, such as vc1, vp8. > > But for V4L2_PIX_FMT_VC1_ANNEX_L, only the first sequence startcode > is needed, the extra startcode will cause decoding error. > So after seek, we don't need to insert the sequence startcode. > > In other words, for V4L2_PIX_FMT_VC1_ANNEX_L, > the vpu doesn't support dynamic resolution change. > > Fixes: 145e936380edb ("media: amphion: implement malone decoder rpc interface") > Signed-off-by: Ming Qian > --- > v2 > - remove V4L2_FMT_FLAG_DYN_RESOLUTION from the format V4L2_PIX_FMT_VC1_ANNEX_L > drivers/media/platform/amphion/vdec.c | 2 +- > drivers/media/platform/amphion/vpu.h | 1 + > drivers/media/platform/amphion/vpu_malone.c | 2 ++ > drivers/media/platform/amphion/vpu_rpc.h | 7 ++++++- > 4 files changed, 10 insertions(+), 2 deletions(-) > > diff --git a/drivers/media/platform/amphion/vdec.c b/drivers/media/platform/amphion/vdec.c > index 09d4f27970ec..6eab9e711cba 100644 > --- a/drivers/media/platform/amphion/vdec.c > +++ b/drivers/media/platform/amphion/vdec.c > @@ -104,7 +104,6 @@ static const struct vpu_format vdec_formats[] = { > .pixfmt = V4L2_PIX_FMT_VC1_ANNEX_L, > .num_planes = 1, > .type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE, > - .flags = V4L2_FMT_FLAG_DYN_RESOLUTION > }, > { > .pixfmt = V4L2_PIX_FMT_MPEG2, > @@ -731,6 +730,7 @@ static void vdec_stop_done(struct vpu_inst *inst) > vdec->eos_received = 0; > vdec->is_source_changed = false; > vdec->source_change = 0; > + inst->total_input_count = 0; > vpu_inst_unlock(inst); > } > > diff --git a/drivers/media/platform/amphion/vpu.h b/drivers/media/platform/amphion/vpu.h > index e56b96a7e5d3..f914de6ed81e 100644 > --- a/drivers/media/platform/amphion/vpu.h > +++ b/drivers/media/platform/amphion/vpu.h > @@ -258,6 +258,7 @@ struct vpu_inst { > struct vpu_format cap_format; > u32 min_buffer_cap; > u32 min_buffer_out; > + u32 total_input_count; > > struct v4l2_rect crop; > u32 colorspace; > diff --git a/drivers/media/platform/amphion/vpu_malone.c b/drivers/media/platform/amphion/vpu_malone.c > index c62b49e85060..f4a488bf9880 100644 > --- a/drivers/media/platform/amphion/vpu_malone.c > +++ b/drivers/media/platform/amphion/vpu_malone.c > @@ -1314,6 +1314,8 @@ static int vpu_malone_insert_scode_vc1_l_seq(struct malone_scode_t *scode) > int size = 0; > u8 rcv_seqhdr[MALONE_VC1_RCV_SEQ_HEADER_LEN]; > > + if (scode->inst->total_input_count) > + return 0; > scode->need_data = 0; > > ret = vpu_malone_insert_scode_seq(scode, MALONE_CODEC_ID_VC1_SIMPLE, sizeof(rcv_seqhdr)); > diff --git a/drivers/media/platform/amphion/vpu_rpc.h b/drivers/media/platform/amphion/vpu_rpc.h > index 25119e5e807e..7eb6f01e6ab5 100644 > --- a/drivers/media/platform/amphion/vpu_rpc.h > +++ b/drivers/media/platform/amphion/vpu_rpc.h > @@ -312,11 +312,16 @@ static inline int vpu_iface_input_frame(struct vpu_inst *inst, > struct vb2_buffer *vb) > { > struct vpu_iface_ops *ops = vpu_core_get_iface(inst->core); > + int ret; > > if (!ops || !ops->input_frame) > return -EINVAL; > > - return ops->input_frame(inst->core->iface, inst, vb); > + ret = ops->input_frame(inst->core->iface, inst, vb); > + if (ret < 0) > + return ret; > + inst->total_input_count++; > + return ret; > } > > static inline int vpu_iface_config_memory_resource(struct vpu_inst *inst,