Commit 429fc6f9 authored by Tian Tao's avatar Tian Tao Committed by Daniel Vetter

drm/vboxvideo: Use managed VRAM-helper initialization

updated to use drmm_vram_helper_init().
Signed-off-by: default avatarTian Tao <tiantao6@hisilicon.com>
Reviewed-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/1614735587-6621-1-git-send-email-tiantao6@hisilicon.com
parent b603e810
......@@ -12,15 +12,13 @@
int vbox_mm_init(struct vbox_private *vbox)
{
struct drm_vram_mm *vmm;
int ret;
struct drm_device *dev = &vbox->ddev;
struct pci_dev *pdev = to_pci_dev(dev->dev);
vmm = drm_vram_helper_alloc_mm(dev, pci_resource_start(pdev, 0),
ret = drmm_vram_helper_init(dev, pci_resource_start(pdev, 0),
vbox->available_vram_size);
if (IS_ERR(vmm)) {
ret = PTR_ERR(vmm);
if (ret) {
DRM_ERROR("Error initializing VRAM MM; %d\n", ret);
return ret;
}
......@@ -33,5 +31,4 @@ int vbox_mm_init(struct vbox_private *vbox)
void vbox_mm_fini(struct vbox_private *vbox)
{
arch_phys_wc_del(vbox->fb_mtrr);
drm_vram_helper_release_mm(&vbox->ddev);
}
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