mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
drm/nouveau: stop using ttm_bo_wait
TTM is just wrapping core DMA functionality here, remove the mid-layer. No functional change. Signed-off-by: Christian König <christian.koenig@amd.com> Acked-by: Karol Herbst <kherbst@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20221125102137.1801-5-christian.koenig@amd.com
This commit is contained in:
parent
5e83f359d9
commit
41d351f295
2 changed files with 13 additions and 4 deletions
|
@ -922,6 +922,7 @@ static void nouveau_bo_move_ntfy(struct ttm_buffer_object *bo,
|
||||||
struct nouveau_mem *mem = new_reg ? nouveau_mem(new_reg) : NULL;
|
struct nouveau_mem *mem = new_reg ? nouveau_mem(new_reg) : NULL;
|
||||||
struct nouveau_bo *nvbo = nouveau_bo(bo);
|
struct nouveau_bo *nvbo = nouveau_bo(bo);
|
||||||
struct nouveau_vma *vma;
|
struct nouveau_vma *vma;
|
||||||
|
long ret;
|
||||||
|
|
||||||
/* ttm can now (stupidly) pass the driver bos it didn't create... */
|
/* ttm can now (stupidly) pass the driver bos it didn't create... */
|
||||||
if (bo->destroy != nouveau_bo_del_ttm)
|
if (bo->destroy != nouveau_bo_del_ttm)
|
||||||
|
@ -936,7 +937,10 @@ static void nouveau_bo_move_ntfy(struct ttm_buffer_object *bo,
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
list_for_each_entry(vma, &nvbo->vma_list, head) {
|
list_for_each_entry(vma, &nvbo->vma_list, head) {
|
||||||
WARN_ON(ttm_bo_wait(bo, false, false));
|
ret = dma_resv_wait_timeout(bo->base.resv,
|
||||||
|
DMA_RESV_USAGE_BOOKKEEP,
|
||||||
|
false, 15 * HZ);
|
||||||
|
WARN_ON(ret <= 0);
|
||||||
nouveau_vma_unmap(vma);
|
nouveau_vma_unmap(vma);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -645,7 +645,7 @@ nouveau_gem_pushbuf_reloc_apply(struct nouveau_cli *cli,
|
||||||
struct drm_nouveau_gem_pushbuf_reloc *reloc,
|
struct drm_nouveau_gem_pushbuf_reloc *reloc,
|
||||||
struct drm_nouveau_gem_pushbuf_bo *bo)
|
struct drm_nouveau_gem_pushbuf_bo *bo)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
long ret = 0;
|
||||||
unsigned i;
|
unsigned i;
|
||||||
|
|
||||||
for (i = 0; i < req->nr_relocs; i++) {
|
for (i = 0; i < req->nr_relocs; i++) {
|
||||||
|
@ -703,9 +703,14 @@ nouveau_gem_pushbuf_reloc_apply(struct nouveau_cli *cli,
|
||||||
data |= r->vor;
|
data |= r->vor;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = ttm_bo_wait(&nvbo->bo, false, false);
|
ret = dma_resv_wait_timeout(nvbo->bo.base.resv,
|
||||||
|
DMA_RESV_USAGE_BOOKKEEP,
|
||||||
|
false, 15 * HZ);
|
||||||
|
if (ret == 0)
|
||||||
|
ret = -EBUSY;
|
||||||
if (ret) {
|
if (ret) {
|
||||||
NV_PRINTK(err, cli, "reloc wait_idle failed: %d\n", ret);
|
NV_PRINTK(err, cli, "reloc wait_idle failed: %ld\n",
|
||||||
|
ret);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue