From patchwork Sat Oct 22 07:24:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7847 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1154085wrr; Sat, 22 Oct 2022 04:07:34 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5LrfBGb/0xUetWud9Mw72GmLNMYLbWs3wGrjiYH2E9Bf8fZo5o+CZguhjUN4yEWazG5cgO X-Received: by 2002:a62:5e81:0:b0:563:1f18:62ab with SMTP id s123-20020a625e81000000b005631f1862abmr23617499pfb.76.1666436853677; Sat, 22 Oct 2022 04:07:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666436853; cv=none; d=google.com; s=arc-20160816; b=gf07ZIRCwjd6WoTHLZLRCLiHmRSDnBZp/7o0XPnMXveUFtGbF1JGPZSK85q82FfXGj nyQiQLTYd35OHTyzuKbbnyFBqkm5Jdpcm4L8ijVFEvo3XAEtK0r/kvKd6r113rzXQ0jz xyr6vNQ2AhRhT7La4dhtcs2gFMhu5NXz5EeQCaT6XNZnl5VUa4vgFYN38igO6R28nyIC 4ObjT8l0LBuTGSinN6oNJlvxkys65ayukR3uF1IhA06vwuid/CAAIJ+ybQeGaxSrGj5J RJzH1fzbExyzzTPrUUtE2CeMG/dWcbTAhGdS6fUL0VibBW6exEWPS3uEuaQiUSQGWQZL dL9g== 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=hrsQIDMejoYUUZQTJ29BcdTSyH1+pok7Kf5yJ81Sqi0=; b=O0t1RYscBj0enJaIaPx0p46XvkpWWesFOnPOgrYFBPO0fa6QpK4+boUD51Ia6Uz/L0 Lsu2vKpqh4GsCtHG5UZtM2KXvLYf62ib8UjC4N5EiptxfbMLAwodW18JhsCFRjl460id g5zC7d766m3DT7CyWqNNUHRpL6v0wlRYhARozyrRS+WMP41BA0l32rgfcBZ7kA3ra/LX C8QAgTvtS4w8shxwaiMyC/ELQL+NifU3LtZ/nV8NK3S2RykVkxGXeVOlFBHeP2H8i1PY EqSMrm1Rlw7bFYEYAIl8dUusahQCX3WYwbDC0QhLi2pKHKpCrKdIFzdRWuUqg46+cK54 cWrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=hswTckQR; 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 b12-20020a6541cc000000b00464a9874658si29935360pgq.6.2022.10.22.04.07.21; Sat, 22 Oct 2022 04:07:33 -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=hswTckQR; 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 S230490AbiJVLDc (ORCPT + 99 others); Sat, 22 Oct 2022 07:03:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51252 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230476AbiJVLCl (ORCPT ); Sat, 22 Oct 2022 07:02:41 -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 F40DC2FACE2; Sat, 22 Oct 2022 03:21:13 -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 093F3B82DF7; Sat, 22 Oct 2022 07:53:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 57DEEC433C1; Sat, 22 Oct 2022 07:53:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666425207; bh=KnC0eVRrajGhZ5HIxfCVZGcjDmnvlTYo6SUexl+tkS8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hswTckQR3a/keiU8FJ3bgflkKuv1NbMzn8ggvRJVETZbZjnlSNe4DvDxqeSNmawNR DTFpULLH+d5hugidJX5D7LVB1jGO6DhraZ2+IUkESqMk4FhCRTyAn7i2NNwnL1cvMR snYMc5X18MQZWZQB/MNP7r2Uovd293PHOtMw4Fko= 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 397/717] media: amphion: adjust the encoders value range of gop size Date: Sat, 22 Oct 2022 09:24:36 +0200 Message-Id: <20221022072515.402386581@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.4 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?1747385689850253417?= X-GMAIL-MSGID: =?utf-8?q?1747385689850253417?= From: Ming Qian [ Upstream commit 996f4e89fabe44ab9ac0aabb0697aeecbe717eca ] adjust the value range of gop size from [0, 65535] to [1, 8000]. when the gop size is set to a too large value, it may affect the encoded picture quality. so constrain it to a reasonable range. Fixes: 0401e659c1f92 ("media: amphion: add v4l2 m2m vpu encoder stateful driver") 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/venc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/amphion/venc.c b/drivers/media/platform/amphion/venc.c index 43d61d82f58c..0f21a181c1de 100644 --- a/drivers/media/platform/amphion/venc.c +++ b/drivers/media/platform/amphion/venc.c @@ -644,7 +644,7 @@ static int venc_ctrl_init(struct vpu_inst *inst) BITRATE_DEFAULT_PEAK); v4l2_ctrl_new_std(&inst->ctrl_handler, &venc_ctrl_ops, - V4L2_CID_MPEG_VIDEO_GOP_SIZE, 0, (1 << 16) - 1, 1, 30); + V4L2_CID_MPEG_VIDEO_GOP_SIZE, 1, 8000, 1, 30); v4l2_ctrl_new_std(&inst->ctrl_handler, &venc_ctrl_ops, V4L2_CID_MPEG_VIDEO_B_FRAMES, 0, 4, 1, 0);