diff options
author | Thomas Zimmermann <tzimmermann@suse.de> | 2019-05-08 10:26:25 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2019-05-15 16:17:08 +0200 |
commit | 94668ac796a5de8864bfc1a34edd24f81f3e6a2c (patch) | |
tree | 6ac4d8bae4513e35c816f311de9af6dd51a5b0ea /drivers/gpu/drm/mgag200/mgag200_main.c | |
parent | ebb04eb36f9cbb6255594f0f88b11cb5b60bce98 (diff) | |
download | linux-94668ac796a5de8864bfc1a34edd24f81f3e6a2c.tar.bz2 |
drm/mgag200: Convert mgag200 driver to VRAM MM
The data structure |struct drm_vram_mm| and its helpers replace mgag200's
TTM-based memory manager. It's the same implementation; except for the type
names.
v4:
* don't select DRM_TTM or DRM_VRAM_MM_HELPER
v3:
* use drm_gem_vram_mm_funcs
* convert driver to drm_device-based instance
v2:
* implement mgag200_mmap() with drm_vram_mm_mmap()
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: http://patchwork.freedesktop.org/patch/msgid/20190508082630.15116-16-tzimmermann@suse.de
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/mgag200/mgag200_main.c')
-rw-r--r-- | drivers/gpu/drm/mgag200/mgag200_main.c | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/drivers/gpu/drm/mgag200/mgag200_main.c b/drivers/gpu/drm/mgag200/mgag200_main.c index 59a4028a5c6c..f3687fed4075 100644 --- a/drivers/gpu/drm/mgag200/mgag200_main.c +++ b/drivers/gpu/drm/mgag200/mgag200_main.c @@ -230,10 +230,10 @@ int mgag200_driver_load(struct drm_device *dev, unsigned long flags) } /* Make small buffers to store a hardware cursor (double buffered icon updates) */ - mdev->cursor.pixels_1 = drm_gem_vram_create(dev, &mdev->ttm.bdev, + mdev->cursor.pixels_1 = drm_gem_vram_create(dev, &dev->vram_mm->bdev, roundup(48*64, PAGE_SIZE), 0, 0); - mdev->cursor.pixels_2 = drm_gem_vram_create(dev, &mdev->ttm.bdev, + mdev->cursor.pixels_2 = drm_gem_vram_create(dev, &dev->vram_mm->bdev, roundup(48*64, PAGE_SIZE), 0, 0); if (IS_ERR(mdev->cursor.pixels_2) || IS_ERR(mdev->cursor.pixels_1)) { @@ -274,7 +274,6 @@ int mgag200_gem_create(struct drm_device *dev, u32 size, bool iskernel, struct drm_gem_object **obj) { - struct mga_device *mdev = dev->dev_private; struct drm_gem_vram_object *gbo; int ret; @@ -284,7 +283,7 @@ int mgag200_gem_create(struct drm_device *dev, if (size == 0) return -EINVAL; - gbo = drm_gem_vram_create(dev, &mdev->ttm.bdev, size, 0, false); + gbo = drm_gem_vram_create(dev, &dev->vram_mm->bdev, size, 0, false); if (IS_ERR(gbo)) { ret = PTR_ERR(gbo); if (ret != -ERESTARTSYS) @@ -294,13 +293,3 @@ int mgag200_gem_create(struct drm_device *dev, *obj = &gbo->gem; return 0; } - -int mgag200_dumb_create(struct drm_file *file, - struct drm_device *dev, - struct drm_mode_create_dumb *args) -{ - struct mga_device *mdev = dev->dev_private; - - return drm_gem_vram_fill_create_dumb(file, dev, &mdev->ttm.bdev, 0, - false, args); -} |