Lines Matching refs:drm
44 struct drm_tegra *drm = bo->drm; in drm_tegra_bo_free() local
53 drmIoctl(drm->fd, DRM_IOCTL_GEM_CLOSE, &args); in drm_tegra_bo_free()
60 struct drm_tegra *drm; in drm_tegra_wrap() local
65 drm = calloc(1, sizeof(*drm)); in drm_tegra_wrap()
66 if (!drm) in drm_tegra_wrap()
69 drm->close = close; in drm_tegra_wrap()
70 drm->fd = fd; in drm_tegra_wrap()
72 *drmp = drm; in drm_tegra_wrap()
99 void drm_tegra_close(struct drm_tegra *drm) in drm_tegra_close() argument
101 if (!drm) in drm_tegra_close()
104 if (drm->close) in drm_tegra_close()
105 close(drm->fd); in drm_tegra_close()
107 free(drm); in drm_tegra_close()
111 int drm_tegra_bo_new(struct drm_tegra_bo **bop, struct drm_tegra *drm, in drm_tegra_bo_new() argument
118 if (!drm || size == 0 || !bop) in drm_tegra_bo_new()
128 bo->drm = drm; in drm_tegra_bo_new()
134 err = drmCommandWriteRead(drm->fd, DRM_TEGRA_GEM_CREATE, &args, in drm_tegra_bo_new()
150 int drm_tegra_bo_wrap(struct drm_tegra_bo **bop, struct drm_tegra *drm, in drm_tegra_bo_wrap() argument
155 if (!drm || !bop) in drm_tegra_bo_wrap()
166 bo->drm = drm; in drm_tegra_bo_wrap()
174 int drm_tegra_bo_name_ref(struct drm_tegra *drm, uint32_t name, uint32_t size, in drm_tegra_bo_name_ref() argument
186 ret = drmIoctl(drm->fd, DRM_IOCTL_GEM_OPEN, &open_args); in drm_tegra_bo_name_ref()
190 ret = drm_tegra_bo_wrap(bop, drm, open_args.handle, 0, size); in drm_tegra_bo_name_ref()
201 drmIoctl(drm->fd, DRM_IOCTL_GEM_CLOSE, &close_args); in drm_tegra_bo_name_ref()
218 ret = drmIoctl(bo->drm->fd, DRM_IOCTL_GEM_FLINK, &args); in drm_tegra_bo_name_get()
260 struct drm_tegra *drm = bo->drm; in drm_tegra_bo_map() local
269 err = drmCommandWriteRead(drm->fd, DRM_TEGRA_GEM_MMAP, &args, in drm_tegra_bo_map()
277 drm->fd, bo->offset); in drm_tegra_bo_map()
311 struct drm_tegra *drm = bo->drm; in drm_tegra_bo_get_flags() local
320 err = drmCommandWriteRead(drm->fd, DRM_TEGRA_GEM_GET_FLAGS, &args, in drm_tegra_bo_get_flags()
335 struct drm_tegra *drm = bo->drm; in drm_tegra_bo_set_flags() local
345 err = drmCommandWriteRead(drm->fd, DRM_TEGRA_GEM_SET_FLAGS, &args, in drm_tegra_bo_set_flags()
358 struct drm_tegra *drm = bo->drm; in drm_tegra_bo_get_tiling() local
367 err = drmCommandWriteRead(drm->fd, DRM_TEGRA_GEM_GET_TILING, &args, in drm_tegra_bo_get_tiling()
385 struct drm_tegra *drm = bo->drm; in drm_tegra_bo_set_tiling() local
396 err = drmCommandWriteRead(drm->fd, DRM_TEGRA_GEM_SET_TILING, &args, in drm_tegra_bo_set_tiling()