diff options
author | Christian König <ckoenig.leichtzumerken@gmail.com> | 2017-11-24 05:32:59 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-12-06 12:48:03 -0500 |
commit | 3f3a7c8259312084291859d3b623db4317365a07 (patch) | |
tree | 75da1aee279a8fc3fe58cd99b8b5efbc4e300ece | |
parent | 6cd2e71e897f423412c6d5d0d1190341935d36b5 (diff) |
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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r-- | drivers/staging/vboxvideo/vbox_ttm.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/drivers/staging/vboxvideo/vbox_ttm.c b/drivers/staging/vboxvideo/vbox_ttm.c index 4eb410a2a1a8..231c89e0699c 100644 --- a/drivers/staging/vboxvideo/vbox_ttm.c +++ b/drivers/staging/vboxvideo/vbox_ttm.c | |||
@@ -183,13 +183,6 @@ static void vbox_ttm_io_mem_free(struct ttm_bo_device *bdev, | |||
183 | { | 183 | { |
184 | } | 184 | } |
185 | 185 | ||
186 | static int vbox_bo_move(struct ttm_buffer_object *bo, | ||
187 | bool evict, bool interruptible, | ||
188 | bool no_wait_gpu, struct ttm_mem_reg *new_mem) | ||
189 | { | ||
190 | return ttm_bo_move_memcpy(bo, interruptible, no_wait_gpu, new_mem); | ||
191 | } | ||
192 | |||
193 | static void vbox_ttm_backend_destroy(struct ttm_tt *tt) | 186 | static void vbox_ttm_backend_destroy(struct ttm_tt *tt) |
194 | { | 187 | { |
195 | ttm_tt_fini(tt); | 188 | ttm_tt_fini(tt); |
@@ -237,7 +230,6 @@ static struct ttm_bo_driver vbox_bo_driver = { | |||
237 | .init_mem_type = vbox_bo_init_mem_type, | 230 | .init_mem_type = vbox_bo_init_mem_type, |
238 | .eviction_valuable = ttm_bo_eviction_valuable, | 231 | .eviction_valuable = ttm_bo_eviction_valuable, |
239 | .evict_flags = vbox_bo_evict_flags, | 232 | .evict_flags = vbox_bo_evict_flags, |
240 | .move = vbox_bo_move, | ||
241 | .verify_access = vbox_bo_verify_access, | 233 | .verify_access = vbox_bo_verify_access, |
242 | .io_mem_reserve = &vbox_ttm_io_mem_reserve, | 234 | .io_mem_reserve = &vbox_ttm_io_mem_reserve, |
243 | .io_mem_free = &vbox_ttm_io_mem_free, | 235 | .io_mem_free = &vbox_ttm_io_mem_free, |
@@ -374,6 +366,7 @@ static inline u64 vbox_bo_gpu_offset(struct vbox_bo *bo) | |||
374 | 366 | ||
375 | int vbox_bo_pin(struct vbox_bo *bo, u32 pl_flag, u64 *gpu_addr) | 367 | int vbox_bo_pin(struct vbox_bo *bo, u32 pl_flag, u64 *gpu_addr) |
376 | { | 368 | { |
369 | struct ttm_operation_ctx ctx = { false, false }; | ||
377 | int i, ret; | 370 | int i, ret; |
378 | 371 | ||
379 | if (bo->pin_count) { | 372 | if (bo->pin_count) { |
@@ -389,7 +382,7 @@ int vbox_bo_pin(struct vbox_bo *bo, u32 pl_flag, u64 *gpu_addr) | |||
389 | for (i = 0; i < bo->placement.num_placement; i++) | 382 | for (i = 0; i < bo->placement.num_placement; i++) |
390 | bo->placements[i].flags |= TTM_PL_FLAG_NO_EVICT; | 383 | bo->placements[i].flags |= TTM_PL_FLAG_NO_EVICT; |
391 | 384 | ||
392 | ret = ttm_bo_validate(&bo->bo, &bo->placement, false, false); | 385 | ret = ttm_bo_validate(&bo->bo, &bo->placement, &ctx); |
393 | if (ret) | 386 | if (ret) |
394 | return ret; | 387 | return ret; |
395 | 388 | ||
@@ -403,6 +396,7 @@ int vbox_bo_pin(struct vbox_bo *bo, u32 pl_flag, u64 *gpu_addr) | |||
403 | 396 | ||
404 | int vbox_bo_unpin(struct vbox_bo *bo) | 397 | int vbox_bo_unpin(struct vbox_bo *bo) |
405 | { | 398 | { |
399 | struct ttm_operation_ctx ctx = { false, false }; | ||
406 | int i, ret; | 400 | int i, ret; |
407 | 401 | ||
408 | if (!bo->pin_count) { | 402 | if (!bo->pin_count) { |
@@ -416,7 +410,7 @@ int vbox_bo_unpin(struct vbox_bo *bo) | |||
416 | for (i = 0; i < bo->placement.num_placement; i++) | 410 | for (i = 0; i < bo->placement.num_placement; i++) |
417 | bo->placements[i].flags &= ~TTM_PL_FLAG_NO_EVICT; | 411 | bo->placements[i].flags &= ~TTM_PL_FLAG_NO_EVICT; |
418 | 412 | ||
419 | ret = ttm_bo_validate(&bo->bo, &bo->placement, false, false); | 413 | ret = ttm_bo_validate(&bo->bo, &bo->placement, &ctx); |
420 | if (ret) | 414 | if (ret) |
421 | return ret; | 415 | return ret; |
422 | 416 | ||
@@ -430,6 +424,7 @@ int vbox_bo_unpin(struct vbox_bo *bo) | |||
430 | */ | 424 | */ |
431 | int vbox_bo_push_sysram(struct vbox_bo *bo) | 425 | int vbox_bo_push_sysram(struct vbox_bo *bo) |
432 | { | 426 | { |
427 | struct ttm_operation_ctx ctx = { false, false }; | ||
433 | int i, ret; | 428 | int i, ret; |
434 | 429 | ||
435 | if (!bo->pin_count) { | 430 | if (!bo->pin_count) { |
@@ -448,7 +443,7 @@ int vbox_bo_push_sysram(struct vbox_bo *bo) | |||
448 | for (i = 0; i < bo->placement.num_placement; i++) | 443 | for (i = 0; i < bo->placement.num_placement; i++) |
449 | bo->placements[i].flags |= TTM_PL_FLAG_NO_EVICT; | 444 | bo->placements[i].flags |= TTM_PL_FLAG_NO_EVICT; |
450 | 445 | ||
451 | ret = ttm_bo_validate(&bo->bo, &bo->placement, false, false); | 446 | ret = ttm_bo_validate(&bo->bo, &bo->placement, &ctx); |
452 | if (ret) { | 447 | if (ret) { |
453 | DRM_ERROR("pushing to VRAM failed\n"); | 448 | DRM_ERROR("pushing to VRAM failed\n"); |
454 | return ret; | 449 | return ret; |