Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp1377935rdb; Tue, 30 Jan 2024 17:32:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IGtmV+A7mVg4VYLN7uhdVlxux2EJCg3r9IrddbCWswm1Rhe3Rp1utNc8Mo+vonUlSLxQ3CX X-Received: by 2002:a05:620a:1443:b0:783:de5c:358b with SMTP id i3-20020a05620a144300b00783de5c358bmr122722qkl.32.1706664730947; Tue, 30 Jan 2024 17:32:10 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVTWx4Yyr+Yce8w8WafH3Ge0U1lpc9a5WxiNCsg33qXsCaT9Wc1iMgISLZ+BqlwuFMYy3LkD0SbY1f2uRos+8Lo3Otj4nd42Ju716tsJA== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id j20-20020a05620a147400b00783d2b668ffsi10453797qkl.784.2024.01.30.17.32.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 17:32:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-45591-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@chipsnmedia.onmicrosoft.com header.s=selector2-chipsnmedia-onmicrosoft-com header.b=P5YAZhTi; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-45591-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-45591-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id A430C1C237CF for ; Wed, 31 Jan 2024 01:32:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D9828E545; Wed, 31 Jan 2024 01:31:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chipsnmedia.onmicrosoft.com header.i=@chipsnmedia.onmicrosoft.com header.b="P5YAZhTi" Received: from KOR01-SL2-obe.outbound.protection.outlook.com (mail-sl2kor01on2119.outbound.protection.outlook.com [40.107.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 275FC63B8; Wed, 31 Jan 2024 01:31:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.129.119 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706664667; cv=fail; b=E5yRBSVH5Jv2rj8tqhELJg5n/pZ0llFU5s9MyvciabnNchs4YafK7Eqd/N0ykrOcCsRtafS9EwuzmzEhGRDGkhX8eno3qr7Y4pD2beX+Llm44nYSBEbowFZIDHIPojk4kNR4Ea9dGAbQqP26tn0K3pJlYhFdgAxxrQbgXKB+T50= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706664667; c=relaxed/simple; bh=HJBC+Ltj4JnvFVCRHeP4aH4x9ZCZTgbdL5Aabjx6BCA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=rz114BJmMBMu8RrtW28tg+glDwtjVd2SO6V8pWoyFanbcm5etcPOldNelsmzWagSbg4YeDIeH6eSBUITvZcGowEven5N85xOYnOpFmMkBhidjxBgUYvck2FfqDkSMbR85NxoATdJ6C+4HiWYDMxXuqazsUqzKh13EvAvSZ4PzcI= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=chipsnmedia.com; spf=pass smtp.mailfrom=chipsnmedia.com; dkim=pass (1024-bit key) header.d=chipsnmedia.onmicrosoft.com header.i=@chipsnmedia.onmicrosoft.com header.b=P5YAZhTi; arc=fail smtp.client-ip=40.107.129.119 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=chipsnmedia.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chipsnmedia.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oSQ98H4Q/3xyN8M/oOdWuEFMjhwlmsN+qWQU6nnir4fFhSgJU281TvvLm04M/5Gt71SqZ0HJDEEDxUnAjfN9dA/qc5tt6mU05v+bvEkgFwlBtlknZq9Gr0thJ2mb6GOT9glVjNIDJRvt2WVeY/2lZsRBmtZ0QqnT3+RDpCkDoMGIR4Zck0teaeSdwLyQnMYBFUc04S5p5EEm8YSxX6RKFr0+MiZ4ShnI7zh7xW8ZaMaOKFMluhmD58lEoqyJghX9r1wK1St6UJhcWGHFkR0L+/Mv2ZyNYN93skSIBaLRKadOorP2i2sivxN92CCFepG9O5JDLyyDaZ8f3F3jzZiSpg== 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=zBgH4qo5F6ppw6ZGJiII4H63BwbU2A3PKynOtX8yMs8=; b=AFFHZOqMbuAT4ZaFKtfrUDrdCHDtfNu1cR78z5TTHDATzp9njONx7IcJoBkidCQtq9Zf+e1JUuGl6q2/X4mAQ7vtilPzY0whIVOK7+D2effA/o78u8ZGwde0sUtWGIe2ciAxTHF/PqsMg8YU8quWJ6QxXcEjRX5U5/KO2sC6TNT6p4UQQu4rpzKXpnujEJGhPGKr6PVqjSdkgHtT7qZ/2noJPjvCKXG//59hJB661PgCu+01vOPPhWVU2LeK8WBUW03j0qZ/2RasIeOy/7R9OQ14KsWa1JExWCeNrtfEeuxeo0zQ216yxQcwUkN6QsDrYIJ3vqeJaPXOMK+DJ24vvA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=chipsnmedia.com; dmarc=pass action=none header.from=chipsnmedia.com; dkim=pass header.d=chipsnmedia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chipsnmedia.onmicrosoft.com; s=selector2-chipsnmedia-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zBgH4qo5F6ppw6ZGJiII4H63BwbU2A3PKynOtX8yMs8=; b=P5YAZhTiOG7shd78H5wIijrUIZU+CJsXdPRrr8Y572hiVTVWvJ7Ujmz+0LkoKYEWl3CvQd1qhPVk0SxYqIX3UivkSmO9ANkEKJPwQ2cRpltFJqw9NtXtlQJiZg0xGfW1XW/EJxJGoIrGi39Z0T1paOe+6+SWWOWTXd4fpFBmMac= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=chipsnmedia.com; Received: from SE1P216MB1303.KORP216.PROD.OUTLOOK.COM (2603:1096:101:15::5) by PU4P216MB2229.KORP216.PROD.OUTLOOK.COM (2603:1096:301:131::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.22; Wed, 31 Jan 2024 01:30:55 +0000 Received: from SE1P216MB1303.KORP216.PROD.OUTLOOK.COM ([fe80::de27:9f30:e1f9:1b5c]) by SE1P216MB1303.KORP216.PROD.OUTLOOK.COM ([fe80::de27:9f30:e1f9:1b5c%4]) with mapi id 15.20.7249.023; Wed, 31 Jan 2024 01:30:55 +0000 From: "jackson.lee" To: mchehab@kernel.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, nas.chung@chipsnmedia.com Cc: jackson.lee@chipsnmedia.com, lafley.kim@chipsnmedia.com, b-brnich@ti.com Subject: [RESEND PATCH v0 4/5] wave5: Use the bitstream buffer size from host. Date: Wed, 31 Jan 2024 10:30:45 +0900 Message-Id: <20240131013046.15687-5-jackson.lee@chipsnmedia.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240131013046.15687-1-jackson.lee@chipsnmedia.com> References: <20240131013046.15687-1-jackson.lee@chipsnmedia.com> Content-Type: text/plain X-ClientProxiedBy: SL2P216CA0224.KORP216.PROD.OUTLOOK.COM (2603:1096:101:18::12) To SE1P216MB1303.KORP216.PROD.OUTLOOK.COM (2603:1096:101:15::5) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SE1P216MB1303:EE_|PU4P216MB2229:EE_ X-MS-Office365-Filtering-Correlation-Id: acb3e98b-dd5a-4930-9f44-08dc21fc4525 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: RCKP1tNggclQmwgxvQ9WkUCjnEjiV+GRvI9w00jzseR4FEwJjRyjZjNWRO6z2KRrYtEAdUp0/Lb/ct2k7Dok9769U1bsCZwam7ENP4QirkTEcA0A938qobyNJG/2+SmIGm9gc/mbcVU9ECdTk1NUPvBzjc7SP087DQbD1CmuaHKKcLkJZsNi2Zn0rHuadsydRN9Ml9kkriY7pJKa7eUK5k2r3la3VDdjL+2mhaDzhcagggcWPwnewV3smh44fghcUDQDk6OEsv6KDxmMKjwtYm1sxkOCL4FbELZ5dr0cbi8S0X2XgUQDrc6w51QML5Ua99ARW+A/09dYPhE2wIyoNCAW/3FrMCT21tKIeRgdPYdhnpQNbE/V8dMvroseOuls4+Lqi4D0sIpN91BPYlfLyaBUze0AXalmpcxuWqXfzq/F/gOtXJH7aFb0HBIMGERjvyIwNindygaTpt7Lh3a1p4txYyrUElO3+iqIdGS0ZitPDrobk5h7LxfPmXih3g/38zjtp99zQ4bRfaUE/XI/priwX1F+J4Llqp2Ql8hPJrUUExdDNSi7a3Aw93zC8VHeSWBjqddd39HEzELJdsyfuN1XPiqJUyu+DJ4Rx/tQY+jCx6f1Lb1XFD5z37i8/aEL X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SE1P216MB1303.KORP216.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230031)(136003)(376002)(39850400004)(396003)(346002)(366004)(230922051799003)(1800799012)(186009)(451199024)(64100799003)(83380400001)(6666004)(52116002)(2616005)(6506007)(316002)(6486002)(478600001)(86362001)(6636002)(66946007)(66556008)(66476007)(41300700001)(26005)(6512007)(1076003)(5660300002)(8936002)(4326008)(8676002)(38100700002)(2906002)(38350700005)(36756003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?ZZMYPJBc4n2Qb9ne1SyBbM9WSXNBZD1QO9C/gQtX7geueeN6qrUJHt6i5znF?= =?us-ascii?Q?OeH0H9ah6Wi7dfpgepXjROFYfVPgnz42xY4EkRagrzLAX5e5g70CXQNxMKPw?= =?us-ascii?Q?db1RNUtIzTtyBp4Yc+XDmGoO9ZybDasmyocDt7Eqa1hivLjQNXuT9E3k8efD?= =?us-ascii?Q?BYwvvge6kYbOMXHd27cns3qa2V8WUkbb252XWGjai7yfoRUdtWOIbHqjG3vu?= =?us-ascii?Q?HS2fQNlI5fGVWDt3H3/Y8T0xLY7pQvAxWG2E7R3pnmYVN3UxPL0rlkIybM5p?= =?us-ascii?Q?0LujllmMn8qeo1yq1Elb1mhkyBwvj90SmVk3W23F21Oy8xu74bpkrAh4aXAo?= =?us-ascii?Q?JIVb03RwZcO9t9u5+FRNPgOb+SuQ1AxjMqCqa5sFDU6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DJhqeqWlMBoHQAIMMNuhHOWtesPawXOPdez3pH?= =?us-ascii?Q?BlPoOTuNoncjjOKyAZ7yHliAUyxZ5SeAJueDs0SXOr1i0u18pTH7/I1X9lJe?= =?us-ascii?Q?OlKT/suDbuKGZs2wvl3dkp3Qp0FK4Kb3Iva7YFkhTkxB0oivR+NOkPOnmDAW?= =?us-ascii?Q?gIxlTB/eXpfQXpestulGZCoCFtrPBiUPqJA+NZB427rM9DIQz2IGZlTSiguD?= =?us-ascii?Q?doBloOeB1PPPAAcpF/fXEDoTVQTUrJshv2935u8U66TMxx3SHYjNqdQx6MF+?= =?us-ascii?Q?lzHt+0HdFltS4p5K7k8xVRH3znEi6JKLGeNy+Z/BjBZ9kDpr+63ax5aJr6IP?= =?us-ascii?Q?5mgB+C2J9vPBsRXU9aQUOh0=3D?= X-OriginatorOrg: chipsnmedia.com X-MS-Exchange-CrossTenant-Network-Message-Id: acb3e98b-dd5a-4930-9f44-08dc21fc4525 X-MS-Exchange-CrossTenant-AuthSource: SE1P216MB1303.KORP216.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jan 2024 01:30:55.6225 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4d70c8e9-142b-4389-b7f2-fa8a3c68c467 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: V9u3HfPKk49vUif0kWieNz+/mv02SnHppYOLl3mlfxMmHXr+6hC6pbB4+2hQcr+i2+Eq4BF7N/EZF7oT9a73ROorEhhKCyBoyTvyRtutCmk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PU4P216MB2229 In V4L2 spec, Host can set the bitstream buffer size. Allow the larger size between default size and input size. Signed-off-by: Jackson Lee Signed-off-by: Nas Chung --- drivers/media/platform/chips-media/wave5/wave5-vpu-enc.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/chips-media/wave5/wave5-vpu-enc.c b/drivers/media/platform/chips-media/wave5/wave5-vpu-enc.c index ff73d69de41c..19018ace41b6 100644 --- a/drivers/media/platform/chips-media/wave5/wave5-vpu-enc.c +++ b/drivers/media/platform/chips-media/wave5/wave5-vpu-enc.c @@ -11,6 +11,10 @@ #define VPU_ENC_DEV_NAME "C&M Wave5 VPU encoder" #define VPU_ENC_DRV_NAME "wave5-enc" +#define DEFAULT_SRC_SIZE(width, height) ({ \ + (width) * (height) / 8 * 3; \ +}) + static const struct vpu_format enc_fmt_list[FMT_TYPES][MAX_FMTS] = { [VPU_FMT_TYPE_CODEC] = { { @@ -193,7 +197,8 @@ static void wave5_update_pix_fmt(struct v4l2_pix_format_mplane *pix_mp, unsigned pix_mp->width = width; pix_mp->height = height; pix_mp->plane_fmt[0].bytesperline = 0; - pix_mp->plane_fmt[0].sizeimage = width * height / 8 * 3; + pix_mp->plane_fmt[0].sizeimage = max(DEFAULT_SRC_SIZE(width, height), + pix_mp->plane_fmt[0].sizeimage); break; } } -- 2.43.0