Skip to contentSkip to conversation

drm/radeon: do not try to uselessly update virtual memory pagetable

PATCH In review [email protected] 2 participants 2 messages Jun 6, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/radeon: do not try to uselessly update virtual memory pagetable

From: Jerome Glisse <[email protected]>

If a buffer is never bind to a virtual memory pagetable than don't try to unbind it. Only drawback is that we don't update the pagetable when unbinding the ib pool buffer which is fine because it only happens at suspend or module unload/shutdown.

---
 drivers/gpu/drm/radeon/radeon_gart.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/radeon/radeon_gart.c +4 -2
index 6e24f84..daf9710 100644
@@ -1209,11 +1209,13 @@ int radeon_vm_bo_update_pte(struct radeon_device *rdev,
 int radeon_vm_bo_rmv(struct radeon_device *rdev,
 		     struct radeon_bo_va *bo_va)
 {
-	int r;
+	int r = 0;
 
 	mutex_lock(&rdev->vm_manager.lock);
 	mutex_lock(&bo_va->vm->mutex);
-	r = radeon_vm_bo_update_pte(rdev, bo_va->vm, bo_va->bo, NULL);
+	if (bo_va->soffset) {
+		r = radeon_vm_bo_update_pte(rdev, bo_va->vm, bo_va->bo, NULL);
+	}
 	mutex_unlock(&rdev->vm_manager.lock);
 	list_del(&bo_va->vm_list);
 	mutex_unlock(&bo_va->vm->mutex);
Signature · 1 line
1.7.11.7
#1 lore raw
Quoted 6 lines · On Thu, Jun 6, 2013 at 12:41 PM, <[email protected]> wrote:

From: Jerome Glisse <[email protected]>

If a buffer is never bind to a virtual memory pagetable than don't try to unbind it. Only drawback is that we don't update the pagetable when unbinding the ib pool buffer which is fine because it only happens at suspend or module unload/shutdown.

Applied with a note about fixing spurious messages.

Alex

Quoted 34 lines
---
 drivers/gpu/drm/radeon/radeon_gart.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/radeon/radeon_gart.c +4 -3
index 6e24f84..daf9710 100644
@@ -1209,11 +1209,13 @@ int radeon_vm_bo_update_pte(struct radeon_device *rdev,
 int radeon_vm_bo_rmv(struct radeon_device *rdev,
                     struct radeon_bo_va *bo_va)
 {
-       int r;
+       int r = 0;
 
        mutex_lock(&rdev->vm_manager.lock);
        mutex_lock(&bo_va->vm->mutex);
-       r = radeon_vm_bo_update_pte(rdev, bo_va->vm, bo_va->bo, NULL);
+       if (bo_va->soffset) {
+               r = radeon_vm_bo_update_pte(rdev, bo_va->vm, bo_va->bo, NULL);
+       }
        mutex_unlock(&rdev->vm_manager.lock);
        list_del(&bo_va->vm_list);
        mutex_unlock(&bo_va->vm->mutex);
--

1.7.11.7

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