Commit 8e46dc58 authored by Thomas Zimmermann's avatar Thomas Zimmermann

drm/ast: Use managed VRAM-helper initialization

As a first step to managed MM code in ast, switch over VRAM MM helpers.

v2:
	* updated to use drmm_vram_helper_init()
Signed-off-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: default avatarSam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200716125353.31512-4-tzimmermann@suse.de
parent 48fde424
...@@ -35,15 +35,12 @@ ...@@ -35,15 +35,12 @@
int ast_mm_init(struct ast_private *ast) int ast_mm_init(struct ast_private *ast)
{ {
struct drm_vram_mm *vmm;
int ret; int ret;
struct drm_device *dev = ast->dev; struct drm_device *dev = ast->dev;
vmm = drm_vram_helper_alloc_mm( ret = drmm_vram_helper_init(dev, pci_resource_start(dev->pdev, 0),
dev, pci_resource_start(dev->pdev, 0), ast->vram_size);
ast->vram_size); if (ret) {
if (IS_ERR(vmm)) {
ret = PTR_ERR(vmm);
drm_err(dev, "Error initializing VRAM MM; %d\n", ret); drm_err(dev, "Error initializing VRAM MM; %d\n", ret);
return ret; return ret;
} }
...@@ -60,8 +57,6 @@ void ast_mm_fini(struct ast_private *ast) ...@@ -60,8 +57,6 @@ void ast_mm_fini(struct ast_private *ast)
{ {
struct drm_device *dev = ast->dev; struct drm_device *dev = ast->dev;
drm_vram_helper_release_mm(dev);
arch_phys_wc_del(ast->fb_mtrr); arch_phys_wc_del(ast->fb_mtrr);
arch_io_free_memtype_wc(pci_resource_start(dev->pdev, 0), arch_io_free_memtype_wc(pci_resource_start(dev->pdev, 0),
pci_resource_len(dev->pdev, 0)); pci_resource_len(dev->pdev, 0));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment