drm/vmwgfx: free bo resource before assigning new one
Subsystems (3)
PATCH 1/1 drm/vmwgfx: free bo resource before assigning new one
ttm_bo_assign_mem() expects bo->resource to be free.
--- drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c +1 -0
@@ -733,6 +733,7 @@ static int vmw_move(struct ttm_buffer_object *bo,if (old_man->use_tt && new_man->use_tt) {if (bo->resource->mem_type ==TTM_PL_SYSTEM ) { +ttm_resource_free (bo, &bo->resource);ttm_bo_assign_mem (bo, new_mem);return 0 ; }
Signature · 1 line
2.31.1
Am 08.06.21 um 17:09 schrieb Nirmoy Das:
Quoted 13 lines
ttm_bo_assign_mem()expectsbo->resourceto be free.Fixes bfa3357ef9abc ("drm/ttm: allocate resource object instead of embedding it v2")Signed-off-by Nirmoy Das <[email protected]>--- drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c | 1 + 1 file changed, 1 insertion(+)drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c +0
-0
drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c static int vmw_move(struct ttm_buffer_object *bo, · line 737
Quoted 5 lines
drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c +1
-0@@ -733,6 +733,7 @@ static int vmw_move(struct ttm_buffer_object *bo,if (old_man->use_tt && new_man->use_tt) {if (bo->resource->mem_type ==TTM_PL_SYSTEM ) { +ttm_resource_free (bo, &bo->resource);ttm_bo_assign_mem (bo, new_mem);
On second thought we should probably use ttm_bo_move_null() instead here.
Christian.
Quoted 2 lines
drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c +0
-0return 0 ; }
Quoted 11 lines · Christian König
Am 08.06.21 um 17:09 schrieb Nirmoy Das:
Quoted 8 lines
ttm_bo_assign_mem()expectsbo->resourceto be free.Fixes bfa3357ef9abc ("drm/ttm: allocate resource object instead of embedding it v2")Signed-off-by Nirmoy Das <[email protected]>---
drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c| 1 +1 file changed, 1 insertion(+)
Quoted 11 lines
drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c static int vmw_move(struct ttm_buffer_object *bo, · line 736
Quoted 9 lines
drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c +1
-0@@ -733,6 +733,7 @@ static int vmw_move(struct ttm_buffer_object *bo, if (old_man->use_tt && new_man->use_tt) { if (bo->resource->mem_type == TTM_PL_SYSTEM) { + ttm_resource_free(bo, &bo->resource); ttm_bo_assign_mem(bo, new_mem);On second thought we should probably use
ttm_bo_move_null()instead here.
That reminds of https://patchwork.kernel.org/project/dri-devel/patch/[email protected]/ :)
Quoted 6 lines
Christian.
Quoted 2 lines
drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c +0
-0return 0; }
PATCH 1/1 drm/vmwgfx: free bo resource before assigning new one
In reply to Christian Königttm_bo_assign_mem() expects bo->resource to be free.
--- drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c +1 -0
@@ -733,6 +733,7 @@ static int vmw_move(struct ttm_buffer_object *bo,if (old_man->use_tt && new_man->use_tt) {if (bo->resource->mem_type ==TTM_PL_SYSTEM ) { +ttm_resource_free (bo, &bo->resource);ttm_bo_assign_mem (bo, new_mem);return 0 ; }
Signature · 1 line
2.31.1
Please ignore this, I wanted to send https://patchwork.kernel.org/project/dri-devel/patch/[email protected]/
after rebase.
Quoted 20 lines · Nirmoy Das
ttm_bo_assign_mem()expectsbo->resourceto be free.Fixes bfa3357ef9abc ("drm/ttm: allocate resource object instead of embedding it v2")Signed-off-by Nirmoy Das <[email protected]>--- drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c | 1 + 1 file changed, 1 insertion(+)drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c +1
-0@@ -733,6 +733,7 @@ static int vmw_move(struct ttm_buffer_object *bo,if (old_man->use_tt && new_man->use_tt) {if (bo->resource->mem_type ==TTM_PL_SYSTEM ) { +ttm_resource_free (bo, &bo->resource);ttm_bo_assign_mem (bo, new_mem);return 0 ; }
PATCH 1/1 drm/vmwgfx: use ttm_bo_move_null() when there is nothing to move
In reply to Christian KönigUse ttm_bo_move_null() instead of ttm_bo_assign_mem().
--- drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c +1 -1
@@ -733,7 +733,7 @@ static int vmw_move(struct ttm_buffer_object *bo,if (old_man->use_tt && new_man->use_tt) {if (bo->resource->mem_type ==TTM_PL_SYSTEM ) { -ttm_bo_assign_mem (bo, new_mem); +ttm_bo_move_null (bo, new_mem);return 0 ; } ret =ttm_bo_wait_ctx (bo, ctx);
Signature · 1 line
2.31.1
Re: [PATCH 1/1] drm/vmwgfx: use ttm_bo_move_null() when there is nothing to move
Am 08.06.21 um 20:13 schrieb Nirmoy Das:
Quoted 4 lines
Use
ttm_bo_move_null()instead ofttm_bo_assign_mem().Signed-off-by Nirmoy Das <[email protected]>Reviewed-by Christian König <[email protected]>
Looks like I've forgot to push that one. *sigh* I'm getting old.
Thanks,
Christian.
Quoted 17 lines
--- drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c +1
-1@@ -733,7 +733,7 @@ static int vmw_move(struct ttm_buffer_object *bo,if (old_man->use_tt && new_man->use_tt) {if (bo->resource->mem_type ==TTM_PL_SYSTEM ) { -ttm_bo_assign_mem (bo, new_mem); +ttm_bo_move_null (bo, new_mem);return 0 ; } ret =ttm_bo_wait_ctx (bo, ctx);
Re: [PATCH 1/1] drm/vmwgfx: use ttm_bo_move_null() when there is nothing to move
Quoted 7 lines · Christian König
Am 08.06.21 um 20:13 schrieb Nirmoy Das:
Quoted 4 lines
Use
ttm_bo_move_null()instead ofttm_bo_assign_mem().Signed-off-by Nirmoy Das <[email protected]>Reviewed-by Christian König <[email protected]>Looks like I've forgot to push that one. *sigh* I'm getting old.
Nah, you have too many stuff on your plate. I should've pinged.
Regards,
Nirmoy
Quoted 21 lines
Thanks,
Christian.Quoted 16 lines
---
drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c +1
-1@@ -733,7 +733,7 @@ static int vmw_move(struct ttm_buffer_object *bo, if (old_man->use_tt && new_man->use_tt) { if (bo->resource->mem_type == TTM_PL_SYSTEM) { - ttm_bo_assign_mem(bo, new_mem); + ttm_bo_move_null(bo, new_mem); return 0; } ret = ttm_bo_wait_ctx(bo, ctx);