Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 218273
b: refs/heads/master
c: c9220b0
h: refs/heads/master
i:
  218271: b12d92a
v: v3
  • Loading branch information
Dave Airlie committed Oct 18, 2010
1 parent 10a61c8 commit 334c10e
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 4 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: b7ae5056c94a8191c1fd0b5697707377516c0c5d
refs/heads/master: c9220b0f7cbd1d2272426aa81a72ae2f6582bb71
13 changes: 10 additions & 3 deletions trunk/drivers/gpu/drm/ttm/ttm_bo.c
Original file line number Diff line number Diff line change
Expand Up @@ -464,9 +464,7 @@ static void ttm_bo_cleanup_memtype_use(struct ttm_buffer_object *bo)
spin_lock(&glob->lru_lock);
}

if (bo->mem.mm_node) {
ttm_bo_mem_put(bo, &bo->mem);
}
ttm_bo_mem_put_locked(bo, &bo->mem);

atomic_set(&bo->reserved, 0);
wake_up_all(&bo->event_queue);
Expand Down Expand Up @@ -791,6 +789,15 @@ void ttm_bo_mem_put(struct ttm_buffer_object *bo, struct ttm_mem_reg *mem)
}
EXPORT_SYMBOL(ttm_bo_mem_put);

void ttm_bo_mem_put_locked(struct ttm_buffer_object *bo, struct ttm_mem_reg *mem)
{
struct ttm_mem_type_manager *man = &bo->bdev->man[mem->mem_type];

if (mem->mm_node)
(*man->func->put_node_locked)(man, mem);
}
EXPORT_SYMBOL(ttm_bo_mem_put_locked);

/**
* Repeatedly evict memory from the LRU for @mem_type until we create enough
* space, or we've evicted everything and there isn't enough space.
Expand Down
10 changes: 10 additions & 0 deletions trunk/drivers/gpu/drm/ttm/ttm_bo_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,15 @@ static void ttm_bo_man_put_node(struct ttm_mem_type_manager *man,
}
}

static void ttm_bo_man_put_node_locked(struct ttm_mem_type_manager *man,
struct ttm_mem_reg *mem)
{
if (mem->mm_node) {
drm_mm_put_block(mem->mm_node);
mem->mm_node = NULL;
}
}

static int ttm_bo_man_init(struct ttm_mem_type_manager *man,
unsigned long p_size)
{
Expand Down Expand Up @@ -143,6 +152,7 @@ const struct ttm_mem_type_manager_func ttm_bo_manager_func = {
ttm_bo_man_takedown,
ttm_bo_man_get_node,
ttm_bo_man_put_node,
ttm_bo_man_put_node_locked,
ttm_bo_man_debug
};
EXPORT_SYMBOL(ttm_bo_manager_func);
4 changes: 4 additions & 0 deletions trunk/include/drm/ttm/ttm_bo_driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,8 @@ struct ttm_mem_type_manager_func {
struct ttm_mem_reg *mem);
void (*put_node)(struct ttm_mem_type_manager *man,
struct ttm_mem_reg *mem);
void (*put_node_locked)(struct ttm_mem_type_manager *man,
struct ttm_mem_reg *mem);
void (*debug)(struct ttm_mem_type_manager *man, const char *prefix);
};

Expand Down Expand Up @@ -667,6 +669,8 @@ extern int ttm_bo_mem_space(struct ttm_buffer_object *bo,

extern void ttm_bo_mem_put(struct ttm_buffer_object *bo,
struct ttm_mem_reg *mem);
extern void ttm_bo_mem_put_locked(struct ttm_buffer_object *bo,
struct ttm_mem_reg *mem);

/**
* ttm_bo_wait_for_cpu
Expand Down

0 comments on commit 334c10e

Please sign in to comment.