Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp3383988rdb; Wed, 13 Sep 2023 10:17:25 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHl3JD6aUgKJogw31rHEFxWGjaqxWDCtTjJMyRtAtX7/+T+5jnPfqu4rlUY4wR+XO/tdPSa X-Received: by 2002:a05:6870:b61c:b0:1bf:1d31:9c9f with SMTP id cm28-20020a056870b61c00b001bf1d319c9fmr3310950oab.19.1694625444706; Wed, 13 Sep 2023 10:17:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694625444; cv=none; d=google.com; s=arc-20160816; b=ZICmMe8ypiAgnX2dgmzK+1nACA7v38pOrd95SmAzF9Vd8MCTSfPY3SvLLUHfu/pl5e R5kkgf2Pdiw7VvqTB9zLeG665DCUnPuPRZELlV6/fjmjOVR50l7lLMJ8l2soy59W1/Po /pKdB5AQu1TtQcm7vQvCwCwaDiAMsF2GnNAYBNAVGlo0VaiIUfEjEPs8L3TrXC4P+Pod pIlMSlxfQpQFnrRnvgNObkdwoy9SBOzWuBXk0m/eEzBxAajz+sPxM8/Iv+kaAlAJIoSw AMC4nfhU6WBPtQSmkrb/WmHGD6IVD2hUxJZ9C3KtDqntZPY530noVxgxsv34J1HsvtrL qHPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=26teksENA+dQQO6m1YUj6nkAa9mPqWw8dabp0DqJ9V8=; fh=nPERTVGHZG9+h90NkRJ0x8nlRc9b84Kt6h2y5L6QfSo=; b=FGtX4cP58fZoAGgIpDbCkWKEFrKIQiO00Iw4nQzodF8IliwYAtpjF1de/O3SdnPYMF oW3gnRtOabbY0eIx8SUn+nmprY2yz+Qjll9Le+eNklFLXowpzcq5Yk5Hud62E/2xfvE5 JARCCXxpKpvnJEwWzXkcew1w37uwi9DuKr/nCLoWZYFumUy0ETj3Yviz9lbdFRzhj0gM wNFVgn6j4aRE+kIN4QD9PSZMvog77ctVUAjWJo0JgwXylCxtSOYqudppBNkeC9DLc5RY 4ietrQrIYCLfCq3UOhBtWp7M0IdHth0d70iC7IkoMyvYQR/AAJixihLpC5NsxEM4G49o nSiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=lRVAqpX2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id by38-20020a056a0205a600b00564a5b8937asi11295754pgb.341.2023.09.13.10.17.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 10:17:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=lRVAqpX2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 511FD80BB3FF; Wed, 13 Sep 2023 01:31:14 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238900AbjIMIa6 (ORCPT + 99 others); Wed, 13 Sep 2023 04:30:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36648 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238888AbjIMIa5 (ORCPT ); Wed, 13 Sep 2023 04:30:57 -0400 Received: from mail-lj1-x232.google.com (mail-lj1-x232.google.com [IPv6:2a00:1450:4864:20::232]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E8AE710E6; Wed, 13 Sep 2023 01:30:52 -0700 (PDT) Received: by mail-lj1-x232.google.com with SMTP id 38308e7fff4ca-2bcb0b973a5so105524371fa.3; Wed, 13 Sep 2023 01:30:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1694593851; x=1695198651; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=26teksENA+dQQO6m1YUj6nkAa9mPqWw8dabp0DqJ9V8=; b=lRVAqpX2pEVukg52DaBFEtyaloNDsgRhYLYkhft1IP8dy+d0/913W0w8UP7omj0dfd a89+TKNwY1pwjSE+JJKoNGi3utEWit9OPTDDImLix9SPSrLCqLtNA1V2kpNXACImYhSp FY93RLLfgg5pZli/hikLVUu/YC3TQYklRRAI+95AjJlAA7NerR5QjfRkPveuKwGNIbBG TBUMo9S0U9a/IPGAF72rTNitV/26keZuFC6Ml1gisDw2kr1K9gjQV2+phst8UZhqz+kM RqzP4zKq/QJO/CFsRFW2Djv1jFuQ8PBUeS23bpsxaP8FS9DuDzb+TzINg76Tkj2Yt8HY QioQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694593851; x=1695198651; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=26teksENA+dQQO6m1YUj6nkAa9mPqWw8dabp0DqJ9V8=; b=jvHl5sEW57SxAPuLhvPNpPdUa8w87IHGHTuEaTEMiNXvxmTVLwYBiGTCU1cktCb4J9 B86l6Y0pPYE6NDC9xwUbhZuXVcVQoZU2KZ2FpecznjuByYjpaf/hCC49t5mmoU89zqb+ OKzQUh3aRrsw+LLlcuhJxF5VJ3CMikL7fXSPRlTSWd0eB1RQL3p2V1p7IxuitXWTM/x3 mqQ1uBp3DqjjJ/ckCI2ulpOyDTHXtRusUg7ZvJzan1boaqdwHUy/wCaOUJa5zrgQcbjv TpUPhtSNoqypNhVFKuccNAikpu39On/84tvNzQrpBeHDYS2yuEp3PifCy0T2ywMSSevZ v4PQ== X-Gm-Message-State: AOJu0YznlABLd3HPQkJJqIY5JziO9UJ76iAC/FV7e098aBGRUao0RUba O7VAi+Fswe4Gkz/ZuiEcFSQ= X-Received: by 2002:a2e:9f4e:0:b0:2bc:b75e:b88 with SMTP id v14-20020a2e9f4e000000b002bcb75e0b88mr2019335ljk.18.1694593850754; Wed, 13 Sep 2023 01:30:50 -0700 (PDT) Received: from [10.254.108.106] (munvpn.amd.com. [165.204.72.6]) by smtp.gmail.com with ESMTPSA id m10-20020a7bcb8a000000b003fed7fa6c00sm1341375wmi.7.2023.09.13.01.30.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 13 Sep 2023 01:30:50 -0700 (PDT) Message-ID: <82b4b49a-1893-ea4d-3856-693a7824e939@gmail.com> Date: Wed, 13 Sep 2023 10:30:48 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.0 Subject: Re: [PATCH 3/9] dma-heap: Provide accessors so that in-kernel drivers can allocate dmabufs from specific heaps Content-Language: en-US To: Nicolas Dufresne , =?UTF-8?B?WW9uZyBXdSAo5ZC05YuHKQ==?= , "jstultz@google.com" Cc: "sumit.semwal@linaro.org" , "linux-kernel@vger.kernel.org" , "robh+dt@kernel.org" , "linux-mediatek@lists.infradead.org" , "linaro-mm-sig@lists.linaro.org" , "linux-media@vger.kernel.org" , "devicetree@vger.kernel.org" , =?UTF-8?B?SmlhbmppYW8gWmVuZyAo5pu+5YGl5aejKQ==?= , =?UTF-8?B?S3VvaG9uZyBXYW5nICjnjovlnIvptLsp?= , "Brian.Starkey@arm.com" , "conor+dt@kernel.org" , "benjamin.gaignard@collabora.com" , "tjmercier@google.com" , "krzysztof.kozlowski+dt@linaro.org" , "dri-devel@lists.freedesktop.org" , "matthias.bgg@gmail.com" , "linux-arm-kernel@lists.infradead.org" , "angelogioacchino.delregno@collabora.com" References: <20230911023038.30649-1-yong.wu@mediatek.com> <20230911023038.30649-4-yong.wu@mediatek.com> <803846bc-fd1d-d2ec-2855-456af22c82f8@amd.com> <23e71d1f-08c1-3834-5b1f-2b5714c7bfaa@gmail.com> <255ae6b9ac1b6bea9262069747824b8461475e70.camel@mediatek.com> <95797f3d-65bf-1bd9-9e19-6de42605cfe3@gmail.com> <8140975aa1f5c3cbdfa2e6f42aecebe3701f29da.camel@ndufresne.ca> From: =?UTF-8?Q?Christian_K=c3=b6nig?= In-Reply-To: <8140975aa1f5c3cbdfa2e6f42aecebe3701f29da.camel@ndufresne.ca> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Wed, 13 Sep 2023 01:31:14 -0700 (PDT) X-Spam-Status: No, score=-2.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Am 12.09.23 um 16:58 schrieb Nicolas Dufresne: > Le mardi 12 septembre 2023 à 16:46 +0200, Christian König a écrit : >> Am 12.09.23 um 10:52 schrieb Yong Wu (吴勇): >>> [SNIP] >>>> But what we should try to avoid is that newly merged drivers provide >>>> both a driver specific UAPI and DMA-heaps. The justification that >>>> this >>>> makes it easier to transit userspace to the new UAPI doesn't really >>>> count. >>>> >>>> That would be adding UAPI already with a plan to deprecate it and >>>> that >>>> is most likely not helpful considering that UAPI must be supported >>>> forever as soon as it is upstream. >>> Sorry, I didn't understand this. I think we have not change the UAPI. >>> Which code are you referring to? >> Well, what do you need this for if not a new UAPI? >> >> My assumption here is that you need to export the DMA-heap allocation >> function so that you can server an UAPI in your new driver. Or what else >> is that good for? >> >> As far as I understand you try to upstream your new vcodec driver. So >> while this change here seems to be a good idea to clean up existing >> drivers it doesn't look like a good idea for a newly created driver. > MTK VCODEC has been upstream for quite some time now. The other patchset is > trying to add secure decoding/encoding support to that existing upstream driver. > > Regarding the uAPI, it seems that this addition to dmabuf heap internal API is > exactly the opposite. By making heaps available to drivers, modification to the > V4L2 uAPI is being reduced to adding "SECURE_MODE" + "SECURE_HEAP_ID" controls > (this is not debated yet has an approach). The heaps is being used internally in > replacement to every allocation, user visible or not. Thanks a lot for that explanation, I was really wondering what the use case for this is if it's not to serve new UAPI. In this case I don't see any reason why we shouldn't do it. It's indeed much cleaner. Christian. > > Nicolas > >> Regards, >> Christian. >> >>>>> So I think this patch is a little confusing in this series, as I >>>> don't >>>>> see much of it actually being used here (though forgive me if I'm >>>>> missing it). >>>>> >>>>> Instead, It seems it get used in a separate patch series here: >>>>> >>>> https://lore.kernel.org/all/20230911125936.10648-1-yunfei.dong@mediatek.com/ >>>> >>>> Please try to avoid stuff like that it is really confusing and eats >>>> reviewers time. >>> My fault, I thought dma-buf and media belonged to the different tree, >>> so I send them separately. The cover letter just said "The consumers of >>> the new heap and new interface are our codecs and DRM, which will be >>> sent upstream soon", and there was no vcodec link at that time. >>> >>> In the next version, we will put the first three patches into the >>> vcodec patchset. >>> >>> Thanks. >>>