Lines Matching refs:fd
31 static int drm_version(int fd) { in drm_version() argument
41 if (ioctl(fd, DRM_IOCTL_VERSION, &ver) < 0) { in drm_version()
42 close(fd); in drm_version()
48 static uint32_t nouveau_gem_ioctl_new(int fd) { in nouveau_gem_ioctl_new() argument
56 if (ioctl(fd, DRM_IOCTL_NOUVEAU_GEM_NEW, &new_arg) < 0) { in nouveau_gem_ioctl_new()
57 close(fd); in nouveau_gem_ioctl_new()
63 static void nouveau_gem_ioctl_map(int fd, uint32_t handle) { in nouveau_gem_ioctl_map() argument
69 if (ioctl(fd, DRM_IOCTL_NOUVEAU_GEM_MAP, &map_arg) < 0) { in nouveau_gem_ioctl_map()
70 close(fd); in nouveau_gem_ioctl_map()
76 int fd; in main() local
80 fd = open(DRMDEV_NAME, O_RDWR); in main()
81 if (fd < 0) { in main()
85 drm_version(fd); in main()
87 uint32_t handle = nouveau_gem_ioctl_new(fd); in main()
90 nouveau_gem_ioctl_map(fd, handle); in main()
92 close(fd); in main()