Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp5213489pxb; Mon, 15 Feb 2021 12:49:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJyJ5iQMYqU9mpoMLtdA6OWC1T3w/jOkiqpgQB37L8QkqDHCLSfewLLET80uMSWUPRSKsvzf X-Received: by 2002:a17:906:8890:: with SMTP id ak16mr11571812ejc.398.1613422194778; Mon, 15 Feb 2021 12:49:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613422194; cv=none; d=google.com; s=arc-20160816; b=atFu84RUZja3rqWwNGkIH8gFdWYqN45JKTzXOgQHjF5Bpe1INtjvraAcWf3AjbuTJo JjzjecxgCe3pVBYVwnpbxJKavLAO7EhAGbBdLOjvT4OGyFHkacegdKVtSyLj1uH7nMmh qf1yESZYwmGa23N1uYuvvHuBeXrrBDaIh1Of9exuBaLkS6TJRO3cwskXCHvw5sZa//SM 0qFI6QvI5crkxHxT0IRv8H9Z6XYn0KjsFGt7i4h2LONC3ZJTKRWPw65xHaSpPnVDHppX CYc8rKmC/mEGsuncCF2mposf4SMYN9xC5wDvuMdrh/l381ovWXrozs8iHK9Xwrq+GY/0 g2oA== 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:date:cc:to:from:subject :message-id:dkim-signature; bh=3vnbyd+FSQ7JLkQZLcxkUBRVmalOAVC3JmRRBLUbqks=; b=t1oLJzJMhMdxFPlCgYzch4sxmJciEc4ILc2ME51lvhogcSO51jzDqeS7argtt1Ox1c 6NqJH1WlQJbL3LuIiYB5dFKzRR+GTuNWaYX24e3Xazq7Wqkng9rkZZy3grM7fTHL/xwK YZ68nn2DENcAon874eXdecTHq9iT8+C0gBQVatM2ZyqssyOt6vI3IzDYPfVGMobuvMER dhFMnqpQKVcj/ANswLIx42vWlgCv19q/P193LxP8aEHZWJGMPQzIRt+aIAkBP694ucoi KpnIEACuB6kU3d1MipbfjCXN5eSgpCRMJ0xKKpr+5zOt68lhESZx5xWC9DRXAttq+EQs VX7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ndufresne-ca.20150623.gappssmtp.com header.s=20150623 header.b=esWzugW0; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bt20si13359821edb.234.2021.02.15.12.49.30; Mon, 15 Feb 2021 12:49:54 -0800 (PST) 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=@ndufresne-ca.20150623.gappssmtp.com header.s=20150623 header.b=esWzugW0; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229615AbhBOUr0 (ORCPT + 99 others); Mon, 15 Feb 2021 15:47:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229764AbhBOUrW (ORCPT ); Mon, 15 Feb 2021 15:47:22 -0500 Received: from mail-qt1-x831.google.com (mail-qt1-x831.google.com [IPv6:2607:f8b0:4864:20::831]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 04370C0613D6 for ; Mon, 15 Feb 2021 12:46:41 -0800 (PST) Received: by mail-qt1-x831.google.com with SMTP id c1so5747925qtc.1 for ; Mon, 15 Feb 2021 12:46:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ndufresne-ca.20150623.gappssmtp.com; s=20150623; h=message-id:subject:from:to:cc:date:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=3vnbyd+FSQ7JLkQZLcxkUBRVmalOAVC3JmRRBLUbqks=; b=esWzugW0DKNBhrEoOD3RZZJolEW7Ikdy5h5A40L1tqevvbAOT0V/axZemZNOQYOsnx ZqD3ZNUy7by/NGsHl09vQs2I9j3jVNSSq/5jppK8df5zAjh2YbuB92wVmlkE6owxZt6Z fwPkbPpOrOtuUOH/tqvvcYAUJ7p8hpPxFMCbkziFPOS2od1Xdv+xAzbaRryT395mvWIA QyyYXiKXhyZNlxJBfjOYZS5ljhuVQqbKjm+x0+mXk6Y6fxHbxD/TWeJerjITehGHcVPB pxTKBBtJtVVSfRfx3vwnolnX6XUXAf2UOCCWDeKRGFqpkPkgkyir6U39VbeZbqeRFUQ0 u1Fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=3vnbyd+FSQ7JLkQZLcxkUBRVmalOAVC3JmRRBLUbqks=; b=R2wy+VuLU7dcr3JbuQ/pas9qOzU97UTEYwlWE17w7vKYePd+AD6DEoidlfjkUz7Y0U Aif1hkh1+OCJo0v4H8IXcitQqXTDXCDt7zkSN2CGTcivuG8W5NZKGZrP/SX/QI/7KS6M dTSIX8+WP+RILvjyN34f1HNo0wedyyWVlVlbIgMxPLZynFDYlg/AJMaOX/VZXiGHRZim p1YPfj14AvPIxy/1rk+McSh/Zkni6vuk7Vv/edn2nHzTO3G/LlLqSXlGtzkf0kS/KuWG 47TBqRLPc4ClRBcVwOEr0sj1DaSsNJJXwWt4AJvdhg8ybHNJIzOnWSk4P/gUauG8mQ+U 01Yg== X-Gm-Message-State: AOAM532tBxvNukATY1qwYMaXgBHW8sL0nv9FkOCgYZ6UzB7SEaWdVxA7 Pm+uovVzRtYjZZk0g7JXJeNhHg== X-Received: by 2002:ac8:1009:: with SMTP id z9mr15996768qti.347.1613422001232; Mon, 15 Feb 2021 12:46:41 -0800 (PST) Received: from nicolas-tpx395.lan (173-246-12-168.qc.cable.ebox.net. [173.246.12.168]) by smtp.gmail.com with ESMTPSA id k187sm13020361qkc.74.2021.02.15.12.46.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Feb 2021 12:46:40 -0800 (PST) Message-ID: <6e107811295b7fdd96525453ea5587ee6adc1b06.camel@ndufresne.ca> Subject: Re: DMA-buf and uncached system memory From: Nicolas Dufresne To: Christian =?ISO-8859-1?Q?K=F6nig?= , Thomas Zimmermann , linux-media , dri-devel , linaro-mm-sig@lists.linaro.org, lkml Cc: "Sharma, Shashank" Date: Mon, 15 Feb 2021 15:46:39 -0500 In-Reply-To: <80c42ce0-6df1-71ab-81ec-e46cc56840ba@amd.com> References: <91ff0bbb-ea3a-2663-3453-dea96ccd6dd8@amd.com> <302e06ad-f979-dc77-5d84-fa0923aa4632@suse.de> <80c42ce0-6df1-71ab-81ec-e46cc56840ba@amd.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.38.3 (3.38.3-1.fc33) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le lundi 15 février 2021 à 13:10 +0100, Christian König a écrit : > > > Am 15.02.21 um 13:00 schrieb Thomas Zimmermann: > > Hi > > > > Am 15.02.21 um 10:49 schrieb Thomas Zimmermann: > > > Hi > > > > > > Am 15.02.21 um 09:58 schrieb Christian König: > > > > Hi guys, > > > > > > > > we are currently working an Freesync and direct scan out from system > > > > memory on AMD APUs in A+A laptops. > > > > > > > > On problem we stumbled over is that our display hardware needs to > > > > scan out from uncached system memory and we currently don't have a > > > > way to communicate that through DMA-buf. > > > > Re-reading this paragrah, it sounds more as if you want to let the > > exporter know where to move the buffer. Is this another case of the > > missing-pin-flag problem? > > No, your original interpretation was correct. Maybe my writing is a bit > unspecific. > > The real underlying issue is that our display hardware has a problem > with latency when accessing system memory. > > So the question is if that also applies to for example Intel hardware or > other devices as well or if it is just something AMD specific? I do believe that the answer is yes, Intel display have similar issue with latency, hence requires un-cached memory. > > Regards, > Christian. > > > > > Best regards > > Thomas > > > > > > > > > > For our specific use case at hand we are going to implement > > > > something driver specific, but the question is should we have > > > > something more generic for this? > > > > > > For vmap operations, we return the address as struct dma_buf_map, > > > which contains additional information about the memory buffer. In > > > vram helpers, we have the interface drm_gem_vram_offset() that > > > returns the offset of the GPU device memory. > > > > > > Would it be feasible to combine both concepts into a dma-buf > > > interface that returns the device-memory offset plus the additional > > > caching flag? > > > > > > There'd be a structure and a getter function returning the structure. > > > > > > struct dma_buf_offset { > > >      bool cached; > > >      u64 address; > > > }; > > > > > > // return offset in *off > > > int dma_buf_offset(struct dma_buf *buf, struct dma_buf_off *off); > > > > > > Whatever settings are returned by dma_buf_offset() are valid while > > > the dma_buf is pinned. > > > > > > Best regards > > > Thomas > > > > > > > > > > > After all the system memory access pattern is a PCIe extension and > > > > as such something generic. > > > > > > > > Regards, > > > > Christian. > > > > _______________________________________________ > > > > dri-devel mailing list > > > > dri-devel@lists.freedesktop.org > > > > https://lists.freedesktop.org/mailman/listinfo/dri-devel > > > > > > > > > _______________________________________________ > > > dri-devel mailing list > > > dri-devel@lists.freedesktop.org > > > https://lists.freedesktop.org/mailman/listinfo/dri-devel > > > > > >