Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3212078pxv; Sun, 25 Jul 2021 21:06:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwbwlqQGLXrE9ikyJPVzpBW2Vxj3Gx3N7qdgfHuDLCmdUgvm55iou7rhwqeIB32OB1bFp2j X-Received: by 2002:a05:6638:100b:: with SMTP id r11mr14762305jab.85.1627272362967; Sun, 25 Jul 2021 21:06:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627272362; cv=none; d=google.com; s=arc-20160816; b=bf5xUQY5hCzDPcg6A+3i3b/fv66qyL49F/FTdz2iFGCM4FI6KW2cnoZQsyXNCAtOD9 OpUCrVePCsJ1HPmnoDGaD89cxRD+KO75kTS1jnGImLRC0Gqzat9mnWN8C30RLyGdq5dh QX7giCvgg+4OVcwLva7IuJ7MQ9+P8Kb+Z50px5LX4yNZ0oQsT2poYSXCzq/oN/qYA6NY +I70ak4cxrP1IFmI/9uWWfqVbQukahQBG3mtNCv3Vdj/kjSmy085XMYvHP1J7f+JCVZk xdy3q4+bgPwxNki0lItct298KzIU0OsA5Vh01vVh2hWLnVlv9BZaYd/IEk/Fm57arFWm qNdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=IIvcSyU1E65bR7w1DDg8slGET/s8Q+m7sc5AZf8NFiE=; b=Wom8LbGdYxvkKd0tNMcNjL46jLjkV8OsWHHTfM+7FK4vTsMBnvo0u0Q0i7TfBFtt6V lX0bP7LwLomh4CcD9/A9/5Qqw4yLIo6kyx3+ZYs8pAyHAFlrYYxryIc5/WAWLSyLI/Tf JS0InJ+btSEsYN0ZkJSEl8sxma5MmqkkLWwxLyqDpNNMWkAvTM5Ubn9guhkPd3KIOoz0 TkFHRv12Uo5PZhOiZL8Sv0DxK1GmJ1+8v4OJJnTYxk4GCV/eBho/f3TwT9oFgucnGpO4 0zG0hqUWEiDYQAySKLXtzdUIVeV6d51I5yq+ocULVyCsD+8wk/p5A8yPZi9xpyB+XKfI TZfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=hMUCP2c9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u3si44005809ilk.94.2021.07.25.21.05.51; Sun, 25 Jul 2021 21:06:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=hMUCP2c9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231421AbhGZDYj (ORCPT + 99 others); Sun, 25 Jul 2021 23:24:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230321AbhGZDYi (ORCPT ); Sun, 25 Jul 2021 23:24:38 -0400 Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com [IPv6:2a00:1450:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB800C061757 for ; Sun, 25 Jul 2021 21:05:07 -0700 (PDT) Received: by mail-ej1-x62e.google.com with SMTP id gs8so923296ejc.13 for ; Sun, 25 Jul 2021 21:05:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=IIvcSyU1E65bR7w1DDg8slGET/s8Q+m7sc5AZf8NFiE=; b=hMUCP2c9a3KgKSQMGqbSls3L6icE6DQGge9ygXLIKD6TRuRMyExvyHjwxw0zKcC9T8 nIRCN687oSlbROKVwvlrRTnF5QE4Zqpr3ZHO7ugRFTWJW6BlSRMOnpyLdS61LYBkYHnM N2/1CvH+wigM0xKkoQBTL0QsgmHN+4GbsEGNk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=IIvcSyU1E65bR7w1DDg8slGET/s8Q+m7sc5AZf8NFiE=; b=GRN2GIxolEho1g2uVXR0fEktgfpe+W2LWL2Hul++lw2UDdkxGMLGs+VsD5DyPSQa7H v147298W5cB7AtQVsjeZbqgfFaR5LL2Owghrm97Zro+ubCLgfvE8V0Uofb7lwx2rGmF/ vewKnon/4o6PCic589wIOarkArsgb8JYHhdlVqBETVhm+4EMmFXgaKtekwqhDmGMFhtw ZgXojyzCD4BP5BS1suK6rFk056ORRvs+OGWYD0pzw1q4bZWgYt5Mo2c2wanhP65cdrnU mViFF3e/Wdu4wV6XJ037FUpmGznVekKobqjb0rVxzHg4RjFMwwuNfwf2PodS7skZKBxr moIA== X-Gm-Message-State: AOAM530NrY78XXWh5IAzaErOGMXG4DDGZH3/FEuCQXgHUEBDVR9/yrWA MyC46NQaWkk7ic/L5XGVDrc34Oa4Bd07vA== X-Received: by 2002:a17:906:718c:: with SMTP id h12mr14994415ejk.6.1627272306303; Sun, 25 Jul 2021 21:05:06 -0700 (PDT) Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com. [209.85.221.54]) by smtp.gmail.com with ESMTPSA id de19sm3821348edb.6.2021.07.25.21.05.05 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 25 Jul 2021 21:05:05 -0700 (PDT) Received: by mail-wr1-f54.google.com with SMTP id n12so5853380wrr.2 for ; Sun, 25 Jul 2021 21:05:05 -0700 (PDT) X-Received: by 2002:a5d:46cb:: with SMTP id g11mr16953638wrs.192.1627272305067; Sun, 25 Jul 2021 21:05:05 -0700 (PDT) MIME-Version: 1.0 References: <20210709092027.1050834-1-senozhatsky@chromium.org> <20210709092027.1050834-9-senozhatsky@chromium.org> <3c80786a-7422-3736-7261-8605260eb99f@collabora.com> In-Reply-To: From: Tomasz Figa Date: Mon, 26 Jul 2021 13:04:53 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCHv3 8/8] videobuf2: handle non-contiguous DMA allocations To: Sergey Senozhatsky Cc: Dafna Hirschfeld , Hans Verkuil , Ricardo Ribalda , Christoph Hellwig , Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Collabora Kernel ML Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 26, 2021 at 12:59 PM Sergey Senozhatsky wrote: > > On (21/07/22 19:26), Dafna Hirschfeld wrote: > > Also, the 'cookie' cb returns buf->dma_addr which is not initialized for > > the noncontiguous api. So it is not clear how drivers should use the new api. > > Many drivers call vb2_dma_contig_plane_dma_addr which returns the cookie. > > Hmm, that's a good find. Is ->dma_addr the same as what we have in > sgt.sgl->dma_address for non-contig? Yes. As per [1]: "The return sg_table is guaranteed to have 1 single DMA mapped segment as indicated by sgt->nents, but it might have multiple CPU side segments as indicated by sgt->orig_nents." [1] https://www.kernel.org/doc/html/latest/core-api/dma-api.html#part-ii-non-coherent-dma-allocations