diff options
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_bo.c | 20 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_drv.h | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_gem.c | 3 |
3 files changed, 20 insertions, 5 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c index f6f51b4259e7..a7883e7db344 100644 --- a/drivers/gpu/drm/nouveau/nouveau_bo.c +++ b/drivers/gpu/drm/nouveau/nouveau_bo.c | |||
@@ -242,7 +242,7 @@ nouveau_bo_pin(struct nouveau_bo *nvbo, uint32_t memtype) | |||
242 | 242 | ||
243 | nouveau_bo_placement_set(nvbo, memtype, 0); | 243 | nouveau_bo_placement_set(nvbo, memtype, 0); |
244 | 244 | ||
245 | ret = ttm_bo_validate(bo, &nvbo->placement, false, false, false); | 245 | ret = nouveau_bo_validate(nvbo, false, false, false); |
246 | if (ret == 0) { | 246 | if (ret == 0) { |
247 | switch (bo->mem.mem_type) { | 247 | switch (bo->mem.mem_type) { |
248 | case TTM_PL_VRAM: | 248 | case TTM_PL_VRAM: |
@@ -278,7 +278,7 @@ nouveau_bo_unpin(struct nouveau_bo *nvbo) | |||
278 | 278 | ||
279 | nouveau_bo_placement_set(nvbo, bo->mem.placement, 0); | 279 | nouveau_bo_placement_set(nvbo, bo->mem.placement, 0); |
280 | 280 | ||
281 | ret = ttm_bo_validate(bo, &nvbo->placement, false, false, false); | 281 | ret = nouveau_bo_validate(nvbo, false, false, false); |
282 | if (ret == 0) { | 282 | if (ret == 0) { |
283 | switch (bo->mem.mem_type) { | 283 | switch (bo->mem.mem_type) { |
284 | case TTM_PL_VRAM: | 284 | case TTM_PL_VRAM: |
@@ -317,6 +317,20 @@ nouveau_bo_unmap(struct nouveau_bo *nvbo) | |||
317 | ttm_bo_kunmap(&nvbo->kmap); | 317 | ttm_bo_kunmap(&nvbo->kmap); |
318 | } | 318 | } |
319 | 319 | ||
320 | int | ||
321 | nouveau_bo_validate(struct nouveau_bo *nvbo, bool interruptible, | ||
322 | bool no_wait_reserve, bool no_wait_gpu) | ||
323 | { | ||
324 | int ret; | ||
325 | |||
326 | ret = ttm_bo_validate(&nvbo->bo, &nvbo->placement, interruptible, | ||
327 | no_wait_reserve, no_wait_gpu); | ||
328 | if (ret) | ||
329 | return ret; | ||
330 | |||
331 | return 0; | ||
332 | } | ||
333 | |||
320 | u16 | 334 | u16 |
321 | nouveau_bo_rd16(struct nouveau_bo *nvbo, unsigned index) | 335 | nouveau_bo_rd16(struct nouveau_bo *nvbo, unsigned index) |
322 | { | 336 | { |
@@ -937,7 +951,7 @@ nouveau_ttm_fault_reserve_notify(struct ttm_buffer_object *bo) | |||
937 | nvbo->placement.fpfn = 0; | 951 | nvbo->placement.fpfn = 0; |
938 | nvbo->placement.lpfn = dev_priv->fb_mappable_pages; | 952 | nvbo->placement.lpfn = dev_priv->fb_mappable_pages; |
939 | nouveau_bo_placement_set(nvbo, TTM_PL_VRAM, 0); | 953 | nouveau_bo_placement_set(nvbo, TTM_PL_VRAM, 0); |
940 | return ttm_bo_validate(bo, &nvbo->placement, false, true, false); | 954 | return nouveau_bo_validate(nvbo, false, true, false); |
941 | } | 955 | } |
942 | 956 | ||
943 | void | 957 | void |
diff --git a/drivers/gpu/drm/nouveau/nouveau_drv.h b/drivers/gpu/drm/nouveau/nouveau_drv.h index e82dff4008c9..22abe8579912 100644 --- a/drivers/gpu/drm/nouveau/nouveau_drv.h +++ b/drivers/gpu/drm/nouveau/nouveau_drv.h | |||
@@ -1285,6 +1285,8 @@ extern void nouveau_bo_wr16(struct nouveau_bo *nvbo, unsigned index, u16 val); | |||
1285 | extern u32 nouveau_bo_rd32(struct nouveau_bo *nvbo, unsigned index); | 1285 | extern u32 nouveau_bo_rd32(struct nouveau_bo *nvbo, unsigned index); |
1286 | extern void nouveau_bo_wr32(struct nouveau_bo *nvbo, unsigned index, u32 val); | 1286 | extern void nouveau_bo_wr32(struct nouveau_bo *nvbo, unsigned index, u32 val); |
1287 | extern void nouveau_bo_fence(struct nouveau_bo *, struct nouveau_fence *); | 1287 | extern void nouveau_bo_fence(struct nouveau_bo *, struct nouveau_fence *); |
1288 | extern int nouveau_bo_validate(struct nouveau_bo *, bool interruptible, | ||
1289 | bool no_wait_reserve, bool no_wait_gpu); | ||
1288 | 1290 | ||
1289 | /* nouveau_fence.c */ | 1291 | /* nouveau_fence.c */ |
1290 | struct nouveau_fence; | 1292 | struct nouveau_fence; |
diff --git a/drivers/gpu/drm/nouveau/nouveau_gem.c b/drivers/gpu/drm/nouveau/nouveau_gem.c index 9886b644f27d..0adb2a85c143 100644 --- a/drivers/gpu/drm/nouveau/nouveau_gem.c +++ b/drivers/gpu/drm/nouveau/nouveau_gem.c | |||
@@ -358,8 +358,7 @@ validate_list(struct nouveau_channel *chan, struct list_head *list, | |||
358 | } | 358 | } |
359 | 359 | ||
360 | nvbo->channel = (b->read_domains & (1 << 31)) ? NULL : chan; | 360 | nvbo->channel = (b->read_domains & (1 << 31)) ? NULL : chan; |
361 | ret = ttm_bo_validate(&nvbo->bo, &nvbo->placement, | 361 | ret = nouveau_bo_validate(nvbo, true, false, false); |
362 | true, false, false); | ||
363 | nvbo->channel = NULL; | 362 | nvbo->channel = NULL; |
364 | if (unlikely(ret)) { | 363 | if (unlikely(ret)) { |
365 | if (ret != -ERESTARTSYS) | 364 | if (ret != -ERESTARTSYS) |