Lines Matching refs:nvdev
76 struct nouveau_device_priv *nvdev = calloc(1, sizeof(*nvdev)); in nouveau_device_wrap() local
77 struct nouveau_device *dev = &nvdev->base; in nouveau_device_wrap()
87 if (!nvdev) in nouveau_device_wrap()
89 ret = pthread_mutex_init(&nvdev->lock, NULL); in nouveau_device_wrap()
91 free(nvdev); in nouveau_device_wrap()
95 nvdev->base.fd = fd; in nouveau_device_wrap()
122 nvdev->have_bo_usage = (bousage != 0); in nouveau_device_wrap()
124 nvdev->close = close; in nouveau_device_wrap()
128 nvdev->vram_limit_percent = atoi(tmp); in nouveau_device_wrap()
130 nvdev->vram_limit_percent = 80; in nouveau_device_wrap()
133 nvdev->gart_limit_percent = atoi(tmp); in nouveau_device_wrap()
135 nvdev->gart_limit_percent = 80; in nouveau_device_wrap()
136 DRMINITLISTHEAD(&nvdev->bo_list); in nouveau_device_wrap()
137 nvdev->base.object.oclass = NOUVEAU_DEVICE_CLASS; in nouveau_device_wrap()
138 nvdev->base.lib_version = 0x01000000; in nouveau_device_wrap()
139 nvdev->base.chipset = chipset; in nouveau_device_wrap()
140 nvdev->base.vram_size = vram; in nouveau_device_wrap()
141 nvdev->base.gart_size = gart; in nouveau_device_wrap()
142 nvdev->base.vram_limit = in nouveau_device_wrap()
143 (nvdev->base.vram_size * nvdev->vram_limit_percent) / 100; in nouveau_device_wrap()
144 nvdev->base.gart_limit = in nouveau_device_wrap()
145 (nvdev->base.gart_size * nvdev->gart_limit_percent) / 100; in nouveau_device_wrap()
147 *pdev = &nvdev->base; in nouveau_device_wrap()
166 struct nouveau_device_priv *nvdev = nouveau_device(*pdev); in nouveau_device_del() local
167 if (nvdev) { in nouveau_device_del()
168 if (nvdev->close) in nouveau_device_del()
169 drmClose(nvdev->base.fd); in nouveau_device_del()
170 free(nvdev->client); in nouveau_device_del()
171 pthread_mutex_destroy(&nvdev->lock); in nouveau_device_del()
172 free(nvdev); in nouveau_device_del()
197 struct nouveau_device_priv *nvdev = nouveau_device(dev); in nouveau_client_new() local
202 pthread_mutex_lock(&nvdev->lock); in nouveau_client_new()
204 for (i = 0; i < nvdev->nr_client; i++) { in nouveau_client_new()
205 id = ffs(nvdev->client[i]) - 1; in nouveau_client_new()
210 clients = realloc(nvdev->client, sizeof(uint32_t) * (i + 1)); in nouveau_client_new()
213 nvdev->client = clients; in nouveau_client_new()
214 nvdev->client[i] = 0; in nouveau_client_new()
215 nvdev->nr_client++; in nouveau_client_new()
220 nvdev->client[i] |= (1 << id); in nouveau_client_new()
229 pthread_mutex_unlock(&nvdev->lock); in nouveau_client_new()
237 struct nouveau_device_priv *nvdev; in nouveau_client_del() local
240 nvdev = nouveau_device(pcli->base.device); in nouveau_client_del()
241 pthread_mutex_lock(&nvdev->lock); in nouveau_client_del()
242 nvdev->client[id / 32] &= ~(1 << (id % 32)); in nouveau_client_del()
243 pthread_mutex_unlock(&nvdev->lock); in nouveau_client_del()
349 struct nouveau_device_priv *nvdev = nouveau_device(bo->device); in nouveau_bo_del() local
353 pthread_mutex_lock(&nvdev->lock); in nouveau_bo_del()
366 pthread_mutex_unlock(&nvdev->lock); in nouveau_bo_del()
378 pthread_mutex_unlock(&nvdev->lock); in nouveau_bo_del()
381 pthread_mutex_unlock(&nvdev->lock); in nouveau_bo_del()
394 struct nouveau_device_priv *nvdev = nouveau_device(dev); in nouveau_bo_new() local
412 pthread_mutex_lock(&nvdev->lock); in nouveau_bo_new()
413 DRMLISTADD(&nvbo->head, &nvdev->bo_list); in nouveau_bo_new()
414 pthread_mutex_unlock(&nvdev->lock); in nouveau_bo_new()
424 struct nouveau_device_priv *nvdev = nouveau_device(dev); in nouveau_bo_wrap_locked() local
429 DRMLISTFOREACHENTRY(nvbo, &nvdev->bo_list, head) { in nouveau_bo_wrap_locked()
447 DRMLISTADD(&nvbo->head, &nvdev->bo_list); in nouveau_bo_wrap_locked()
459 struct nouveau_device_priv *nvdev = nouveau_device(dev); in nouveau_bo_wrap() local
461 pthread_mutex_lock(&nvdev->lock); in nouveau_bo_wrap()
463 pthread_mutex_unlock(&nvdev->lock); in nouveau_bo_wrap()
471 struct nouveau_device_priv *nvdev = nouveau_device(dev); in nouveau_bo_name_ref() local
476 pthread_mutex_lock(&nvdev->lock); in nouveau_bo_name_ref()
477 DRMLISTFOREACHENTRY(nvbo, &nvdev->bo_list, head) { in nouveau_bo_name_ref()
481 pthread_mutex_unlock(&nvdev->lock); in nouveau_bo_name_ref()
490 pthread_mutex_unlock(&nvdev->lock); in nouveau_bo_name_ref()
532 struct nouveau_device_priv *nvdev = nouveau_device(dev); in nouveau_bo_prime_handle_ref() local
538 pthread_mutex_lock(&nvdev->lock); in nouveau_bo_prime_handle_ref()
553 pthread_mutex_unlock(&nvdev->lock); in nouveau_bo_prime_handle_ref()