dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Ivanov <gnidorah@p0n4ik.tk>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: "dri-devel@lists.freedesktop.org" <dri-devel@lists.freedesktop.org>
Subject: Re: Use of pci_map_page in nouveau, radeon TTM.
Date: Thu, 03 Oct 2013 20:19:25 +0400	[thread overview]
Message-ID: <312971380817165@web26m.yandex.ru> (raw)
In-Reply-To: <20131001141416.GB5913@phenom.dumpdata.com>

01.10.2013, 18:16, "Konrad Rzeszutek Wilk" <konrad.wilk@oracle.com>:
> On Tue, Oct 01, 2013 at 12:16:16PM +0200, Thomas Hellstrom wrote:
>
>>  Jerome, Konrad
>>
>>  Forgive an ignorant question, but it appears like both Nouveau and
>>  Radeon may use pci_map_page() when populating TTMs on
>>  pages obtained using the ordinary (not DMA pool). These pages will,
>>  if I understand things correctly, not be pages allocated with
>>  DMA_ALLOC_COHERENT.
>
> Not always. That depends if the SWIOTLB buffer has been enabled.
> Which happens if you have Calgary IOMMU, AMD GART and if you
> run under Xen.
>
>>  From what I understand, at least for the corresponding
>>  dma_map_page() it's illegal for the CPU to access these pages
>>  without calling
>>  dma_sync_xx_for_cpu(). And before the device is allowed to access
>>  them again, you need to call dma_sync_xx_for_device().
>
> Correct.
>
>>  So mapping for PCI really invalidates the TTM interleaved CPU /
>>  device access model.
>
> Unless you use the TTM DMA one which allocates them from the
> coherent pool - in which case they are already mapped.
>
> Granted the part of using DMA export/import API is not finished
> (so moving from TTM pool to a V4L for example) and it will blow
> up with the right mix.
>
>>  Or did I miss something here?
>
> That is it. But for most of the use cases the drivers have been
> able to skirt this restriction b/c the pci_map_page/pci_unmap_page
> setup a DMA mapping that is static (until the pci_unmap_page) and
> on x86 the memory is coherent. So the map is good irregardless
> of the PCI devices. Naturally if you have multitple IOMMUs per bridge
> this all falls apart :-(
>
> This all falls flat also with non-coherent memory and I believe
> that is what some of the PA-RISC folks are hitting their heads
> against.

Konrad,

As i already answered you, this is irrelevant to the 2.0 version
of PA-RISC architecture on which we run our ATI video options.

>
> And probably also on ARM once they start using these chipsets.
>
>>  Thanks,
>>  Thomas
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

      reply	other threads:[~2013-10-03 16:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-01 10:16 Use of pci_map_page in nouveau, radeon TTM Thomas Hellstrom
2013-10-01 10:34 ` Lucas Stach
2013-10-01 11:13   ` Thomas Hellstrom
2013-10-01 11:56     ` Lucas Stach
2013-10-01 14:14 ` Konrad Rzeszutek Wilk
2013-10-03 16:19   ` Alex Ivanov [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=312971380817165@web26m.yandex.ru \
    --to=gnidorah@p0n4ik.tk \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=konrad.wilk@oracle.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