Skip to contentSkip to conversation

drm/vmwgfx: free ttm resource before assigning a new one

PATCH In review Nirmoy Das 3 participants 3 messages May 3, 2021

Subsystems (3)
lore
Share & tools
lore

Nirmoy Das

author
#0 lore raw

PATCH 1/1 drm/vmwgfx: free ttm resource before assigning a new one

TTM BO resource need to be freed before calling ttm_bo_assign_mem().

---
 drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c +1 -0
index 2dc031fe4a90..93e4cf34a3a3 100644
@@ -738,6 +738,7 @@ static int vmw_move(struct ttm_buffer_object *bo,
 
 	if (old_man->use_tt && new_man->use_tt) {
 		if (bo->mem.mem_type == TTM_PL_SYSTEM) {
+			ttm_resource_free(bo, &bo->mem);
 			ttm_bo_assign_mem(bo, new_mem);
 			return 0;
 		}
Signature · 6 lines
2.31.1

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

Am 03.05.21 um 19:26 schrieb Nirmoy Das:

Quoted 12 lines

TTM BO resource need to be freed before calling ttm_bo_assign_mem().

---
  drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c | 1 +
  1 file changed, 1 insertion(+)
drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c +0 -0
index 2dc031fe4a90..93e4cf34a3a3 100644

drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c static int vmw_move(struct ttm_buffer_object *bo, · line 742

Quoted 5 lines
drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c +1 -0
@@ -738,6 +738,7 @@ static int vmw_move(struct ttm_buffer_object *bo,
 
  	if (old_man->use_tt && new_man->use_tt) {
  		if (bo->mem.mem_type == TTM_PL_SYSTEM) {
+			ttm_resource_free(bo, &bo->mem);
  			ttm_bo_assign_mem(bo, new_mem);

Mhm, we should probably rather call ttm_bo_move_null here like other drivers do.

Christian.

drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c static int vmw_move(struct ttm_buffer_object *bo, · line 744

Quoted 2 lines
drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c +0 -0
  			return 0;
  		}

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

#2 lore raw
Quoted 8 lines · Christian König

Am 03.05.21 um 19:26 schrieb Nirmoy Das:

Quoted 7 lines

TTM BO resource need to be freed before calling ttm_bo_assign_mem().

---
  drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c | 1 +

  1 file changed, 1 insertion(+)
Quoted 12 lines

drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c static int vmw_move(struct ttm_buffer_object *bo, · line 741

Quoted 9 lines
drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c +1 -0
index 2dc031fe4a90..93e4cf34a3a3 100644
@@ -738,6 +738,7 @@ static int vmw_move(struct ttm_buffer_object *bo,
         if (old_man->use_tt && new_man->use_tt) {
           if (bo->mem.mem_type == TTM_PL_SYSTEM) {
+            ttm_resource_free(bo, &bo->mem);
               ttm_bo_assign_mem(bo, new_mem);

Mhm, we should probably rather call ttm_bo_move_null here like other drivers do.

Thanks Christian, I will send a updated patch.

Nirmoy

Quoted 5 lines

Christian.

Quoted 2 lines
drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c +0 -0
               return 0;
           }

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