drm/ttm: always initialize the full ttm_resource v2
[linux-2.6-block.git] / drivers / gpu / drm / ttm / ttm_bo_util.c
index efb7e9c34ab4d8725868cf23633cd8df06eaa6a5..ae8b614607245cae43e6299d2aef1ae72f8f2c71 100644 (file)
@@ -664,6 +664,7 @@ EXPORT_SYMBOL(ttm_bo_move_accel_cleanup);
 
 int ttm_bo_pipeline_gutting(struct ttm_buffer_object *bo)
 {
+       static const struct ttm_place sys_mem = { .mem_type = TTM_PL_SYSTEM };
        struct ttm_buffer_object *ghost;
        int ret;
 
@@ -676,8 +677,7 @@ int ttm_bo_pipeline_gutting(struct ttm_buffer_object *bo)
        if (ret)
                ttm_bo_wait(bo, false, false);
 
-       memset(&bo->mem, 0, sizeof(bo->mem));
-       bo->mem.mem_type = TTM_PL_SYSTEM;
+       ttm_resource_alloc(bo, &sys_mem, &bo->mem);
        bo->ttm = NULL;
 
        dma_resv_unlock(&ghost->base._resv);