From patchwork Wed Oct 19 08:29:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 4776 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp215689wrs; Wed, 19 Oct 2022 02:16:22 -0700 (PDT) X-Google-Smtp-Source: AMsMyM565q4pA5fCvPMr0MpnqJln2SNEQEzbqVz6aapFp7StiLH1I2cc+rAqJw021QXIGCmVXPEe X-Received: by 2002:a17:906:58d2:b0:78d:9d2f:3005 with SMTP id e18-20020a17090658d200b0078d9d2f3005mr5616343ejs.697.1666170982465; Wed, 19 Oct 2022 02:16:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666170982; cv=none; d=google.com; s=arc-20160816; b=tJgBIgJbEb/vo6RIZ9qkkWPg0+OHv+TCcT7qtplV47MoOYU8qSIJGe8NlC6UlzD1OU Bm1jiKq1gmJvgGiwiH3/t4LFYimPYpIjZWAZVn6h50Dmqk+R4/0PiZMDlok1mFxpmzs0 tCkPD2KmEqAI1A7EZXaYf7KdkjBTBeterIY5iAGRcl3hG+W8AejTp2mAbxs0G68kwwPr 9S14ohUU5jUIhcJArTZfddDLhaxatz5iCGb9PAo1bB1rDdWq+CC8uFkBIDmhBejoZO4g yDyx8oNkA34qUaWPhTZ/Tsrhx+JZxRlIc9kthoWgy4FW1CcTzoAhRat8Ur6Sr58M+Dlm do4A== 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=TmlmzHVX7GCTezd0n23VtQLolnOiHokLTFDC6pDGQNU=; b=JJk0VL+WzlxnOyr0Doei6iqLsbbwkqQexBn2kbAZiDe0RVRi8dhTvxdzFnR7ueowfb KP8UffXrioQ9Z8DqnZnwOwN6sXar7G9RzrrgVKOLtwwku/17/P3smSuyLdXIHkyG4UsS 5NjmzBThcZiGgZaYk25VH+g5SauVHpMDQjxCvyOKP59ortdIPfaeW8Zc7wMfhtpG8LN7 JnHUqH3tpyZL8KLOl8/qwqWk+NoOBFVK72cYoEkHyNPk6RGvUit9yXtE/v9V7MenUGuu rbEJFRkMK/1fIi7GUUTqIOMBI7npU1bLjQbvY1oa59hrsuAknkJDI3EgckCqPuh5sva1 /1Qw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=FDl9e9q4; 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 js22-20020a17090797d600b0078dcfe6a000si15627692ejc.727.2022.10.19.02.15.55; Wed, 19 Oct 2022 02:16:22 -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=FDl9e9q4; 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 S233008AbiJSJNN (ORCPT + 99 others); Wed, 19 Oct 2022 05:13:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233231AbiJSJKa (ORCPT ); Wed, 19 Oct 2022 05:10:30 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9C4EBBA91E; Wed, 19 Oct 2022 02:02:19 -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 8E7A3617D1; Wed, 19 Oct 2022 09:00:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A52D2C433D7; Wed, 19 Oct 2022 09:00:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666170004; bh=SPlFG2GdKVscxA6rjQ8dsy9EO2LGv3Cxg7UH6JBhp68=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FDl9e9q4n2ZLTIIIMqdE/2riJ4hFjyQ/IvjU5mj6i0vqH8X2QQrFl/YeRuYnhiKU+ abViJrqum6Vi9ZDdcWRL2Hv+L/7JF3trW4Txu84/5y7w9rD1kp2Tp9tJx2e9fBGqFP 1vCbbK1z5pO32HiGWfNlyrpqB7cqwAkeM8Q6qH2M= 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 6.0 491/862] media: amphion: adjust the encoders value range of gop size Date: Wed, 19 Oct 2022 10:29:38 +0200 Message-Id: <20221019083311.690094528@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@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?1747106904544087059?= X-GMAIL-MSGID: =?utf-8?q?1747106904544087059?= 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 461524dd1e44..37212f087fdd 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);