diff options
author | Dave Airlie <airlied@linux.ie> | 2006-11-06 08:03:18 +1100 |
---|---|---|
committer | Dave Airlie <airlied@linux.ie> | 2006-11-06 08:03:18 +1100 |
commit | 1e90b7ee8cefff59b70e285557aa7920dea77e81 (patch) | |
tree | 2132e5dcee9e5ef9693742100953063cd6423b3a /linux-core/drm_stub.c | |
parent | 0c34d0f31a691bb649ed69f19e93fc1a723aa1d4 (diff) | |
parent | 7b6cd95bb6c41653aed78952da0a461bd4791413 (diff) |
Merge branch 'master' into nouveau-1
Conflicts:
linux-core/Makefile.kernel
Diffstat (limited to 'linux-core/drm_stub.c')
-rw-r--r-- | linux-core/drm_stub.c | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/linux-core/drm_stub.c b/linux-core/drm_stub.c index 839cf441..c03a56a1 100644 --- a/linux-core/drm_stub.c +++ b/linux-core/drm_stub.c @@ -54,6 +54,11 @@ drm_head_t **drm_heads; struct drm_sysfs_class *drm_class; struct proc_dir_entry *drm_proc_root; +drm_cache_t drm_cache = +{ .mm = NULL, + .fence_object = NULL +}; + static int drm_fill_in_dev(drm_device_t * dev, struct pci_dev *pdev, const struct pci_device_id *ent, struct drm_driver *driver) @@ -66,6 +71,7 @@ static int drm_fill_in_dev(drm_device_t * dev, struct pci_dev *pdev, init_timer(&dev->timer); mutex_init(&dev->struct_mutex); mutex_init(&dev->ctxlist_mutex); + mutex_init(&dev->bm.init_mutex); dev->pdev = pdev; dev->pci_device = pdev->device; @@ -76,15 +82,29 @@ static int drm_fill_in_dev(drm_device_t * dev, struct pci_dev *pdev, #endif dev->irq = pdev->irq; - dev->maplist = drm_calloc(1, sizeof(*dev->maplist), DRM_MEM_MAPS); - if (dev->maplist == NULL) + if (drm_ht_create(&dev->map_hash, DRM_MAP_HASH_ORDER)) { + drm_free(dev->maplist, sizeof(*dev->maplist), DRM_MEM_MAPS); return -ENOMEM; - INIT_LIST_HEAD(&dev->maplist->head); - if (drm_ht_create(&dev->map_hash, 12)) { + } + if (drm_mm_init(&dev->offset_manager, DRM_FILE_PAGE_OFFSET_START, + DRM_FILE_PAGE_OFFSET_SIZE)) { drm_free(dev->maplist, sizeof(*dev->maplist), DRM_MEM_MAPS); + drm_ht_remove(&dev->map_hash); + return -ENOMEM; + } + + if (drm_ht_create(&dev->object_hash, DRM_OBJECT_HASH_ORDER)) { + drm_free(dev->maplist, sizeof(*dev->maplist), DRM_MEM_MAPS); + drm_ht_remove(&dev->map_hash); + drm_mm_takedown(&dev->offset_manager); return -ENOMEM; } + dev->maplist = drm_calloc(1, sizeof(*dev->maplist), DRM_MEM_MAPS); + if (dev->maplist == NULL) + return -ENOMEM; + INIT_LIST_HEAD(&dev->maplist->head); + /* the DRM has 6 counters */ dev->counters = 6; dev->types[0] = _DRM_STAT_LOCK; @@ -125,6 +145,7 @@ static int drm_fill_in_dev(drm_device_t * dev, struct pci_dev *pdev, goto error_out_unreg; } + drm_fence_manager_init(dev); return 0; error_out_unreg: |