Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp3633160iog; Mon, 27 Jun 2022 22:24:06 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uN8fx2xTVxTrZ0uRQ5trLvngBcacQCDdYDzOE84JZGfBX006QXICNPfY/pstzcXnHZsWoH X-Received: by 2002:a17:90b:682:b0:1e3:142:a562 with SMTP id m2-20020a17090b068200b001e30142a562mr25529705pjz.91.1656393846075; Mon, 27 Jun 2022 22:24:06 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1656393846; cv=pass; d=google.com; s=arc-20160816; b=TznSGXIrgWf/b/FSGJNI+zAyMXvu12gwzfCNgnNU0UDx3XpYy/tDc9uDX0d2ndeZ9N I0LxmojB8Ox9HlBUNzrnwAFE7EogiPQZWVl4bLR1vUAW7VKEmM7xVNOsdU0gQGUk1gns mbq5Yt+q7I/P3xgFnGQln3KE3vF7Jf5XaAOzVB0tpKThEjr8lbKEk1pZhaV5X/0/wD2Q 1UmcVPJlAlw9E8YCDLVxHIQi9uBVWxjy5KTS3wx6ztq3zrLnKXWg0ZcL/ArFSfvavdt6 2ncXupL4gxVWFzjdG5397BfpCS4jNbEy/mU1A3bizfdAKGw2Wi+DJOPEYyIfUJZZGJBG CncQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :message-id:date:subject:cc:to:from:dkim-signature; bh=RkrXp0BXX7Sz8l3pnrZ5hzps0DG05kz93DlCzJAbEZY=; b=Vpfh9PtntGLZRrn2k4l1MZRTFQkU/zq4nRsQfISG+5j/ZceiwgeP8xZMoHbMg0HBTq bgRW/MlQqMNbUARuIgx0dToR8s3YfEI2JZQgnWk2iNpRh4xuDRiFtvp9l40UEGyfiPNM w0AoZx1azwWk+5/TKhNBgQyy8xQ7grtxM6Edw7flqHfwom9rckfBfNGWbszrORnYq00w vMzyYl/ojjW4wifnvm+voAUeW1Ppz4hghh1+e/q/aqXKrwlhAn99GRK7g44lkmw2Whl4 ev9fRq+7EzBfaZLcMF1SC6iq9opZxACkmP0R5hEIvq7BQwLvauo4CmR9qLpixQ/hOcFH jNxg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=s2JibFY5; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.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=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id iw3-20020a170903044300b0016a33d12363si15873328plb.193.2022.06.27.22.23.53; Mon, 27 Jun 2022 22:24:06 -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; dkim=pass header.i=@nxp.com header.s=selector2 header.b=s2JibFY5; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.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=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245021AbiF1FWY (ORCPT + 99 others); Tue, 28 Jun 2022 01:22:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34472 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244940AbiF1FVv (ORCPT ); Tue, 28 Jun 2022 01:21:51 -0400 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2080.outbound.protection.outlook.com [40.107.22.80]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E41E8286DE; Mon, 27 Jun 2022 22:20:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kiJoVDotGFoCioYGDlwZRUwlme/zPnN7mZHzeFP0otJHVMPz3VKeBYkNJk89rsirrTMxn2Q0GIRapC9/Xtw8UWFt9nRgScWy1/tDvyc1VY+TjXCesr0Sm71tYjwilgMynmG6UyJ84eWwc52E47mt34Wgq4UNeiOjlLkZ50pcEYbgOxPtltlMwftbVf6jqF3xoHmSHlcw/bGGdkwo0dkunh6ZxG2uvaELkRYdzVox9AFQwPe4GmcTAoredxre9tfouNPxrc9nyM8jvR3ATx++btrfxGD/k+7N1oBrjt8pa/fsD1ZNzI4ZdYeFwelk4DSK7Uq7DPDfCNNpZZFA1MR80g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=RkrXp0BXX7Sz8l3pnrZ5hzps0DG05kz93DlCzJAbEZY=; b=CuBNI5H5lZehXXa49e6pp3rtJ6cWaUXU3vIZQ5ygmhGvQnzFFmBiNeXpUNpJbpFkgdcOa3NygZq6a9f3AeKDfR/fAkeNjPCuevK4ww5s7U8tL/vTEbGlfvx6j7nHO7lxDCist/Oo0RyeRF3zMXzPTWYEK4SWI/Q1GgIwJsEbYLXJSklVAqFRAJDhSaW0pXgVwjRksQmzQkZY/cpUydTRno7HSsIOMWbRWoENfOXJqr0pSuPjRxgnS8vR7hLlyDQo2d4HgHI/UClkBMALDbQrkteSQEJutIonctx7KT9qz6YaqAYorMvdRpaYBq1pxySNQzkTPZYbcnIic387SJJIew== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RkrXp0BXX7Sz8l3pnrZ5hzps0DG05kz93DlCzJAbEZY=; b=s2JibFY5KqJczLwFDZ7R+i+wOCp/58Vl8AhJMS6qoS9xPCCn6p4K/DauK+JnJmlBXac9cJsqtl5VSLMFaUEW0JuLIgVTAJb6bJr0o5sfLfuvbIb0OabOkd2kwAYfIMowxofYGIM+4K/B5/XNgTFPSOmE6AcFPzOXUWO6EjdbABs= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM6PR04MB6341.eurprd04.prod.outlook.com (2603:10a6:20b:d8::14) by VI1PR04MB5168.eurprd04.prod.outlook.com (2603:10a6:803:56::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5373.18; Tue, 28 Jun 2022 05:20:32 +0000 Received: from AM6PR04MB6341.eurprd04.prod.outlook.com ([fe80::3582:eb2f:9652:d98b]) by AM6PR04MB6341.eurprd04.prod.outlook.com ([fe80::3582:eb2f:9652:d98b%5]) with mapi id 15.20.5373.018; Tue, 28 Jun 2022 05:20:32 +0000 From: Ming Qian To: mchehab@kernel.org, hverkuil-cisco@xs4all.nl 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 Subject: [PATCH] media: amphion: only insert the first sequence startcode for vc1l format Date: Tue, 28 Jun 2022 13:20:17 +0800 Message-Id: <20220628052017.26979-1-ming.qian@nxp.com> X-Mailer: git-send-email 2.36.1 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG2P153CA0002.APCP153.PROD.OUTLOOK.COM (2603:1096::12) To AM6PR04MB6341.eurprd04.prod.outlook.com (2603:10a6:20b:d8::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5c9d03f9-0a15-4a1d-5a65-08da58c5ec3d X-MS-TrafficTypeDiagnostic: VI1PR04MB5168:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Ibmy+ezupwWyfU05HsK5CXPHzLADmBxDygShgYpZDxg1B95JTv9DXdsiI4YQ3jgptItnpRvEALInePekWAy8Y8o8aQLyHRafA9/HFQHaRlGLIJzqb8bMz41ApmvFlL5fV3eYmpHGiSbU4CENyvYrWUfRfv16GZl7uqfS6gTjp6Le3ToIkZV1s7AZrQe3TpH+Zcnj6Zz0yWLnsbyWG95lTilfjVRDY41xjzd+OiG3sRBuBDTZ27IUsBadqJ46ccWm+5WXhsgU/dQHSunwk8uvvI3a6vPAoHGnfOLHrSKFmqYFLstq47Kdcn97x3U98VQnFJc5dPLgZYNgCaekm5fglO3wmJjTBGub8LL5cw96eFxBWuH32mJfTzX0Bm8sYMYU7tYYm4eljxAQkVt6qygkoxQsStuKDzY1okCDTn6QvJXGf4THFs071pzxZlNPlb7fz7SpLywE0suZm6hEgZUxPxvx52XmaAV9C/TKCPv+ELDhy/MGyoxMShQkNCz0xdaixhThY/B1G0FFTTEyoCxuNbCyTBFJ6aY7YaeZbuDbqauBMGQ3QaWIeK6kOQCzaddFQmcsJcCEmmiCkPEBBavPF2Jf0Q4rrdbCq7UAjgJptYTGRE8wLK/m7SSvppdYhUJUDmkCeNEn3cx1eLOYvAiBBEkrjIBl89vWls3ZibkuvKhJiWCHW9DE2I0fxVMF+wTcj5oREnbJphOjytF/IWuAkA3PesOebAZsR76hvBTlEyZcFVPKhKpy4uhHRw9i4iMH5F9Syy1oNxx41Gf25rLdzzHwQew0GZfofy0s1C1sJw2xoUw+yqZXXHmfsHmnwzBE X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR04MB6341.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(4636009)(396003)(136003)(346002)(39860400002)(366004)(376002)(6512007)(36756003)(26005)(83380400001)(8676002)(66476007)(66556008)(4326008)(66946007)(1076003)(2616005)(38100700002)(52116002)(316002)(86362001)(6506007)(478600001)(7416002)(38350700002)(5660300002)(6666004)(186003)(6486002)(44832011)(8936002)(41300700001)(2906002)(32563001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?iv5cokIbYSbgC3WPM5F7ch4LEvG5UU7aqRk4THazpjP6FDiw2LpBN1yC6/Dt?= =?us-ascii?Q?8Im6NrMoGrKWHmCRGZgfk1gW3+9mQ28cXJXV6flM+c0DOvjwd1IssdfQUgMT?= =?us-ascii?Q?umfI66RbUYqcD5EI3PChMljW0CmjyaGZP9ho7em4Ru2DjUXpYF37UdmoO35H?= =?us-ascii?Q?0vx+ptfqAreb9gNwO9Jby53z4ZasKoESlkWX7mPBeLR00vP+kNQps15PsK8J?= =?us-ascii?Q?Ma7XSSmlq0xvl2JtLEgDuX5GQt/3CpRkGvjYvQ5J5y4BgdYM0L1dMZ/X+lat?= =?us-ascii?Q?ZhgAYDWTItFT3KycCY9zztIrwu1QVCbKB8/sUJCXb2A7mG1cVPn+EIBlIoYJ?= =?us-ascii?Q?8q1c7MWtprNXMhXiCVysDUEf/cYmx8zeauTNLo4Hll45sw32tVkLYVg6qIKF?= =?us-ascii?Q?KqDUWN4VpaywM0WQDbv2+WKFO5kizaue7mlwc5Op1o6sXNvenoFqR5vAJoWX?= =?us-ascii?Q?LePWuv16OTAL7etysopywx+mpcNOR3KN41zVbStlmxb2qRG5gx1DGl/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K3VahH2imKdUvygP+DAzZjQ+KovTmznKAsS8+V?= =?us-ascii?Q?gRIrnqepSJFM2TUGIqTVZhuLLUrSVU90hOwUzdVWvVHjJeKoUjvqNHBJJTuN?= =?us-ascii?Q?U3gsJUIcOKBADqZZVFm7G5Uj+259r+p5W2VgDLZStVcVYqOO9TTHV/LQUVWb?= =?us-ascii?Q?zOKdrgvHkdgWOpNcT420Xou75ZvqYvRaIi45PGPv?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5c9d03f9-0a15-4a1d-5a65-08da58c5ec3d X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB6341.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jun 2022 05:20:32.3466 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ciFteOz8P3YPZ4eHYgbDsc4xEGoUBzBw4fd/Wo1Oj3j/7Bs/XLWQ8QyEXmibH2veGYMcQgOI6pW0jFeyxhVjGg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB5168 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,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 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 --- drivers/media/platform/amphion/vdec.c | 1 + 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(+), 1 deletion(-) diff --git a/drivers/media/platform/amphion/vdec.c b/drivers/media/platform/amphion/vdec.c index 09d4f27970ec..51218a41a5ac 100644 --- a/drivers/media/platform/amphion/vdec.c +++ b/drivers/media/platform/amphion/vdec.c @@ -731,6 +731,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, -- 2.36.1