Commit 3f3a7c82 authored by Christian König's avatar Christian König Committed by Alex Deucher

staging: vboxvideo: adapt to new TTM interface

Fixes interface changes done in the following commits:
drm/ttm: add operation ctx to ttm_bo_validate v2
drm/ttm: add context to driver move callback as well

I missed this driver because it is in the staging area.
Acked-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
Reviewed-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 6cd2e71e
...@@ -183,13 +183,6 @@ static void vbox_ttm_io_mem_free(struct ttm_bo_device *bdev, ...@@ -183,13 +183,6 @@ static void vbox_ttm_io_mem_free(struct ttm_bo_device *bdev,
{ {
} }
static int vbox_bo_move(struct ttm_buffer_object *bo,
bool evict, bool interruptible,
bool no_wait_gpu, struct ttm_mem_reg *new_mem)
{
return ttm_bo_move_memcpy(bo, interruptible, no_wait_gpu, new_mem);
}
static void vbox_ttm_backend_destroy(struct ttm_tt *tt) static void vbox_ttm_backend_destroy(struct ttm_tt *tt)
{ {
ttm_tt_fini(tt); ttm_tt_fini(tt);
...@@ -237,7 +230,6 @@ static struct ttm_bo_driver vbox_bo_driver = { ...@@ -237,7 +230,6 @@ static struct ttm_bo_driver vbox_bo_driver = {
.init_mem_type = vbox_bo_init_mem_type, .init_mem_type = vbox_bo_init_mem_type,
.eviction_valuable = ttm_bo_eviction_valuable, .eviction_valuable = ttm_bo_eviction_valuable,
.evict_flags = vbox_bo_evict_flags, .evict_flags = vbox_bo_evict_flags,
.move = vbox_bo_move,
.verify_access = vbox_bo_verify_access, .verify_access = vbox_bo_verify_access,
.io_mem_reserve = &vbox_ttm_io_mem_reserve, .io_mem_reserve = &vbox_ttm_io_mem_reserve,
.io_mem_free = &vbox_ttm_io_mem_free, .io_mem_free = &vbox_ttm_io_mem_free,
...@@ -374,6 +366,7 @@ static inline u64 vbox_bo_gpu_offset(struct vbox_bo *bo) ...@@ -374,6 +366,7 @@ static inline u64 vbox_bo_gpu_offset(struct vbox_bo *bo)
int vbox_bo_pin(struct vbox_bo *bo, u32 pl_flag, u64 *gpu_addr) int vbox_bo_pin(struct vbox_bo *bo, u32 pl_flag, u64 *gpu_addr)
{ {
struct ttm_operation_ctx ctx = { false, false };
int i, ret; int i, ret;
if (bo->pin_count) { if (bo->pin_count) {
...@@ -389,7 +382,7 @@ int vbox_bo_pin(struct vbox_bo *bo, u32 pl_flag, u64 *gpu_addr) ...@@ -389,7 +382,7 @@ int vbox_bo_pin(struct vbox_bo *bo, u32 pl_flag, u64 *gpu_addr)
for (i = 0; i < bo->placement.num_placement; i++) for (i = 0; i < bo->placement.num_placement; i++)
bo->placements[i].flags |= TTM_PL_FLAG_NO_EVICT; bo->placements[i].flags |= TTM_PL_FLAG_NO_EVICT;
ret = ttm_bo_validate(&bo->bo, &bo->placement, false, false); ret = ttm_bo_validate(&bo->bo, &bo->placement, &ctx);
if (ret) if (ret)
return ret; return ret;
...@@ -403,6 +396,7 @@ int vbox_bo_pin(struct vbox_bo *bo, u32 pl_flag, u64 *gpu_addr) ...@@ -403,6 +396,7 @@ int vbox_bo_pin(struct vbox_bo *bo, u32 pl_flag, u64 *gpu_addr)
int vbox_bo_unpin(struct vbox_bo *bo) int vbox_bo_unpin(struct vbox_bo *bo)
{ {
struct ttm_operation_ctx ctx = { false, false };
int i, ret; int i, ret;
if (!bo->pin_count) { if (!bo->pin_count) {
...@@ -416,7 +410,7 @@ int vbox_bo_unpin(struct vbox_bo *bo) ...@@ -416,7 +410,7 @@ int vbox_bo_unpin(struct vbox_bo *bo)
for (i = 0; i < bo->placement.num_placement; i++) for (i = 0; i < bo->placement.num_placement; i++)
bo->placements[i].flags &= ~TTM_PL_FLAG_NO_EVICT; bo->placements[i].flags &= ~TTM_PL_FLAG_NO_EVICT;
ret = ttm_bo_validate(&bo->bo, &bo->placement, false, false); ret = ttm_bo_validate(&bo->bo, &bo->placement, &ctx);
if (ret) if (ret)
return ret; return ret;
...@@ -430,6 +424,7 @@ int vbox_bo_unpin(struct vbox_bo *bo) ...@@ -430,6 +424,7 @@ int vbox_bo_unpin(struct vbox_bo *bo)
*/ */
int vbox_bo_push_sysram(struct vbox_bo *bo) int vbox_bo_push_sysram(struct vbox_bo *bo)
{ {
struct ttm_operation_ctx ctx = { false, false };
int i, ret; int i, ret;
if (!bo->pin_count) { if (!bo->pin_count) {
...@@ -448,7 +443,7 @@ int vbox_bo_push_sysram(struct vbox_bo *bo) ...@@ -448,7 +443,7 @@ int vbox_bo_push_sysram(struct vbox_bo *bo)
for (i = 0; i < bo->placement.num_placement; i++) for (i = 0; i < bo->placement.num_placement; i++)
bo->placements[i].flags |= TTM_PL_FLAG_NO_EVICT; bo->placements[i].flags |= TTM_PL_FLAG_NO_EVICT;
ret = ttm_bo_validate(&bo->bo, &bo->placement, false, false); ret = ttm_bo_validate(&bo->bo, &bo->placement, &ctx);
if (ret) { if (ret) {
DRM_ERROR("pushing to VRAM failed\n"); DRM_ERROR("pushing to VRAM failed\n");
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment