mirror of
https://gitlab.freedesktop.org/mesa/drm.git
synced 2026-05-05 05:28:03 +02:00
ttm: Fix uninitialized buffer object sizes.
Signed-off-by: Thomas Hellstrom <thellstrom-at-vmware-dot-com>
This commit is contained in:
parent
033d3a9f95
commit
871a640475
2 changed files with 9 additions and 1 deletions
|
|
@ -1384,6 +1384,14 @@ int ttm_bo_device_init(struct ttm_bo_device *bdev,
|
|||
printk(KERN_ERR "Could not register buffer object swapout.\n");
|
||||
goto out_err2;
|
||||
}
|
||||
|
||||
bdev->ttm_bo_extra_size =
|
||||
ttm_round_pot(sizeof(struct ttm_tt)) +
|
||||
ttm_round_pot(sizeof(struct ttm_backend));
|
||||
|
||||
bdev->ttm_bo_size = bdev->ttm_bo_extra_size +
|
||||
ttm_round_pot(sizeof(struct ttm_buffer_object));
|
||||
|
||||
return 0;
|
||||
out_err2:
|
||||
ttm_bo_clean_mm(bdev, 0);
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ static size_t ttm_pl_size(struct ttm_bo_device *bdev, unsigned long num_pages)
|
|||
ttm_round_pot(sizeof(struct ttm_bo_user_object));
|
||||
}
|
||||
|
||||
return bdev->ttm_bo_size + 2 * page_array_size;
|
||||
return pl_bo_size + 2 * page_array_size;
|
||||
}
|
||||
|
||||
static struct ttm_bo_user_object *ttm_bo_user_lookup(struct ttm_object_file
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue