All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Hellstrom <thellstrom@vmware.com>
To: Daniel Vetter <daniel@ffwll.ch>
Cc: dri-devel@lists.sourceforge.net
Subject: Re: [PATCH 2/2] drm/vmwgfx: Use the linux DMA api to get valid device addresses of pages
Date: Mon, 04 Nov 2013 18:26:13 +0100	[thread overview]
Message-ID: <5277D8B5.6080309@vmware.com> (raw)
In-Reply-To: <20131104162708.GK4167@phenom.ffwll.local>

On 11/04/2013 05:27 PM, Daniel Vetter wrote:
> On Mon, Nov 04, 2013 at 05:57:39AM -0800, Thomas Hellstrom wrote:
>> The code handles three different cases:
>> 1) physical page addresses. The ttm page array is used.
>> 2) DMA subsystem addresses. A scatter-gather list is used.
>> 3) Coherent pages. The ttm dma pool is used, together with the dma_ttm
>> array os dma_addr_t
>>
>> Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
>> Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
> For i915.ko use we've added page iterators which should walk the physical
> backing storage.
>
> commit a321e91b6d73ed011ffceed384c40d2785cf723b
> Author: Imre Deak <imre.deak@intel.com>
> Date:   Wed Feb 27 17:02:56 2013 -0800
>
>      lib/scatterlist: add simple page iterator
>
>

Yes, I saw those iterators, (nice stuff!) and my patch are using them as 
a "base class", handling also
TTM page - and dma address arrays basically with the same interface. In 
the long run we might
want to move ttm over to sg_tables as well.

One problem, though, the page iterators break in the mapped case where
sg_dma_len(sg) != sg_len(sg).
An iommu implementation is allowed to reduce the sg list to a single 
segment, in which case those page
iterators will fall apart. I was planning to see if I could fix that up, 
but unfortunately there is no generic
dma_to_phys.
It all works now because intel_iommu, amd_iommu and swiotlb all keep the 
number of entries in an
sg list across mapping....

/Thomas

------------------------------------------------------------------------------
Android is increasing in popularity, but the open development platform that
developers love is also attractive to malware creators. Download this white
paper to learn more about secure code signing practices that can help keep
Android apps secure.
http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk
--
_______________________________________________
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel

  reply	other threads:[~2013-11-04 17:26 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-04 13:57 [PATCH 0/2] Make the vmwgfx driver reasonably DMA-API compliant Thomas Hellstrom
2013-11-04 13:57 ` [PATCH 1/2] drm/ttm: Enable the dma page pool also for intel IOMMUs Thomas Hellstrom
2013-11-04 16:34   ` Konrad Rzeszutek Wilk
2013-11-04 20:36     ` Thomas Hellstrom
2013-11-04 13:57 ` [PATCH 2/2] drm/vmwgfx: Use the linux DMA api to get valid device addresses of pages Thomas Hellstrom
2013-11-04 16:27   ` Daniel Vetter
2013-11-04 17:26     ` Thomas Hellstrom [this message]
2013-11-04 16:40   ` Konrad Rzeszutek Wilk
2013-11-04 20:36     ` Thomas Hellstrom
2013-11-04 16:30 ` [PATCH 0/2] Make the vmwgfx driver reasonably DMA-API compliant Konrad Rzeszutek Wilk
2013-11-04 20:35   ` Thomas Hellstrom

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=5277D8B5.6080309@vmware.com \
    --to=thellstrom@vmware.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.sourceforge.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.