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