From: Robin Murphy <robin.murphy@arm.com>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
jani.nikula@linux.intel.com, joonas.lahtinen@linux.intel.com,
rodrigo.vivi@intel.com, airlied@linux.ie, daniel@ffwll.ch,
zhenyuw@linux.intel.com, zhi.a.wang@intel.com
Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
intel-gvt-dev@lists.freedesktop.org,
linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] drm/i915: switch from 'pci_' to 'dma_' API
Date: Tue, 24 Aug 2021 11:04:25 +0100 [thread overview]
Message-ID: <0cd61d5b-ac88-31e8-99ad-143af480416f@arm.com> (raw)
In-Reply-To: <dbf1018fb773785e0b3b40e601246ed6438e645e.1629666258.git.christophe.jaillet@wanadoo.fr>
Hi,
FWIW this patch itself looks fine, but it does highlight some things
which could be further cleaned up if anyone's interested...
On 2021-08-22 22:06, Christophe JAILLET wrote:
[...]
> diff --git a/drivers/gpu/drm/i915/gt/intel_region_lmem.c b/drivers/gpu/drm/i915/gt/intel_region_lmem.c
> index a74b72f50cc9..afb35d2e5c73 100644
> --- a/drivers/gpu/drm/i915/gt/intel_region_lmem.c
> +++ b/drivers/gpu/drm/i915/gt/intel_region_lmem.c
> @@ -32,7 +32,7 @@ static int init_fake_lmem_bar(struct intel_memory_region *mem)
> mem->remap_addr = dma_map_resource(i915->drm.dev,
> mem->region.start,
> mem->fake_mappable.size,
> - PCI_DMA_BIDIRECTIONAL,
> + DMA_BIDIRECTIONAL,
> DMA_ATTR_FORCE_CONTIGUOUS);
DMA_ATTR_FORCE_CONTIGUOUS is nonsensical here (and below) as it is only
meaningful for coherent buffers allocated by dma_alloc_attrs().
> if (dma_mapping_error(i915->drm.dev, mem->remap_addr)) {
> drm_mm_remove_node(&mem->fake_mappable);
> @@ -62,7 +62,7 @@ static void release_fake_lmem_bar(struct intel_memory_region *mem)
> dma_unmap_resource(mem->i915->drm.dev,
> mem->remap_addr,
> mem->fake_mappable.size,
> - PCI_DMA_BIDIRECTIONAL,
> + DMA_BIDIRECTIONAL,
> DMA_ATTR_FORCE_CONTIGUOUS);
> }
>
[...]
> diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
> index 36489be4896b..cd5f2348a187 100644
> --- a/drivers/gpu/drm/i915/i915_gem_gtt.c
> +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
> @@ -30,7 +30,7 @@ int i915_gem_gtt_prepare_pages(struct drm_i915_gem_object *obj,
> do {
> if (dma_map_sg_attrs(obj->base.dev->dev,
> pages->sgl, pages->nents,
> - PCI_DMA_BIDIRECTIONAL,
> + DMA_BIDIRECTIONAL,
> DMA_ATTR_SKIP_CPU_SYNC |
> DMA_ATTR_NO_KERNEL_MAPPING |
> DMA_ATTR_NO_WARN))
Similarly DMA_ATTR_NO_KERNEL_MAPPING and DMA_ATTR_NO_WARN are also for
coherent allocations rather than streaming mappings.
I'll see if I can whip up a patch to make the API documentation clearer...
Thanks,
Robin.
> @@ -64,7 +64,7 @@ void i915_gem_gtt_finish_pages(struct drm_i915_gem_object *obj,
> usleep_range(100, 250);
>
> dma_unmap_sg(i915->drm.dev, pages->sgl, pages->nents,
> - PCI_DMA_BIDIRECTIONAL);
> + DMA_BIDIRECTIONAL);
> }
>
> /**
>
prev parent reply other threads:[~2021-08-24 10:04 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-22 21:06 [PATCH] drm/i915: switch from 'pci_' to 'dma_' API Christophe JAILLET
2021-08-24 10:04 ` Robin Murphy [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0cd61d5b-ac88-31e8-99ad-143af480416f@arm.com \
--to=robin.murphy@arm.com \
--cc=airlied@linux.ie \
--cc=christophe.jaillet@wanadoo.fr \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-gvt-dev@lists.freedesktop.org \
--cc=jani.nikula@linux.intel.com \
--cc=joonas.lahtinen@linux.intel.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rodrigo.vivi@intel.com \
--cc=zhenyuw@linux.intel.com \
--cc=zhi.a.wang@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).