Skip to contentSkip to conversation

drm/vboxvideo: Use managed VRAM-helper initialization

PATCH In review Tian Tao 3 participants 4 messages Mar 3, 2021 – Mar 11, 2021

Subsystems (3)
lore
Share & tools
lore

Tian Tao

author
#0 lore raw

PATCH 1/1 drm/vboxvideo: Use managed VRAM-helper initialization

updated to use drmm_vram_helper_init().

---
 drivers/gpu/drm/vboxvideo/vbox_ttm.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/gpu/drm/vboxvideo/vbox_ttm.c +2 -5
index 0066a3c..fd8a53a 100644
@@ -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);
 }
Signature · 6 lines
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#1 lore raw
Quoted 3 lines · Tian Tao

updated to use drmm_vram_helper_init().

Hans, do you plan to pick this up?
-Daniel

Quoted 35 lines
---
 drivers/gpu/drm/vboxvideo/vbox_ttm.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/gpu/drm/vboxvideo/vbox_ttm.c +2 -5
index 0066a3c..fd8a53a 100644
@@ -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);
 }
Signature · 1 line
2.7.4
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by
#2 lore raw

Hi,

Quoted 6 lines · Daniel Vetter
Quoted 3 lines · Tian Tao

updated to use drmm_vram_helper_init().

Hans, do you plan to pick this up?

The drm patch-workflow falls outside my daily kernel-work workflow, so it is always a bit of a task-switch for me to switch to dealing with the "dim" workflow. ATM I don't have any other drm work pending, so I would appreciate it if someone else can pick this up.

The change does look good to me:

Regards,

Hans

Quoted 29 lines

-Daniel

Quoted 27 lines
---
 drivers/gpu/drm/vboxvideo/vbox_ttm.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/gpu/drm/vboxvideo/vbox_ttm.c +2 -4
index 0066a3c..fd8a53a 100644
@@ -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)
Quoted 9 lines
Quoted 8 lines
drivers/gpu/drm/vboxvideo/vbox_ttm.c +0 -1
 void vbox_mm_fini(struct vbox_private *vbox)
 {
 	arch_phys_wc_del(vbox->fb_mtrr);
-	drm_vram_helper_release_mm(&vbox->ddev);
 }
Signature · 1 line
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#3 lore raw
Quoted 10 lines · Hans de Goede

Hi,

Quoted 6 lines · Daniel Vetter
Quoted 3 lines · Tian Tao

updated to use drmm_vram_helper_init().

Hans, do you plan to pick this up?

Quoted 8 lines

The drm patch-workflow falls outside my daily kernel-work workflow, so it is always a bit of a task-switch for me to switch to dealing with the "dim" workflow. ATM I don't have any other drm work pending, so I would appreciate it if someone else can pick this up.

The change does look good to me:

I'll push, thanks for reviewing.
-Daniel

Quoted 46 lines

Regards,

Hans

Quoted 38 lines

-Daniel

Quoted 35 lines
---
 drivers/gpu/drm/vboxvideo/vbox_ttm.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/gpu/drm/vboxvideo/vbox_ttm.c +2 -5
index 0066a3c..fd8a53a 100644
@@ -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);
 }
Signature · 1 line
2.7.4
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel