Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp1828208rwb; Wed, 26 Jul 2023 20:28:38 -0700 (PDT) X-Google-Smtp-Source: APBJJlFkLanMHBLrMZF2ka/5Cw7A18DSGSc11d3890Y019rt5ldyZP6vrgSNpgZ7slo+ccqIgftI X-Received: by 2002:a05:620a:4005:b0:767:30a5:4c7d with SMTP id h5-20020a05620a400500b0076730a54c7dmr5339194qko.24.1690428518004; Wed, 26 Jul 2023 20:28:38 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1690428517; cv=pass; d=google.com; s=arc-20160816; b=yHYURVA59TaBYGONAFhyD64rAeSdFP6GjP8XgjaWG3RTMpXI7kt5TxVwUChCWKpynQ Qj2nbBviDl5VfZGaVAaCTEX1PDrwJBpKKFS05Xrr10ObMO1id2ePVbRMs2fpLegoPiz9 4TcJSkeFvUOQLTeUbmJnjy/a8IyBUywJC/o6gzKNpfvz2CTxQNqWV/Qrzt6UrSveGK2Q pa8YNECGlF9h4mWmuBDNX3BBWdC6z40foBhgB9cVevzgzsNiCRefYXut5CRLEzKWDMUr P95xW8W4acaYosUn+ZYi2dbnoF7lo+zoemwcL94f8UEFkfyEiB4CsyWEna/jTezOkuTV zB7A== 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 :in-reply-to:from:references:cc:to:content-language:subject :user-agent:date:message-id:dkim-signature; bh=gY9M+0LmptkYHfh+dLi6tGGNqsAp1cA+w3Y1BuUrUuM=; fh=fh/Y/s++jp70OndJEhSMVn/7QwypotMAd5PTwEJlLQc=; b=Wvq455d+/yjwiJEvMVeGczZLFZEaeD8WTUo8Y5FkhVJZhnFZKYT9JcKCbQjXJgusjQ u4isdUgLrPRrSFstH1PFCP6QdsiJIrtU9AgA1vPp7gcsF6ltJzUbnGJUPSnjuBhbxF89 WufyEWpHBx3PVKZoHXMqGKHsHsYOXzIdD09kag9XwbRFL5jVWwi0YFEG+ItfKQJswZbp 8tCejXpMufPm5++A8QJcMOhVyOd7+Zjps+hjJ/L3txSXZz/YYNlhRPjRCkytlH3Xv+3z e7jI061LHI0np/dfPn2s+FsN8XRWUUv8w6VAKVHzHOoMOLkRNcheO1nEhnuBoUVHJTaV tafA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Synaptics.onmicrosoft.com header.s=selector2-Synaptics-onmicrosoft-com header.b=MKbT5ZK8; arc=pass (i=1 spf=pass spfdomain=synaptics.com dkim=pass dkdomain=synaptics.com dmarc=pass fromdomain=synaptics.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=fail (p=NONE sp=NONE dis=NONE) header.from=synaptics.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q12-20020a056a00084c00b0067f750aa3f7si544069pfk.257.2023.07.26.20.28.25; Wed, 26 Jul 2023 20:28:37 -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=@Synaptics.onmicrosoft.com header.s=selector2-Synaptics-onmicrosoft-com header.b=MKbT5ZK8; arc=pass (i=1 spf=pass spfdomain=synaptics.com dkim=pass dkdomain=synaptics.com dmarc=pass fromdomain=synaptics.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=fail (p=NONE sp=NONE dis=NONE) header.from=synaptics.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230182AbjG0CpR (ORCPT + 99 others); Wed, 26 Jul 2023 22:45:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50762 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229910AbjG0CpQ (ORCPT ); Wed, 26 Jul 2023 22:45:16 -0400 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2040.outbound.protection.outlook.com [40.107.236.40]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1B7721724; Wed, 26 Jul 2023 19:45:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=I9sOQeDw5Hq6LB9dsprgC29w5V84OaGrRkuf+2gBUbnb83862qkYVHWqjeUc2itPSkcGxRpjXGQcQXS4E0y9ILvN6KHK/vgeHLe98JkPfMcSyqOcMuSw+mcNq0qbfcRPPjsl0YZCWx7D2/KfC/PJ9XAqd9HmSuo1N9mwnoPF/X/zxCAoVyZvVRV/Zb4BY6aklNKkbmh4vS4T9/qoz3foc7nE79drB341rE04d1yqZ2IOMwbtcKohUDbjvQXJ0HG56a50A32klUWa5/XdjjDvixPyy4guGCft5+cUhnryvaHB8PPwtVs/EWsQi+BhjXZ0Qjqbl2JEjs05sKJq6T/FjQ== 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=gY9M+0LmptkYHfh+dLi6tGGNqsAp1cA+w3Y1BuUrUuM=; b=KRjzVJ+ZhsnZ6KtLoNMihHHd4L8iSdej6KDnvRuRmIzGpn9EfDgZK7Y0ZSOqetZa7ceuNHZ4gpkMLtJD6SwRd4BCYpgSNLfE9oouGOC/mAQzEQ5qjXQXNoWofDtRN6qgmsTCnKuHf7D3fsTCMifP8kcM+EUrEIJbTjsvZ3wPfbbQvC9Mbx/OA/rapQrhp19ahouObVZNEZr+SgDiKjUSHI2O9telOv80bxVcHFNoqP67TOIS5BcJet1PfoKtmbkZ32zdKRUEuSB1ZqZZi3fJirO5/GrQ+GNw/vP/PEwCnjA1lf6Qj2gjzAu1fPj8o4svtEJYrG0SYlK4zvk6mWV5jg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=synaptics.com; dmarc=pass action=none header.from=synaptics.com; dkim=pass header.d=synaptics.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Synaptics.onmicrosoft.com; s=selector2-Synaptics-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=gY9M+0LmptkYHfh+dLi6tGGNqsAp1cA+w3Y1BuUrUuM=; b=MKbT5ZK8HHfhYC7syFTNusC2JO0/0oN12vJATkycRsZ/1SXxre74ZMoZa7MRZuSRmTlvKQp+rFyxk7HU3EuX5Cai1a+DaB73ZSZMyeW/DUmc+sK31dTx2MHhXh3L3TkNx0EB73FHFFNaPW2AIyVd5RjWuuqtG8vDc4oMEkWtnpI= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=synaptics.com; Received: from DM6PR03MB5196.namprd03.prod.outlook.com (2603:10b6:5:24a::19) by SA0PR03MB5468.namprd03.prod.outlook.com (2603:10b6:806:b1::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Thu, 27 Jul 2023 02:45:13 +0000 Received: from DM6PR03MB5196.namprd03.prod.outlook.com ([fe80::411c:e486:3837:cc25]) by DM6PR03MB5196.namprd03.prod.outlook.com ([fe80::411c:e486:3837:cc25%3]) with mapi id 15.20.6631.026; Thu, 27 Jul 2023 02:45:12 +0000 Message-ID: Date: Thu, 27 Jul 2023 10:45:01 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: Stateless Encoding uAPI Discussion and Proposal Content-Language: en-GB To: Nicolas Dufresne Cc: linux-kernel@vger.kernel.org, Paul Kocialkowski , linux-media@vger.kernel.org, Hans Verkuil , Sakari Ailus , Andrzej Pietrasiewicz , Michael Tretter , =?UTF-8?Q?Jernej_=c5=a0krabec?= , Chen-Yu Tsai , Samuel Holland , Thomas Petazzoni References: <87cfcdfadee89984496c3f52d01b4f1e10c12cae.camel@collabora.com> From: Hsia-Jun Li In-Reply-To: <87cfcdfadee89984496c3f52d01b4f1e10c12cae.camel@collabora.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: PH8PR07CA0004.namprd07.prod.outlook.com (2603:10b6:510:2cd::13) To DM6PR03MB5196.namprd03.prod.outlook.com (2603:10b6:5:24a::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6PR03MB5196:EE_|SA0PR03MB5468:EE_ X-MS-Office365-Filtering-Correlation-Id: da94ef18-8e04-49a8-0a39-08db8e4b7fdf X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ofTe8gV8tfoorm9uUd1taPB0kgO5PhhafEo+EO9a4zNkyEX8mFHQ6v2ICbmnV9mrwqq660oEgWFAAEDoGfGhvCBczL0I7rVvCl5hhI/dyVIprepE5DAEtoXzkGH5K4IWBgwyPGS+hmNpMfEeZoCQMpqzTF/pr7g219Jn9jJ5CGI8V3DkG8rvDIAdVV/re9rnl2KKjxdVg29g6i4YnIF0FfIbkHQjzP2+M46QDU9QEKdY8TyPEIwK9YskaiSkTsfVmG47i723vujAPn/2x0UdHiarIOFpSUemdfOHDo05D0WpJgeOGSDLEeEO4OcCPvt3Ng2LI5qRk88Ay57pyRbHS9t+7eSSMYOhQAf8aMirwzFZg9WlTMyGIyjex4VIPg7lsvmv1jPb5f3aF8udlBwaSM29D8R/9Ha9cMDLw4qU2Taui8IaiMEtMWqVAe1n5AvG0kRULUOle/1fFiuKVGOHW0ROCF/Lidrl7Ewlt+NfeC/uWuCx010pPsirzhWIGpccPKY3/cssGQp2G5OGYr1xwMCvCoZYFV5iqOMdX9CO8q0+Yzg7kvvCFR3lWdrpIPC3uvUQf/K25jshSI9S6Vf+ncYZ2qBmq0OVNv9g/8lWmYC9nU1lUQF3XD+rvu313gRe0e9AngtmyTyFAWhDvBvbFmzV/2USFlrRh4MdLLxtpLdmICm5mulk3wyH2CGP4Hmx X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR03MB5196.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(346002)(39860400002)(136003)(396003)(376002)(451199021)(83380400001)(54906003)(38350700002)(5660300002)(2906002)(2616005)(7416002)(6666004)(6486002)(52116002)(66574015)(53546011)(26005)(86362001)(6512007)(478600001)(38100700002)(41300700001)(316002)(186003)(66556008)(66946007)(66476007)(31686004)(31696002)(6506007)(6916009)(8676002)(8936002)(36756003)(4326008)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?akU3OXhuMGttNGhOL1lOYVZXYmMvL0lxNERjOXNFZlR0T1V4cHRoVVQzeHF0?= =?utf-8?B?ZEM3c1Jxb1h3SG9TNzZiUU5xTnE0OU5mQ0NuWHBBRHVPQVN0SS9vRlFPK0Ur?= =?utf-8?B?SUdEWFo2ZHRVT0dhWUhSS2k3OVdqeHJrUVJzS0ZyMzBrWUlZR1RHbUFMYzZW?= =?utf-8?B?bXl5THluM0J2bEpxd1N3Y1hOUGwvNFkzN2dIQk9zaEo1YTlpSUc3MVZoVE1r?= =?utf-8?B?TmNTU2pOM0plbHFuMW5WQ0JQZFhQN0hYVDJ3eWw0S1dhOW5MK3BIVThIRmJ0?= =?utf-8?B?clJjZnpIUGhxdHFwZ3UvVG8vWVZnSFh3c2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8?Q?O7vpDOnHMhnT1qVio5ipdj++V?= X-OriginatorOrg: synaptics.com X-MS-Exchange-CrossTenant-Network-Message-Id: da94ef18-8e04-49a8-0a39-08db8e4b7fdf X-MS-Exchange-CrossTenant-AuthSource: DM6PR03MB5196.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2023 02:45:12.3652 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 335d1fbc-2124-4173-9863-17e7051a2a0e X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: CaXQqc0IF7stLnlfDxAAP5IZ35yqiobqZ7v62d+NbTYfDaSDYkh/TCy8CXADJ8PLvDClbHsbhpvoDDH4Or6B0Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR03MB5468 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,NICE_REPLY_A,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 On 7/27/23 03:53, Nicolas Dufresne wrote: > CAUTION: Email originated externally, do not click links or open attachments unless you recognize the sender and know the content is safe. > > > Hi, > > Le mercredi 26 juillet 2023 à 10:49 +0800, Hsia-Jun Li a écrit : >>> I am strongly against this approach, instead I think we need to keep all >>> vendor-specific parts in the kernel driver and provide a clean unified userspace >>> API. >>> >> We are driving away vendor participation. Besides, the current design is >> a performance bottleneck. > > I know you have been hammering this argument for many many years. But in > concrete situation, we have conducted tests, and we out perform vendors stacks > that directly hit into hardware register with stateless CODEC. Also, Paul's > proposal, is that fine grain / highly close to metal tuning of the encoding > process should endup in the Linux kernel, so that it can benefit from the > natural hard real-time advantage of a hard IRQ. Just like anything else, we will In a real case, especially in those EDR/DVR, NVR, re-encoding could happen occasionally. The important is feedback the encoded statistic to the controller(userspace) then userspace decided the future operation(whether re-encoding this or not). > find a lot of common methods and shareable code which will benefit in security The security for a vendor would only mean the protection of its intelligence properties. Also userspace and HAL is isolated in Android. Security or quality are not a problem here, you can't even run the unverified code. Or we just define an interface that only FOSS would use. > and quality, which is very unlike what we normally get from per vendor BSP. The > strategy is the same as everything else in Linux, vendor will adpot it if there > is a clear benefit. And better quality, ease of use, good collection of mature Any vendor would like to implement a DRM(digital right, security) video pipeline would not even think of this. They are not many vendors that just sell plain video codecs hardware. In such case, we can't even invoke in its memory management, they may even drop the V4L2 framework. Somebody may say why the vendor want the stateless codec, they could have a dedicated core to run a firmware. It is simple, if you are comparing an ARM cortex-R/M core to an ARM application core, which one could performance better? A remote processor could make the memory model(cache coherent) more complex. Besides, it is about the cost. > userspace software is what makes the difference. It does takes time of course. Anyway, despite those registers and controls part, I think I could input the buffer management part here. Please DO ***NOT*** make a standard that occupied many memory behinds usersace and a standard that user has to handle the reconstruction buffer holding with a strange mechanism(I mean reconstruction buffer lifetime would be manged by userspace manually). > > regards, > Nicolas -- Hsia-Jun(Randy) Li