Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp642617ybb; Wed, 25 Mar 2020 06:57:51 -0700 (PDT) X-Google-Smtp-Source: ADFU+vux/1slaiK6pI9j/itSPGZD5zUqVwVQZxysG+YamMFeSOQNo4YribFXb68nMNyLMEy1GXgo X-Received: by 2002:aca:d489:: with SMTP id l131mr2601401oig.5.1585144671127; Wed, 25 Mar 2020 06:57:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585144671; cv=none; d=google.com; s=arc-20160816; b=PnsO6L4LtZqvW5vsriO8h9nozfbsqsoqGl0CbnJyhzw0p9d5YnsroTXa65ey27z3kf EwahBRmy0QXIW2iBozkc8tyeKHwAJFk8DDkFrYwqVeRsObrlXuMNg3+qk6nbj+uuaSO/ tI9qhgqI8vLOKxyexaagRDYSxwgiJzgm0N5bIZxmw8NQr6FvxSkSiSnfAyIQcpk7kb3s Ee92QtiKbF1Pj8pZD+s7b5J2OCzjiNAEDBs4rZrW8r1OlLxVXzZ5jV8IORpmAJ1n/3KA KRMgOuJwtXvULhalbQV0njyiDM+JQGodAfk8mUUsnPfpih6Xavo11Y7W5mQPXa37YBdq SXzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :dlp-reaction:dlp-version:dlp-product:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:ironport-sdr:ironport-sdr; bh=GDN4hIDRiJGwIQXOo4LTJ7Dc2B0oByrZH1Iw78qnNrE=; b=APnomcdPuQahFHLvrW/BsZndOu2yidkCfD7/fR4hDAD1T9Bn57fRe6IFgAxj4XP+jk PofN+FgAXFg66wyEExKLOZZoefC9I0kX1YWp7SOIUM4emTwsmHhnx74e/AnvWVRW7Kcd EPl+e1+d0jTWBQd0oF/vtUzryRHvrI6xCZh4stUEUyxXtVTKMdEzcP4/wURI5N7Gg0Bv LAx+V1TWTp2HI+uFewQv8AU8vDP9j1sAekaLNNBKpPboIPZGXN2foAe0apbOKGWRX1fP ay4syYYZCKxgL/KXSH7IMkWQ+AF5Y0Nz7wC/acVwva5C3ukiMxIcu+LquuF3YnY1j5x9 DwpA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w65si1547590ooa.42.2020.03.25.06.57.37; Wed, 25 Mar 2020 06:57:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727635AbgCYN4J convert rfc822-to-8bit (ORCPT + 99 others); Wed, 25 Mar 2020 09:56:09 -0400 Received: from mga09.intel.com ([134.134.136.24]:10299 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727277AbgCYN4J (ORCPT ); Wed, 25 Mar 2020 09:56:09 -0400 IronPort-SDR: fD0gy8O2PaKOR+oY1LtjmvPsntJ9CJvP0tWS/TTrhcZGgSr5RecWo6iFPyc2LU/om6INLDNZQX MnSLbW0KWa/A== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Mar 2020 06:56:08 -0700 IronPort-SDR: s57Q6TOkQpu6PJRl7m3fQgh2HQCgGEcvzcVIQBs7hOlRQkCk5SIMJhdsmq1cn+TmvdKZD+wDkY //bcVV7IYhLw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,304,1580803200"; d="scan'208";a="250414365" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga006.jf.intel.com with ESMTP; 25 Mar 2020 06:56:08 -0700 Received: from fmsmsx107.amr.corp.intel.com ([169.254.6.38]) by FMSMSX103.amr.corp.intel.com ([169.254.2.250]) with mapi id 14.03.0439.000; Wed, 25 Mar 2020 06:56:07 -0700 From: "Ruhl, Michael J" To: Shane Francis , "dri-devel@lists.freedesktop.org" CC: "airlied@linux.ie" , "linux-kernel@vger.kernel.org" , "amd-gfx-request@lists.freedesktop.org" , "alexander.deucher@amd.com" , "christian.koenig@amd.com" Subject: RE: [PATCH v4 1/3] drm/prime: use dma length macro when mapping sg Thread-Topic: [PATCH v4 1/3] drm/prime: use dma length macro when mapping sg Thread-Index: AQHWAoT+OOcEgrTLV0+k11mipUYGbahZUVMA Date: Wed, 25 Mar 2020 13:56:07 +0000 Message-ID: <14063C7AD467DE4B82DEDB5C278E8663FFFBD421@fmsmsx107.amr.corp.intel.com> References: <20200325090741.21957-1-bigbeeshane@gmail.com> <20200325090741.21957-2-bigbeeshane@gmail.com> In-Reply-To: <20200325090741.21957-2-bigbeeshane@gmail.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.1.200.107] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org >-----Original Message----- >From: dri-devel On Behalf Of >Shane Francis >Sent: Wednesday, March 25, 2020 5:08 AM >To: dri-devel@lists.freedesktop.org >Cc: airlied@linux.ie; linux-kernel@vger.kernel.org; bigbeeshane@gmail.com; >amd-gfx-request@lists.freedesktop.org; alexander.deucher@amd.com; >christian.koenig@amd.com >Subject: [PATCH v4 1/3] drm/prime: use dma length macro when mapping sg > >As dma_map_sg can reorganize scatter-gather lists in a >way that can cause some later segments to be empty we should >always use the sg_dma_len macro to fetch the actual length. > >This could now be 0 and not need to be mapped to a page or >address array >Signed-off-by: Shane Francis >--- > drivers/gpu/drm/drm_prime.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/drivers/gpu/drm/drm_prime.c b/drivers/gpu/drm/drm_prime.c >index 86d9b0e45c8c..1de2cde2277c 100644 >--- a/drivers/gpu/drm/drm_prime.c >+++ b/drivers/gpu/drm/drm_prime.c >@@ -967,7 +967,7 @@ int drm_prime_sg_to_page_addr_arrays(struct >sg_table *sgt, struct page **pages, > > index = 0; > for_each_sg(sgt->sgl, sg, sgt->nents, count) { >- len = sg->length; >+ len = sg_dma_len(sg); > page = sg_page(sg); > addr = sg_dma_address(sg); This looks correct to me. Reviewed-by: Michael J. Ruhl M > >-- >2.26.0 > >_______________________________________________ >dri-devel mailing list >dri-devel@lists.freedesktop.org >https://lists.freedesktop.org/mailman/listinfo/dri-devel