From patchwork Sat Oct 22 07:24:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7474 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1099135wrr; Sat, 22 Oct 2022 01:12:44 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5Ba73R6MN90/BleweQYFeHs8NkVDQ+7mY1xBs90OznXCj9nrsvmI2ohsxauNhbld6ztD9I X-Received: by 2002:a63:5b48:0:b0:458:1e98:c862 with SMTP id l8-20020a635b48000000b004581e98c862mr19247390pgm.568.1666426363643; Sat, 22 Oct 2022 01:12:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666426363; cv=none; d=google.com; s=arc-20160816; b=ehxteNj3EZVSEVNE1hHZNXrbvAWEeTKyG8vXqHR890jZMI7mR403eoImAwoy5oJDQn pJwJ0i/vo54Kdok8NR3MzgWxwXxYyZ8NvBvWKPQ9pwHSIHNUGgHyylV2pwpKnEfLNDs+ N5D/aFZ8b2X2FHkQ/RnLL2gQjN02J9D72Ku3EfuVCXT+kEiig79i4nqVCaC3tS2hUFz2 u0CreKHCa1+rBCmxNAEcWryFh5jmQe4KRlzONcU3ei1GtIEWS8gCq2OjsU/RYLfkRRJe Ghtz0r3qYc0t5JWS4YM24IoOnYC5zP/lMQJIfFpD/hbmxPijkYEx7PFgUkk0bwnd4xie BLPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=3viQ+CRsNT0rjUrCnxkPWU6zA3n++RiqlwMnSU3nPDQ=; b=JUCHsNNd+CiRoWGVQmK/0Ju+0IiXw7T8C2E+Iv3Csk0Via+blpofAt7hFB53FjT80z rRxxRTJqrgmgfx9zN0wGpwVRGB2t6J4hmOtuV5Iw4wg00axVtyJ/lT22tRTDIoKrrfL1 dfmUplLXG5GCnI+ZDW6Er8sAbo5D6+OACBh47A5HAaMNz9OsrrsmPfL/xfWf5PEVHqBY JdfiF3o8ymynvtQuP2oTZoQtu5YQIqRE65zfHca43JM+LVRd/Fmx8XM9y8ExWRaMV5P7 swUtXCdDPnxRgLZBMgQKd0P1tpf66YqFWxyED+H/LfsQFTjE+x/uIbozxt0y531KEEe/ gGGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Ma0u69Hy; 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=linuxfoundation.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z5-20020a056a00240500b00561f40cc9f3si28114918pfh.262.2022.10.22.01.12.30; Sat, 22 Oct 2022 01:12:43 -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=@linuxfoundation.org header.s=korg header.b=Ma0u69Hy; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233143AbiJVIMH (ORCPT + 99 others); Sat, 22 Oct 2022 04:12:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35456 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233444AbiJVIJv (ORCPT ); Sat, 22 Oct 2022 04:09:51 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B0D2F2AD9; Sat, 22 Oct 2022 00:54:23 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 42AD360B80; Sat, 22 Oct 2022 07:53:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 05368C433C1; Sat, 22 Oct 2022 07:53:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666425204; bh=07aoPt2PLdRmIbDV/BxqUEGxeJXB49RcibykP7o7QNU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ma0u69HycetUov90DbXV8HjuRd/BZ1HCAUetAEseUaxIkekKzOyZoMuHIeRjaiQe2 YTjlwUUVXG8jMnP5tt9LTRZTW2bGuomiIqJKxJUDro87Tsp3IrIRJukbzYfNKqKoKo FS3HAY8313KA9q9SGtmdVnRAOgN3c3PIOvh0IOr4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ming Qian , Hans Verkuil , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 5.19 396/717] media: amphion: insert picture startcode after seek for vc1g format Date: Sat, 22 Oct 2022 09:24:35 +0200 Message-Id: <20221022072515.335312598@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221022072415.034382448@linuxfoundation.org> References: <20221022072415.034382448@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747374690895798620?= X-GMAIL-MSGID: =?utf-8?q?1747374690895798620?= From: Ming Qian [ Upstream commit f7fd6c318c8a5d06bf3fe611f30763d62eaaf7f0 ] For format vc1, the amphion vpu requires driver to help insert some custom startcode before sequence and frame. the startcode is different for vc1l and vc1g format. But the sequence startcode is only needed at the beginning, and it's not expected after seek. driver need to treat the codec header and the first frame after seek as a normal frame, and insert picture startcode for it. In previous patch, I just fix it for vc1l format, and should fix the similar issue for vc1g too. Fixes: e670f5d672ef (media: amphion: only insert the first sequence startcode for vc1l format) Signed-off-by: Ming Qian Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/media/platform/amphion/vpu_malone.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/amphion/vpu_malone.c b/drivers/media/platform/amphion/vpu_malone.c index 542bbe361bd8..10553dd93c29 100644 --- a/drivers/media/platform/amphion/vpu_malone.c +++ b/drivers/media/platform/amphion/vpu_malone.c @@ -1277,7 +1277,7 @@ static int vpu_malone_insert_scode_vc1_g_pic(struct malone_scode_t *scode) vbuf = to_vb2_v4l2_buffer(scode->vb); data = vb2_plane_vaddr(scode->vb, 0); - if (vbuf->sequence == 0 || vpu_vb_is_codecconfig(vbuf)) + if (scode->inst->total_input_count == 0 || vpu_vb_is_codecconfig(vbuf)) return 0; if (MALONE_VC1_CONTAIN_NAL(*data)) return 0;