Lines Matching refs:nvdev
373 struct nouveau_device_priv *nvdev; in nouveau_device_new() local
383 if (!(nvdev = calloc(1, sizeof(*nvdev)))) in nouveau_device_new()
385 dev = *pdev = &nvdev->base; in nouveau_device_new()
401 nvdev->base.chipset = info.chipset; in nouveau_device_new()
402 nvdev->have_bo_usage = true; in nouveau_device_new()
405 nvdev->base.object.parent = &drm->client; in nouveau_device_new()
406 nvdev->base.object.handle = ~0ULL; in nouveau_device_new()
407 nvdev->base.object.oclass = NOUVEAU_DEVICE_CLASS; in nouveau_device_new()
408 nvdev->base.object.length = ~0; in nouveau_device_new()
413 nvdev->base.chipset = v; in nouveau_device_new()
417 nvdev->have_bo_usage = (v != 0); in nouveau_device_new()
424 nvdev->base.vram_size = v; in nouveau_device_new()
429 nvdev->base.gart_size = v; in nouveau_device_new()
433 nvdev->vram_limit_percent = atoi(tmp); in nouveau_device_new()
435 nvdev->vram_limit_percent = 80; in nouveau_device_new()
437 nvdev->base.vram_limit = in nouveau_device_new()
438 (nvdev->base.vram_size * nvdev->vram_limit_percent) / 100; in nouveau_device_new()
442 nvdev->gart_limit_percent = atoi(tmp); in nouveau_device_new()
444 nvdev->gart_limit_percent = 80; in nouveau_device_new()
446 nvdev->base.gart_limit = in nouveau_device_new()
447 (nvdev->base.gart_size * nvdev->gart_limit_percent) / 100; in nouveau_device_new()
449 ret = pthread_mutex_init(&nvdev->lock, NULL); in nouveau_device_new()
450 DRMINITLISTHEAD(&nvdev->bo_list); in nouveau_device_new()
461 struct nouveau_device_priv *nvdev; in nouveau_device_wrap() local
478 nvdev = nouveau_device(*pdev); in nouveau_device_wrap()
479 nvdev->base.fd = drm->fd; in nouveau_device_wrap()
480 nvdev->base.drm_version = drm->version; in nouveau_device_wrap()
481 nvdev->close = close; in nouveau_device_wrap()
500 struct nouveau_device_priv *nvdev = nouveau_device(*pdev); in nouveau_device_del() local
501 if (nvdev) { in nouveau_device_del()
502 free(nvdev->client); in nouveau_device_del()
503 pthread_mutex_destroy(&nvdev->lock); in nouveau_device_del()
504 if (nvdev->base.fd >= 0) { in nouveau_device_del()
506 nouveau_drm(&nvdev->base.object); in nouveau_device_del()
508 if (nvdev->close) in nouveau_device_del()
509 drmClose(nvdev->base.fd); in nouveau_device_del()
511 free(nvdev); in nouveau_device_del()
538 struct nouveau_device_priv *nvdev = nouveau_device(dev); in nouveau_client_new() local
543 pthread_mutex_lock(&nvdev->lock); in nouveau_client_new()
545 for (i = 0; i < nvdev->nr_client; i++) { in nouveau_client_new()
546 id = ffs(nvdev->client[i]) - 1; in nouveau_client_new()
551 clients = realloc(nvdev->client, sizeof(uint32_t) * (i + 1)); in nouveau_client_new()
554 nvdev->client = clients; in nouveau_client_new()
555 nvdev->client[i] = 0; in nouveau_client_new()
556 nvdev->nr_client++; in nouveau_client_new()
561 nvdev->client[i] |= (1 << id); in nouveau_client_new()
570 pthread_mutex_unlock(&nvdev->lock); in nouveau_client_new()
578 struct nouveau_device_priv *nvdev; in nouveau_client_del() local
581 nvdev = nouveau_device(pcli->base.device); in nouveau_client_del()
582 pthread_mutex_lock(&nvdev->lock); in nouveau_client_del()
583 nvdev->client[id / 32] &= ~(1 << (id % 32)); in nouveau_client_del()
584 pthread_mutex_unlock(&nvdev->lock); in nouveau_client_del()
594 struct nouveau_device_priv *nvdev = nouveau_device(bo->device); in nouveau_bo_del() local
599 pthread_mutex_lock(&nvdev->lock); in nouveau_bo_del()
612 pthread_mutex_unlock(&nvdev->lock); in nouveau_bo_del()
652 struct nouveau_device_priv *nvdev = nouveau_device(dev); in nouveau_bo_wrap_locked() local
657 DRMLISTFOREACHENTRY(nvbo, &nvdev->bo_list, head) { in nouveau_bo_wrap_locked()
692 DRMLISTADD(&nvbo->head, &nvdev->bo_list); in nouveau_bo_wrap_locked()
704 struct nouveau_device_priv *nvdev = nouveau_device(nvbo->base.device); in nouveau_bo_make_global() local
705 pthread_mutex_lock(&nvdev->lock); in nouveau_bo_make_global()
707 DRMLISTADD(&nvbo->head, &nvdev->bo_list); in nouveau_bo_make_global()
708 pthread_mutex_unlock(&nvdev->lock); in nouveau_bo_make_global()
716 struct nouveau_device_priv *nvdev = nouveau_device(dev); in nouveau_bo_wrap() local
718 pthread_mutex_lock(&nvdev->lock); in nouveau_bo_wrap()
720 pthread_mutex_unlock(&nvdev->lock); in nouveau_bo_wrap()
729 struct nouveau_device_priv *nvdev = nouveau_device(dev); in nouveau_bo_name_ref() local
734 pthread_mutex_lock(&nvdev->lock); in nouveau_bo_name_ref()
735 DRMLISTFOREACHENTRY(nvbo, &nvdev->bo_list, head) { in nouveau_bo_name_ref()
739 pthread_mutex_unlock(&nvdev->lock); in nouveau_bo_name_ref()
749 pthread_mutex_unlock(&nvdev->lock); in nouveau_bo_name_ref()
794 struct nouveau_device_priv *nvdev = nouveau_device(dev); in nouveau_bo_prime_handle_ref() local
800 pthread_mutex_lock(&nvdev->lock); in nouveau_bo_prime_handle_ref()
805 pthread_mutex_unlock(&nvdev->lock); in nouveau_bo_prime_handle_ref()