mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: dri-devel@lists.freedesktop.org
Cc: Gerd Hoffmann <kraxel@redhat.com>,
	VMware Graphics <linux-graphics-maintainer@vmware.com>,
	Thomas Hellstrom <thellstrom@vmware.com>,
	David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
	linux-kernel@vger.kernel.org (open list)
Subject: [PATCH 7/8] drm/vmwgfx: switch to own vma manager
Date: Thu,  5 Sep 2019 09:05:08 +0200	[thread overview]
Message-ID: <20190905070509.22407-8-kraxel@redhat.com> (raw)
In-Reply-To: <20190905070509.22407-1-kraxel@redhat.com>

Add struct drm_vma_offset_manager to vma_private, initialize it and
pass it to ttm_bo_device_init().

With this in place the last user of ttm's embedded vma offset manager
is gone and we can remove it (in a separate patch).

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | 1 +
 drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 6 +++++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
index dbb04dbcf478..adb0436528c7 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
@@ -420,6 +420,7 @@ struct vmw_private {
 	struct vmw_fifo_state fifo;
 
 	struct drm_device *dev;
+	struct drm_vma_offset_manager vma_manager;
 	unsigned long vmw_chipset;
 	unsigned int io_start;
 	uint32_t vram_start;
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
index 20bc91214e75..882facd055de 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
@@ -827,10 +827,13 @@ static int vmw_driver_load(struct drm_device *dev, unsigned long chipset)
 		goto out_no_fman;
 	}
 
+	drm_vma_offset_manager_init(&dev_priv->vma_manager,
+				    DRM_FILE_PAGE_OFFSET_START,
+				    DRM_FILE_PAGE_OFFSET_SIZE);
 	ret = ttm_bo_device_init(&dev_priv->bdev,
 				 &vmw_bo_driver,
 				 dev->anon_inode->i_mapping,
-				 NULL,
+				 &dev_priv->vma_manager,
 				 false);
 	if (unlikely(ret != 0)) {
 		DRM_ERROR("Failed initializing TTM buffer object driver.\n");
@@ -987,6 +990,7 @@ static void vmw_driver_unload(struct drm_device *dev)
 	if (dev_priv->has_mob)
 		(void) ttm_bo_clean_mm(&dev_priv->bdev, VMW_PL_MOB);
 	(void) ttm_bo_device_release(&dev_priv->bdev);
+	drm_vma_offset_manager_destroy(&dev_priv->vma_manager);
 	vmw_release_device_late(dev_priv);
 	vmw_fence_manager_takedown(dev_priv->fman);
 	if (dev_priv->capabilities & SVGA_CAP_IRQMASK)
-- 
2.18.1


  parent reply	other threads:[~2019-09-05  7:05 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20190905070509.22407-1-kraxel@redhat.com>
2019-09-05  7:05 ` [PATCH 1/8] drm/ttm: turn ttm_bo_device.vma_manager into a pointer Gerd Hoffmann
2019-09-09  6:59   ` Christian König
2019-09-05  7:05 ` [PATCH 2/8] drm/nouveau: switch to gem vma offset manager Gerd Hoffmann
2019-09-05  7:05 ` [PATCH 3/8] drm/vram: " Gerd Hoffmann
2019-09-09  7:11   ` Thomas Zimmermann
2019-09-05  7:05 ` [PATCH 4/8] drm/radeon: " Gerd Hoffmann
2019-09-05  7:05 ` [PATCH 5/8] drm/amdgpu: " Gerd Hoffmann
2019-09-05  7:05 ` [PATCH 6/8] drm/qxl: " Gerd Hoffmann
2019-09-05  7:05 ` Gerd Hoffmann [this message]
2019-09-05  8:31   ` [PATCH 7/8] drm/vmwgfx: switch to own vma manager Thomas Hellstrom
2019-09-05  9:31     ` kraxel
2019-09-05  7:05 ` [PATCH 8/8] drm/ttm: remove embedded vma_offset_manager Gerd Hoffmann
2019-09-09  7:02   ` Koenig, Christian
2019-09-09  9:43     ` Gerd Hoffmann

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=20190905070509.22407-8-kraxel@redhat.com \
    --to=kraxel@redhat.com \
    --cc=airlied@linux.ie \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-graphics-maintainer@vmware.com \
    --cc=linux-kernel@vger.kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®