Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp4887341pxb; Mon, 15 Feb 2021 04:06:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJy71CgtUbzffoEDpyGfDl6Jf4cumM3w4yHAgzL+JcpNIGZ4/WnIUuNU7l300mUoPMsbyDuD X-Received: by 2002:a17:906:5fc5:: with SMTP id k5mr4613000ejv.207.1613390777314; Mon, 15 Feb 2021 04:06:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613390777; cv=none; d=google.com; s=arc-20160816; b=HLnvtBEo/G4DRnzYLz3hfEs5SYmb56FAGivMyrE9G4XRQ0idFQ/mWqkqrWuzl+pn+M CwoxpHVr5WElFlv+r+zxdilKvnaPxmURIpOEXNEp2z6OHy22CyIxrRFi8heE4b2Eg6GO vRaFAozAF4fB0kNU+0H/KAz9jEwIvr7qB/1+116MBk9wozxEN2U2IuqSOhyXgkkeYVn6 c0CaOxcC4h+zIM6p+cYGkBa4EvgrbiTX8rZeQ65gYcZykTB9Er1dgu7WjvgV5w/DNPfy jS/SZl3+4Zuu/4LWt8Xzt1yMh9s6x/BMyBV9sEegODdt9HcUspb3e5MzI4pr6ug1RTG7 yM8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:mime-version:user-agent:date :message-id:references:cc:to:from:subject; bh=CZ+aD/QBtj6oK/sxWWnEG7Yzv8V/E/iQUxEi2SvOAcE=; b=dmXzFIQzVVXl56SFCHP0vU4SqjGaGQvqsVegnYojJxiCTZsLSs68hca9Ud1xHJroEp 4OT2aqKLm0ix0DzanE9SYtxznwO2arv4Xo/U2TqPefCG09mD8jeQW2Elw8QKkj6ZbKmG WEN2xLuwk/DsGATFj0IRQ/uk4RD4TbdyW6kn/sE2mAk53sDNcHCsi8waOVZUrvsoH0HG tYXMeHekXxnFqecBsyM8+xXo/XuD0SraHhP2VC5kcTPHqRunStyUW5s8CgdxK2loPAcw DoAv8ZJ+ftS6H5GRrxPPOiKDnlMubLuWTF6bIrggyxFBm/E2Z3n8RdQukIXwiN8ijCw4 hbMw== ARC-Authentication-Results: i=1; mx.google.com; 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 g2si1562494edn.428.2021.02.15.04.05.53; Mon, 15 Feb 2021 04:06:17 -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; 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 S230216AbhBOMCk (ORCPT + 99 others); Mon, 15 Feb 2021 07:02:40 -0500 Received: from mx2.suse.de ([195.135.220.15]:39046 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230184AbhBOMBa (ORCPT ); Mon, 15 Feb 2021 07:01:30 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 7F02BACD4; Mon, 15 Feb 2021 12:00:48 +0000 (UTC) Subject: Re: DMA-buf and uncached system memory From: Thomas Zimmermann To: =?UTF-8?Q?Christian_K=c3=b6nig?= , linux-media , dri-devel , linaro-mm-sig@lists.linaro.org, lkml Cc: "Sharma, Shashank" References: <91ff0bbb-ea3a-2663-3453-dea96ccd6dd8@amd.com> Message-ID: <302e06ad-f979-dc77-5d84-fa0923aa4632@suse.de> Date: Mon, 15 Feb 2021 13:00:46 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="8ejIhBaoaH74EllZioVxmsx5UYclcyGPJ" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --8ejIhBaoaH74EllZioVxmsx5UYclcyGPJ Content-Type: multipart/mixed; boundary="jpBOcMfQ4Rk9pKdZviZiesqHtZrYP8I7j"; protected-headers="v1" From: Thomas Zimmermann To: =?UTF-8?Q?Christian_K=c3=b6nig?= , linux-media , dri-devel , linaro-mm-sig@lists.linaro.org, lkml Cc: "Sharma, Shashank" Message-ID: <302e06ad-f979-dc77-5d84-fa0923aa4632@suse.de> Subject: Re: DMA-buf and uncached system memory References: <91ff0bbb-ea3a-2663-3453-dea96ccd6dd8@amd.com> In-Reply-To: --jpBOcMfQ4Rk9pKdZviZiesqHtZrYP8I7j Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable Hi Am 15.02.21 um 10:49 schrieb Thomas Zimmermann: > Hi >=20 > Am 15.02.21 um 09:58 schrieb Christian K=C3=B6nig: >> Hi guys, >> >> we are currently working an Freesync and direct scan out from system=20 >> memory on AMD APUs in A+A laptops. >> >> On problem we stumbled over is that our display hardware needs to scan= =20 >> out from uncached system memory and we currently don't have a way to=20 >> communicate that through DMA-buf. Re-reading this paragrah, it sounds more as if you want to let the=20 exporter know where to move the buffer. Is this another case of the=20 missing-pin-flag problem? 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=20 >> generic for this? >=20 > For vmap operations, we return the address as struct dma_buf_map, which= =20 > contains additional information about the memory buffer. In vram=20 > helpers, we have the interface drm_gem_vram_offset() that returns the=20 > offset of the GPU device memory. >=20 > Would it be feasible to combine both concepts into a dma-buf interface = > that returns the device-memory offset plus the additional caching flag?= >=20 > There'd be a structure and a getter function returning the structure. >=20 > struct dma_buf_offset { > =C2=A0=C2=A0=C2=A0=C2=A0bool cached; > =C2=A0=C2=A0=C2=A0=C2=A0u64 address; > }; >=20 > // return offset in *off > int dma_buf_offset(struct dma_buf *buf, struct dma_buf_off *off); >=20 > Whatever settings are returned by dma_buf_offset() are valid while the = > dma_buf is pinned. >=20 > Best regards > Thomas >=20 >> >> 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 >=20 >=20 > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel >=20 --=20 Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Maxfeldstr. 5, 90409 N=C3=BCrnberg, Germany (HRB 36809, AG N=C3=BCrnberg) Gesch=C3=A4ftsf=C3=BChrer: Felix Imend=C3=B6rffer --jpBOcMfQ4Rk9pKdZviZiesqHtZrYP8I7j-- --8ejIhBaoaH74EllZioVxmsx5UYclcyGPJ Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature" -----BEGIN PGP SIGNATURE----- wsF5BAABCAAjFiEExndm/fpuMUdwYFFolh/E3EQov+AFAmAqYm4FAwAAAAAACgkQlh/E3EQov+CM OQ/9H7AYQ1xEe3151Vo7dWI+/gR1rlw3WGzPnRdx+eIaBeNgNERC4eOnalzj/yovVjPQis6HVWIg wfQ4BFIvwLKml+RSHEqJGbmAKly3J8NJCFyGk6E+de83sAENt9kqZSkXJpggzI3ZAjLDBB9L9Uff LglN6XzVNgiW3TFN+2CkqPzIC+xoTcHhRvJpPyHB+geUHrjvd15hdIVcl4kbkOGe4+llrQgmw5m3 n9jz3oRhFHgd53G+ZipWlnPigd3RP4fb5+aVofSowQXeQYe6lI6J+Cf60Frc4So7I1lyfgwSr6tY v8MSW5+F4ua1AKA2uDS/9eoYkyqB4N9amaLnTBJ0Q5DER9xXmfLHZCk2JlViTW/bAbhg5kB6EHxy 8GtBWvyQupA53nATzkipM6LNClAt47lh8vGH1hV8PiirSSETLtJ53/UccaqWag41WaWlfQAsbe0g cZ+EgZvCkjuf3iTVF0OFs0nz2cXJcdnnI3u0u+BvrSFv50pvJ+mNSvJNtIE5Ew69e6ldLQe5UKXQ ku0aXBtFP1MWo72Y5IKaHWJmoJyYWL5Y/9UucBILAsGBaJu8YKBDIEcVqjLNNjRxb/TUFRgA5NEv UC5aI+2CsGLxy350LmncNZk2L/xJzIwpe3hhuuRZf+TgNoJfn3ibNLdzGyEVi8MJPXPXuzm8NPs4 iw8= =W8bt -----END PGP SIGNATURE----- --8ejIhBaoaH74EllZioVxmsx5UYclcyGPJ--