From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Thomas Hellstrom <thellstrom@vmware.com>
Cc: dri-devel@lists.sourceforge.net
Subject: Re: [PATCH 1/2] drm/ttm: Enable the dma page pool also for intel IOMMUs
Date: Mon, 4 Nov 2013 11:34:45 -0500 [thread overview]
Message-ID: <20131104163445.GD6833@phenom.dumpdata.com> (raw)
In-Reply-To: <1383573459-3522-2-git-send-email-thellstrom@vmware.com>
On Mon, Nov 04, 2013 at 05:57:38AM -0800, Thomas Hellstrom wrote:
> Used by the vmwgfx driver
That looks OK to me. And baremetal should not be
affected as the Intel VT-d driver turns of the SWIOTLB
driver - so it will still use the classic ttm pool code.
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
>
> Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
> Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
> ---
> drivers/gpu/drm/ttm/Makefile | 6 +-----
> drivers/gpu/drm/ttm/ttm_page_alloc_dma.c | 3 +++
> include/drm/ttm/ttm_page_alloc.h | 11 ++++++++++-
> 3 files changed, 14 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/ttm/Makefile b/drivers/gpu/drm/ttm/Makefile
> index b2b33dd..b433b9f 100644
> --- a/drivers/gpu/drm/ttm/Makefile
> +++ b/drivers/gpu/drm/ttm/Makefile
> @@ -5,10 +5,6 @@ ccflags-y := -Iinclude/drm
> ttm-y := ttm_agp_backend.o ttm_memory.o ttm_tt.o ttm_bo.o \
> ttm_bo_util.o ttm_bo_vm.o ttm_module.o \
> ttm_object.o ttm_lock.o ttm_execbuf_util.o ttm_page_alloc.o \
> - ttm_bo_manager.o
> -
> -ifeq ($(CONFIG_SWIOTLB),y)
> -ttm-y += ttm_page_alloc_dma.o
> -endif
> + ttm_bo_manager.o ttm_page_alloc_dma.o
>
> obj-$(CONFIG_DRM_TTM) += ttm.o
> diff --git a/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c b/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c
> index 7957bee..fb8259f 100644
> --- a/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c
> +++ b/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c
> @@ -33,6 +33,7 @@
> * when freed).
> */
>
> +#if defined(CONFIG_SWIOTLB) || defined(CONFIG_INTEL_IOMMU)
> #define pr_fmt(fmt) "[TTM] " fmt
>
> #include <linux/dma-mapping.h>
> @@ -1142,3 +1143,5 @@ int ttm_dma_page_alloc_debugfs(struct seq_file *m, void *data)
> return 0;
> }
> EXPORT_SYMBOL_GPL(ttm_dma_page_alloc_debugfs);
> +
> +#endif
> diff --git a/include/drm/ttm/ttm_page_alloc.h b/include/drm/ttm/ttm_page_alloc.h
> index 706b962..d1f61bf 100644
> --- a/include/drm/ttm/ttm_page_alloc.h
> +++ b/include/drm/ttm/ttm_page_alloc.h
> @@ -62,7 +62,7 @@ extern void ttm_pool_unpopulate(struct ttm_tt *ttm);
> extern int ttm_page_alloc_debugfs(struct seq_file *m, void *data);
>
>
> -#ifdef CONFIG_SWIOTLB
> +#if defined(CONFIG_SWIOTLB) || defined(CONFIG_INTEL_IOMMU)
> /**
> * Initialize pool allocator.
> */
> @@ -94,6 +94,15 @@ static inline int ttm_dma_page_alloc_debugfs(struct seq_file *m, void *data)
> {
> return 0;
> }
> +static inline int ttm_dma_populate(struct ttm_dma_tt *ttm_dma,
> + struct device *dev)
> +{
> + return -ENOMEM;
> +}
> +static inline void ttm_dma_unpopulate(struct ttm_dma_tt *ttm_dma,
> + struct device *dev)
> +{
> +}
> #endif
>
> #endif
> --
> 1.7.10.4
------------------------------------------------------------------------------
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
--
_______________________________________________
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel
next prev parent reply other threads:[~2013-11-04 16:34 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 [this message]
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
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=20131104163445.GD6833@phenom.dumpdata.com \
--to=konrad.wilk@oracle.com \
--cc=dri-devel@lists.sourceforge.net \
--cc=thellstrom@vmware.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 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.