| .. | .. |
|---|
| 27 | 27 | **************************************************************************/ |
|---|
| 28 | 28 | |
|---|
| 29 | 29 | #include "vmwgfx_drv.h" |
|---|
| 30 | +#include <linux/highmem.h> |
|---|
| 30 | 31 | |
|---|
| 31 | 32 | /* |
|---|
| 32 | 33 | * Template that implements find_first_diff() for a generic |
|---|
| .. | .. |
|---|
| 374 | 375 | copy_size = min_t(u32, copy_size, PAGE_SIZE - src_page_offset); |
|---|
| 375 | 376 | |
|---|
| 376 | 377 | if (unmap_src) { |
|---|
| 377 | | - ttm_kunmap_atomic_prot(d->src_addr, d->src_prot); |
|---|
| 378 | + kunmap_atomic(d->src_addr); |
|---|
| 378 | 379 | d->src_addr = NULL; |
|---|
| 379 | 380 | } |
|---|
| 380 | 381 | |
|---|
| 381 | 382 | if (unmap_dst) { |
|---|
| 382 | | - ttm_kunmap_atomic_prot(d->dst_addr, d->dst_prot); |
|---|
| 383 | + kunmap_atomic(d->dst_addr); |
|---|
| 383 | 384 | d->dst_addr = NULL; |
|---|
| 384 | 385 | } |
|---|
| 385 | 386 | |
|---|
| .. | .. |
|---|
| 388 | 389 | return -EINVAL; |
|---|
| 389 | 390 | |
|---|
| 390 | 391 | d->dst_addr = |
|---|
| 391 | | - ttm_kmap_atomic_prot(d->dst_pages[dst_page], |
|---|
| 392 | | - d->dst_prot); |
|---|
| 392 | + kmap_atomic_prot(d->dst_pages[dst_page], |
|---|
| 393 | + d->dst_prot); |
|---|
| 393 | 394 | if (!d->dst_addr) |
|---|
| 394 | 395 | return -ENOMEM; |
|---|
| 395 | 396 | |
|---|
| .. | .. |
|---|
| 401 | 402 | return -EINVAL; |
|---|
| 402 | 403 | |
|---|
| 403 | 404 | d->src_addr = |
|---|
| 404 | | - ttm_kmap_atomic_prot(d->src_pages[src_page], |
|---|
| 405 | | - d->src_prot); |
|---|
| 405 | + kmap_atomic_prot(d->src_pages[src_page], |
|---|
| 406 | + d->src_prot); |
|---|
| 406 | 407 | if (!d->src_addr) |
|---|
| 407 | 408 | return -ENOMEM; |
|---|
| 408 | 409 | |
|---|
| .. | .. |
|---|
| 459 | 460 | |
|---|
| 460 | 461 | /* Buffer objects need to be either pinned or reserved: */ |
|---|
| 461 | 462 | if (!(dst->mem.placement & TTM_PL_FLAG_NO_EVICT)) |
|---|
| 462 | | - lockdep_assert_held(&dst->resv->lock.base); |
|---|
| 463 | + dma_resv_assert_held(dst->base.resv); |
|---|
| 463 | 464 | if (!(src->mem.placement & TTM_PL_FLAG_NO_EVICT)) |
|---|
| 464 | | - lockdep_assert_held(&src->resv->lock.base); |
|---|
| 465 | + dma_resv_assert_held(src->base.resv); |
|---|
| 465 | 466 | |
|---|
| 466 | | - if (dst->ttm->state == tt_unpopulated) { |
|---|
| 467 | | - ret = dst->ttm->bdev->driver->ttm_tt_populate(dst->ttm, &ctx); |
|---|
| 467 | + if (!ttm_tt_is_populated(dst->ttm)) { |
|---|
| 468 | + ret = dst->bdev->driver->ttm_tt_populate(dst->bdev, dst->ttm, &ctx); |
|---|
| 468 | 469 | if (ret) |
|---|
| 469 | 470 | return ret; |
|---|
| 470 | 471 | } |
|---|
| 471 | 472 | |
|---|
| 472 | | - if (src->ttm->state == tt_unpopulated) { |
|---|
| 473 | | - ret = src->ttm->bdev->driver->ttm_tt_populate(src->ttm, &ctx); |
|---|
| 473 | + if (!ttm_tt_is_populated(src->ttm)) { |
|---|
| 474 | + ret = src->bdev->driver->ttm_tt_populate(src->bdev, src->ttm, &ctx); |
|---|
| 474 | 475 | if (ret) |
|---|
| 475 | 476 | return ret; |
|---|
| 476 | 477 | } |
|---|
| .. | .. |
|---|
| 499 | 500 | } |
|---|
| 500 | 501 | out: |
|---|
| 501 | 502 | if (d.src_addr) |
|---|
| 502 | | - ttm_kunmap_atomic_prot(d.src_addr, d.src_prot); |
|---|
| 503 | + kunmap_atomic(d.src_addr); |
|---|
| 503 | 504 | if (d.dst_addr) |
|---|
| 504 | | - ttm_kunmap_atomic_prot(d.dst_addr, d.dst_prot); |
|---|
| 505 | + kunmap_atomic(d.dst_addr); |
|---|
| 505 | 506 | |
|---|
| 506 | 507 | return ret; |
|---|
| 507 | 508 | } |
|---|