dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Hellstrom <thellstrom@vmware.com>
To: linux-graphics-maintainer@vmware.com, dri-devel@lists.freedesktop.org
Cc: Thomas Hellstrom <thellstrom@vmware.com>
Subject: [PATCH 2/2] drm/vmwgfx: Use ttm_dma_page_alloc_enabled
Date: Fri, 25 Jan 2019 14:05:48 +0100	[thread overview]
Message-ID: <20190125130548.3266-2-thellstrom@vmware.com> (raw)
In-Reply-To: <20190125130548.3266-1-thellstrom@vmware.com>

Instead of guessing whether TTM has the dma page allocator enabled,
ask TTM.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
---
 drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
index 77f422cd18ab..125a2b423847 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
@@ -35,6 +35,7 @@
 #include <drm/ttm/ttm_placement.h>
 #include <drm/ttm/ttm_bo_driver.h>
 #include <drm/ttm/ttm_module.h>
+#include <drm/ttm/ttm_page_alloc.h>
 
 #define VMWGFX_DRIVER_DESC "Linux drm driver for VMware graphics devices"
 #define VMWGFX_CHIP_SVGAII 0
@@ -594,8 +595,7 @@ static int vmw_dma_select_mode(struct vmw_private *dev_priv)
 	if (dev_priv->map_mode == vmw_dma_map_populate && vmw_restrict_iommu)
 		dev_priv->map_mode = vmw_dma_map_bind;
 
-	/* No TTM coherent page pool? FIXME: Ask TTM instead! */
-        if (!(IS_ENABLED(CONFIG_SWIOTLB) || IS_ENABLED(CONFIG_INTEL_IOMMU)) &&
+        if (!ttm_dma_page_alloc_enabled() &&
 	    (dev_priv->map_mode == vmw_dma_alloc_coherent))
 		return -EINVAL;
 
-- 
2.19.0.rc1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2019-01-25 13:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-25 13:05 [PATCH 1/2] drm/ttm: Implement and export ttm_dma_page_alloc_enabled Thomas Hellstrom
2019-01-25 13:05 ` Thomas Hellstrom [this message]
2019-01-25 18:22   ` [PATCH 2/2] drm/vmwgfx: Use ttm_dma_page_alloc_enabled Sam Ravnborg
2019-01-30  8:37     ` Thomas Hellstrom
2019-01-28 12:21 ` [PATCH 1/2] drm/ttm: Implement and export ttm_dma_page_alloc_enabled Koenig, Christian
2019-01-28 13:29   ` Thomas Hellstrom
2019-01-28 14:21     ` Thomas Hellstrom
2019-01-28 15:56       ` Koenig, Christian

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=20190125130548.3266-2-thellstrom@vmware.com \
    --to=thellstrom@vmware.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-graphics-maintainer@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox