Lines Matching refs:nvdev
377 struct nouveau_device_priv *nvdev; in nouveau_device_new() local
387 if (!(nvdev = calloc(1, sizeof(*nvdev)))) in nouveau_device_new()
389 dev = *pdev = &nvdev->base; in nouveau_device_new()
405 nvdev->base.chipset = info.chipset; in nouveau_device_new()
406 nvdev->have_bo_usage = true; in nouveau_device_new()
409 nvdev->base.object.parent = &drm->client; in nouveau_device_new()
410 nvdev->base.object.handle = ~0ULL; in nouveau_device_new()
411 nvdev->base.object.oclass = NOUVEAU_DEVICE_CLASS; in nouveau_device_new()
412 nvdev->base.object.length = ~0; in nouveau_device_new()
417 nvdev->base.chipset = v; in nouveau_device_new()
421 nvdev->have_bo_usage = (v != 0); in nouveau_device_new()
428 nvdev->base.vram_size = v; in nouveau_device_new()
433 nvdev->base.gart_size = v; in nouveau_device_new()
437 nvdev->vram_limit_percent = atoi(tmp); in nouveau_device_new()
439 nvdev->vram_limit_percent = 80; in nouveau_device_new()
441 nvdev->base.vram_limit = in nouveau_device_new()
442 (nvdev->base.vram_size * nvdev->vram_limit_percent) / 100; in nouveau_device_new()
446 nvdev->gart_limit_percent = atoi(tmp); in nouveau_device_new()
448 nvdev->gart_limit_percent = 80; in nouveau_device_new()
450 nvdev->base.gart_limit = in nouveau_device_new()
451 (nvdev->base.gart_size * nvdev->gart_limit_percent) / 100; in nouveau_device_new()
453 ret = pthread_mutex_init(&nvdev->lock, NULL); in nouveau_device_new()
454 DRMINITLISTHEAD(&nvdev->bo_list); in nouveau_device_new()
465 struct nouveau_device_priv *nvdev; in nouveau_device_wrap() local
482 nvdev = nouveau_device(*pdev); in nouveau_device_wrap()
483 nvdev->base.fd = drm->fd; in nouveau_device_wrap()
484 nvdev->base.drm_version = drm->version; in nouveau_device_wrap()
485 nvdev->close = close; in nouveau_device_wrap()
504 struct nouveau_device_priv *nvdev = nouveau_device(*pdev); in nouveau_device_del() local
505 if (nvdev) { in nouveau_device_del()
506 free(nvdev->client); in nouveau_device_del()
507 pthread_mutex_destroy(&nvdev->lock); in nouveau_device_del()
508 if (nvdev->base.fd >= 0) { in nouveau_device_del()
510 nouveau_drm(&nvdev->base.object); in nouveau_device_del()
512 if (nvdev->close) in nouveau_device_del()
513 drmClose(nvdev->base.fd); in nouveau_device_del()
515 free(nvdev); in nouveau_device_del()
542 struct nouveau_device_priv *nvdev = nouveau_device(dev); in nouveau_client_new() local
547 pthread_mutex_lock(&nvdev->lock); in nouveau_client_new()
549 for (i = 0; i < nvdev->nr_client; i++) { in nouveau_client_new()
550 id = ffs(nvdev->client[i]) - 1; in nouveau_client_new()
555 clients = realloc(nvdev->client, sizeof(uint32_t) * (i + 1)); in nouveau_client_new()
558 nvdev->client = clients; in nouveau_client_new()
559 nvdev->client[i] = 0; in nouveau_client_new()
560 nvdev->nr_client++; in nouveau_client_new()
565 nvdev->client[i] |= (1 << id); in nouveau_client_new()
574 pthread_mutex_unlock(&nvdev->lock); in nouveau_client_new()
582 struct nouveau_device_priv *nvdev; in nouveau_client_del() local
585 nvdev = nouveau_device(pcli->base.device); in nouveau_client_del()
586 pthread_mutex_lock(&nvdev->lock); in nouveau_client_del()
587 nvdev->client[id / 32] &= ~(1 << (id % 32)); in nouveau_client_del()
588 pthread_mutex_unlock(&nvdev->lock); in nouveau_client_del()
598 struct nouveau_device_priv *nvdev = nouveau_device(bo->device); in nouveau_bo_del() local
603 pthread_mutex_lock(&nvdev->lock); in nouveau_bo_del()
616 pthread_mutex_unlock(&nvdev->lock); in nouveau_bo_del()
656 struct nouveau_device_priv *nvdev = nouveau_device(dev); in nouveau_bo_wrap_locked() local
661 DRMLISTFOREACHENTRY(nvbo, &nvdev->bo_list, head) { in nouveau_bo_wrap_locked()
696 DRMLISTADD(&nvbo->head, &nvdev->bo_list); in nouveau_bo_wrap_locked()
708 struct nouveau_device_priv *nvdev = nouveau_device(nvbo->base.device); in nouveau_bo_make_global() local
709 pthread_mutex_lock(&nvdev->lock); in nouveau_bo_make_global()
711 DRMLISTADD(&nvbo->head, &nvdev->bo_list); in nouveau_bo_make_global()
712 pthread_mutex_unlock(&nvdev->lock); in nouveau_bo_make_global()
720 struct nouveau_device_priv *nvdev = nouveau_device(dev); in nouveau_bo_wrap() local
722 pthread_mutex_lock(&nvdev->lock); in nouveau_bo_wrap()
724 pthread_mutex_unlock(&nvdev->lock); in nouveau_bo_wrap()
733 struct nouveau_device_priv *nvdev = nouveau_device(dev); in nouveau_bo_name_ref() local
738 pthread_mutex_lock(&nvdev->lock); in nouveau_bo_name_ref()
739 DRMLISTFOREACHENTRY(nvbo, &nvdev->bo_list, head) { in nouveau_bo_name_ref()
743 pthread_mutex_unlock(&nvdev->lock); in nouveau_bo_name_ref()
753 pthread_mutex_unlock(&nvdev->lock); in nouveau_bo_name_ref()
798 struct nouveau_device_priv *nvdev = nouveau_device(dev); in nouveau_bo_prime_handle_ref() local
804 pthread_mutex_lock(&nvdev->lock); in nouveau_bo_prime_handle_ref()
809 pthread_mutex_unlock(&nvdev->lock); in nouveau_bo_prime_handle_ref()