From patchwork Thu Oct 8 11:23:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Christian_K=C3=B6nig?= X-Patchwork-Id: 11822661 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 39BBA6CA for ; Thu, 8 Oct 2020 11:23:51 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id DEC8221527 for ; Thu, 8 Oct 2020 11:23:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Cf1RVSf2" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DEC8221527 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 71D396B0068; Thu, 8 Oct 2020 07:23:48 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 67D2D6B006C; Thu, 8 Oct 2020 07:23:48 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 51DEB6B0070; Thu, 8 Oct 2020 07:23:48 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0054.hostedemail.com [216.40.44.54]) by kanga.kvack.org (Postfix) with ESMTP id 1D7126B0068 for ; Thu, 8 Oct 2020 07:23:48 -0400 (EDT) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id B6F55181AE865 for ; Thu, 8 Oct 2020 11:23:47 +0000 (UTC) X-FDA: 77348523294.22.wind13_3e13502271d7 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin22.hostedemail.com (Postfix) with ESMTP id 968C018038E60 for ; Thu, 8 Oct 2020 11:23:47 +0000 (UTC) X-Spam-Summary: 1,0,0,4535747bb750a62b,d41d8cd98f00b204,ckoenig.leichtzumerken@gmail.com,,RULES_HIT:41:152:355:379:541:800:960:973:988:989:1260:1277:1311:1313:1314:1345:1359:1381:1437:1515:1516:1518:1534:1541:1593:1594:1676:1711:1730:1747:1777:1792:2393:2559:2562:3138:3139:3140:3141:3142:3352:3865:3866:3867:3868:3870:3871:3874:5007:6261:6653:7875:7903:8603:9413:10004:10400:11026:11658:11914:12043:12048:12296:12297:12438:12517:12519:12555:12895:13069:13311:13357:13894:14096:14097:14181:14394:14659:14687:14721:21080:21433:21444:21451:21627:21666:21740:30003:30054:30064,0,RBL:209.85.208.67:@gmail.com:.lbl8.mailshell.net-62.18.84.100 66.100.201.100;04ygqtiw35baagyt1j1b7kx94f7zropiqw1pupsi3kzaiyketjke18emoa4pesw.om6xaxnin586kw1b5geaf9a379ieufasis6m9n61d1kx65wqtq4htsbyewf7fzq.g-lbl8.mailshell.net-223.238.255.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:24,LUA_SUMMARY:none X-HE-Tag: wind13_3e13502271d7 X-Filterd-Recvd-Size: 4758 Received: from mail-ed1-f67.google.com (mail-ed1-f67.google.com [209.85.208.67]) by imf08.hostedemail.com (Postfix) with ESMTP for ; Thu, 8 Oct 2020 11:23:47 +0000 (UTC) Received: by mail-ed1-f67.google.com with SMTP id v19so5426776edx.9 for ; Thu, 08 Oct 2020 04:23:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=JsjjPHzjofiTjxIZU4zLpu7KElZkR0RdFNQVI4MgOuI=; b=Cf1RVSf2Wd5WKqBEQe/s36QG8XPfHBaG2UWWLmc7AROqUPPPQzryQaYWEUL3oqek8t bJAWEG3kKcAlgth9M38k2B/Nt+MG9IFqUTNhiYyms9eyVbvr8NcfwpPUj/XllhPiA0lR CEOK7HNJLYHG2ro7ZcBAavoxQL+en5L6fLiIqlSMlj8iywTFoAQE8nxzlrsyLbgjMxpi aofcNv/eTwnrxMk1doVKqyCl2Lzj63kYoISdf1LGyZfeO4qxt1PCfDKoVBAEDuVy+NFE Aa5I9mDCi/xhlOeDfBYRqyWBA93TrkNz+9HNhzXjHl+Z5vLOKICpcpqiYFyy5VDMaDh4 4ZPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=JsjjPHzjofiTjxIZU4zLpu7KElZkR0RdFNQVI4MgOuI=; b=NTHmdCpZPVA1Wgc3uJ1zyW2nHWWVYD2CvoeW330hv+/9Hgyohvh5ikK9PoL5tJsfdf 6ArQ0NnORGJBFKXp9bDW5n2pY8ANwojjLY21nRLnSJYEJzm4TH4ymbMd/z/KaUaoB4fm YMPjr4XxMf2Qu1vF8XqSGDjpMLM0z32ZfECbk1SUtjJdvxBMJjgtcT7JsGIyKaFWEpFx p3RpTk2j0eszDLq/TAaYeuEv/iBXcUx77qYIevEy3Cl7JgXZtFowuSABYFVlejLZlF34 O0X3oXgMIl9U1E6KFikwO1n944oqAKfMlLRw1rtkvZskfE9AzdUTC9QfDWL/rrX/oJdN tKvA== X-Gm-Message-State: AOAM531btxfNXuPAq/j/4mpyC+THrZdnu4JaELf8TIfhYeKHyR8F3kX7 j3rX+GrpTFUlckZJzI7MguaIE3QutcE= X-Google-Smtp-Source: ABdhPJwDRyJHE6THipTubGPFIEhicDT26J0ZkLEqMYptkgqx4YSyy8HXoku93odOoEECNMopX74sdQ== X-Received: by 2002:aa7:c7c2:: with SMTP id o2mr8673537eds.366.1602156225590; Thu, 08 Oct 2020 04:23:45 -0700 (PDT) Received: from abel.fritz.box ([2a02:908:1252:fb60:4c64:a9a0:5e0:905a]) by smtp.gmail.com with ESMTPSA id i20sm3529030edv.96.2020.10.08.04.23.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Oct 2020 04:23:45 -0700 (PDT) From: " =?utf-8?q?Christian_K=C3=B6nig?= " X-Google-Original-From: =?utf-8?q?Christian_K=C3=B6nig?= To: linux-mm@kvack.org, linux-kernel@vger.kernel.org, linaro-mm-sig@lists.linaro.org, dri-devel@lists.freedesktop.org, linux-media@vger.kernel.org, chris@chris-wilson.co.uk, airlied@redhat.com, akpm@linux-foundation.org, daniel@ffwll.ch, sumit.semwal@linaro.org Subject: [PATCH 2/4] drm/prime: document that use the page array is deprecated Date: Thu, 8 Oct 2020 13:23:40 +0200 Message-Id: <20201008112342.9394-2-christian.koenig@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201008112342.9394-1-christian.koenig@amd.com> References: <20201008112342.9394-1-christian.koenig@amd.com> MIME-Version: 1.0 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: We have reoccurring requests on this so better document that this approach doesn't work and dma_buf_mmap() needs to be used instead. Signed-off-by: Christian König --- drivers/gpu/drm/drm_prime.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_prime.c b/drivers/gpu/drm/drm_prime.c index 4910c446db83..16fa2bfc271e 100644 --- a/drivers/gpu/drm/drm_prime.c +++ b/drivers/gpu/drm/drm_prime.c @@ -956,7 +956,7 @@ EXPORT_SYMBOL(drm_gem_prime_import); /** * drm_prime_sg_to_page_addr_arrays - convert an sg table into a page array * @sgt: scatter-gather table to convert - * @pages: optional array of page pointers to store the page array in + * @pages: deprecated array of page pointers to store the page array in * @addrs: optional array to store the dma bus address of each page * @max_entries: size of both the passed-in arrays * @@ -965,6 +965,11 @@ EXPORT_SYMBOL(drm_gem_prime_import); * * Drivers can use this in their &drm_driver.gem_prime_import_sg_table * implementation. + * + * Specifying the pages array is deprecated and strongly discouraged for new + * drivers. The pages array is only useful for page faults and those can + * corrupt fields in the struct page if they are not handled by the exporting + * driver. */ int drm_prime_sg_to_page_addr_arrays(struct sg_table *sgt, struct page **pages, dma_addr_t *addrs, int max_entries)