Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 228593
b: refs/heads/master
c: 7a45d76
h: refs/heads/master
i:
  228591: e6d69ef
v: v3
  • Loading branch information
Ben Skeggs authored and Francisco Jerez committed Dec 8, 2010
1 parent 11421f8 commit 44bd362
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a0fd9b9f68cd7a5952eae3c5b3c5a3bc0eadfd44
refs/heads/master: 7a45d764a8e3177f0c9cd4a0be9f2ab7965e55cb
20 changes: 17 additions & 3 deletions trunk/drivers/gpu/drm/nouveau/nouveau_bo.c
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ nouveau_bo_pin(struct nouveau_bo *nvbo, uint32_t memtype)

nouveau_bo_placement_set(nvbo, memtype, 0);

ret = ttm_bo_validate(bo, &nvbo->placement, false, false, false);
ret = nouveau_bo_validate(nvbo, false, false, false);
if (ret == 0) {
switch (bo->mem.mem_type) {
case TTM_PL_VRAM:
Expand Down Expand Up @@ -278,7 +278,7 @@ nouveau_bo_unpin(struct nouveau_bo *nvbo)

nouveau_bo_placement_set(nvbo, bo->mem.placement, 0);

ret = ttm_bo_validate(bo, &nvbo->placement, false, false, false);
ret = nouveau_bo_validate(nvbo, false, false, false);
if (ret == 0) {
switch (bo->mem.mem_type) {
case TTM_PL_VRAM:
Expand Down Expand Up @@ -317,6 +317,20 @@ nouveau_bo_unmap(struct nouveau_bo *nvbo)
ttm_bo_kunmap(&nvbo->kmap);
}

int
nouveau_bo_validate(struct nouveau_bo *nvbo, bool interruptible,
bool no_wait_reserve, bool no_wait_gpu)
{
int ret;

ret = ttm_bo_validate(&nvbo->bo, &nvbo->placement, interruptible,
no_wait_reserve, no_wait_gpu);
if (ret)
return ret;

return 0;
}

u16
nouveau_bo_rd16(struct nouveau_bo *nvbo, unsigned index)
{
Expand Down Expand Up @@ -937,7 +951,7 @@ nouveau_ttm_fault_reserve_notify(struct ttm_buffer_object *bo)
nvbo->placement.fpfn = 0;
nvbo->placement.lpfn = dev_priv->fb_mappable_pages;
nouveau_bo_placement_set(nvbo, TTM_PL_VRAM, 0);
return ttm_bo_validate(bo, &nvbo->placement, false, true, false);
return nouveau_bo_validate(nvbo, false, true, false);
}

void
Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/gpu/drm/nouveau/nouveau_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -1285,6 +1285,8 @@ extern void nouveau_bo_wr16(struct nouveau_bo *nvbo, unsigned index, u16 val);
extern u32 nouveau_bo_rd32(struct nouveau_bo *nvbo, unsigned index);
extern void nouveau_bo_wr32(struct nouveau_bo *nvbo, unsigned index, u32 val);
extern void nouveau_bo_fence(struct nouveau_bo *, struct nouveau_fence *);
extern int nouveau_bo_validate(struct nouveau_bo *, bool interruptible,
bool no_wait_reserve, bool no_wait_gpu);

/* nouveau_fence.c */
struct nouveau_fence;
Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/gpu/drm/nouveau/nouveau_gem.c
Original file line number Diff line number Diff line change
Expand Up @@ -358,8 +358,7 @@ validate_list(struct nouveau_channel *chan, struct list_head *list,
}

nvbo->channel = (b->read_domains & (1 << 31)) ? NULL : chan;
ret = ttm_bo_validate(&nvbo->bo, &nvbo->placement,
true, false, false);
ret = nouveau_bo_validate(nvbo, true, false, false);
nvbo->channel = NULL;
if (unlikely(ret)) {
if (ret != -ERESTARTSYS)
Expand Down

0 comments on commit 44bd362

Please sign in to comment.