ttm_bo_assign_mem() expects bo->resource to be free. Fixes: bfa3357ef9abc ("drm/ttm: allocate resource object instead of embedding it v2")
Signed-off-by: Nirmoy Das nirmoy.das@amd.com --- drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c b/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c index bfcf31bf7e37..7281912436bb 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c @@ -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; }
Am 08.06.21 um 17:09 schrieb Nirmoy Das:
ttm_bo_assign_mem() expects bo->resource to be free. Fixes: bfa3357ef9abc ("drm/ttm: allocate resource object instead of embedding it v2")
Signed-off-by: Nirmoy Das nirmoy.das@amd.com
drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c b/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c index bfcf31bf7e37..7281912436bb 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c @@ -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.
return 0; }
On 6/8/2021 7:28 PM, Christian König wrote:
Am 08.06.21 um 17:09 schrieb Nirmoy Das:
ttm_bo_assign_mem() expects bo->resource to be free. Fixes: bfa3357ef9abc ("drm/ttm: allocate resource object instead of embedding it v2")
Signed-off-by: Nirmoy Das nirmoy.das@amd.com
drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c b/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c index bfcf31bf7e37..7281912436bb 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c @@ -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/20210503190013.91732-1-... :)
Christian.
return 0; }
ttm_bo_assign_mem() expects bo->resource to be free. Fixes: bfa3357ef9abc ("drm/ttm: allocate resource object instead of embedding it v2")
Signed-off-by: Nirmoy Das nirmoy.das@amd.com --- drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c b/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c index bfcf31bf7e37..7281912436bb 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c @@ -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; }
Please ignore this, I wanted to send https://patchwork.kernel.org/project/dri-devel/patch/20210503190013.91732-1-...
after rebase.
On 6/8/2021 8:01 PM, Nirmoy Das wrote:
ttm_bo_assign_mem() expects bo->resource to be free. Fixes: bfa3357ef9abc ("drm/ttm: allocate resource object instead of embedding it v2")
Signed-off-by: Nirmoy Das nirmoy.das@amd.com
drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c b/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c index bfcf31bf7e37..7281912436bb 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c @@ -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;
Use ttm_bo_move_null() instead of ttm_bo_assign_mem().
Signed-off-by: Nirmoy Das nirmoy.das@amd.com Reviewed-by: Christian König christian.koenig@amd.com --- drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c b/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c index bfcf31bf7e37..0488042fb287 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c @@ -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);
Am 08.06.21 um 20:13 schrieb Nirmoy Das:
Use ttm_bo_move_null() instead of ttm_bo_assign_mem().
Signed-off-by: Nirmoy Das nirmoy.das@amd.com Reviewed-by: Christian König christian.koenig@amd.com
Looks like I've forgot to push that one. *sigh* I'm getting old.
Thanks, Christian.
drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c b/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c index bfcf31bf7e37..0488042fb287 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c @@ -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);
} ret = ttm_bo_wait_ctx(bo, ctx);ttm_bo_move_null(bo, new_mem); return 0;
On 6/9/2021 8:38 AM, Christian König wrote:
Am 08.06.21 um 20:13 schrieb Nirmoy Das:
Use ttm_bo_move_null() instead of ttm_bo_assign_mem().
Signed-off-by: Nirmoy Das nirmoy.das@amd.com Reviewed-by: Christian König christian.koenig@amd.com
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
Thanks, Christian.
drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c b/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c index bfcf31bf7e37..0488042fb287 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c @@ -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);
dri-devel@lists.freedesktop.org