diff options
author | Christoph Bumiller <[email protected]> | 2012-04-06 15:41:55 +0200 |
---|---|---|
committer | Ben Skeggs <[email protected]> | 2012-04-14 02:56:33 +1000 |
commit | 6d1cdec3ba151168bfc3aef222fba6265dfb41fb (patch) | |
tree | c8c013eaa14e1b7463b6b3f39221524d901370f6 /src/gallium/drivers/nouveau/nouveau_mm.c | |
parent | 3c7872f35f4ae439082d413ab31333cf99be7e91 (diff) |
nouveau: switch to libdrm_nouveau-2.0
Diffstat (limited to 'src/gallium/drivers/nouveau/nouveau_mm.c')
-rw-r--r-- | src/gallium/drivers/nouveau/nouveau_mm.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/gallium/drivers/nouveau/nouveau_mm.c b/src/gallium/drivers/nouveau/nouveau_mm.c index 8d0b7bfe99a..4207084aecf 100644 --- a/src/gallium/drivers/nouveau/nouveau_mm.c +++ b/src/gallium/drivers/nouveau/nouveau_mm.c @@ -5,11 +5,10 @@ #include "util/u_memory.h" #include "util/u_double_list.h" +#include "nouveau_winsys.h" #include "nouveau_screen.h" #include "nouveau_mm.h" -#include "nouveau/nouveau_bo.h" - #define MM_MIN_ORDER 7 #define MM_MAX_ORDER 20 @@ -28,8 +27,8 @@ struct mm_bucket { struct nouveau_mman { struct nouveau_device *dev; struct mm_bucket bucket[MM_NUM_BUCKETS]; - uint32_t storage_type; uint32_t domain; + union nouveau_bo_config config; uint64_t allocated; }; @@ -128,8 +127,9 @@ mm_slab_new(struct nouveau_mman *cache, int chunk_order) memset(&slab->bits[0], ~0, words * 4); slab->bo = NULL; - ret = nouveau_bo_new_tile(cache->dev, cache->domain, 0, size, - 0, cache->storage_type, &slab->bo); + + ret = nouveau_bo_new(cache->dev, cache->domain, 0, size, &cache->config, + &slab->bo); if (ret) { FREE(slab); return PIPE_ERROR_OUT_OF_MEMORY; @@ -155,7 +155,7 @@ mm_slab_new(struct nouveau_mman *cache, int chunk_order) /* @return token to identify slab or NULL if we just allocated a new bo */ struct nouveau_mm_allocation * nouveau_mm_allocate(struct nouveau_mman *cache, - uint32_t size, struct nouveau_bo **bo, uint32_t *offset) + uint32_t size, struct nouveau_bo **bo, uint32_t *offset) { struct mm_bucket *bucket; struct mm_slab *slab; @@ -164,10 +164,11 @@ nouveau_mm_allocate(struct nouveau_mman *cache, bucket = mm_bucket_by_size(cache, size); if (!bucket) { - ret = nouveau_bo_new_tile(cache->dev, cache->domain, 0, size, - 0, cache->storage_type, bo); + ret = nouveau_bo_new(cache->dev, cache->domain, 0, size, &cache->config, + bo); if (ret) - debug_printf("bo_new(%x, %x): %i\n", size, cache->storage_type, ret); + debug_printf("bo_new(%x, %x): %i\n", + size, cache->config.nv50.memtype, ret); *offset = 0; return NULL; @@ -233,7 +234,7 @@ nouveau_mm_free_work(void *data) struct nouveau_mman * nouveau_mm_create(struct nouveau_device *dev, uint32_t domain, - uint32_t storage_type) + union nouveau_bo_config *config) { struct nouveau_mman *cache = MALLOC_STRUCT(nouveau_mman); int i; @@ -243,7 +244,7 @@ nouveau_mm_create(struct nouveau_device *dev, uint32_t domain, cache->dev = dev; cache->domain = domain; - cache->storage_type = storage_type; + cache->config = *config; cache->allocated = 0; for (i = 0; i < MM_NUM_BUCKETS; ++i) { |