• Home
  • Raw
  • Download

Lines Matching refs:bo

38 static void drm_tegra_bo_free(struct drm_tegra_bo *bo)  in drm_tegra_bo_free()  argument
40 struct drm_tegra *drm = bo->drm; in drm_tegra_bo_free()
43 if (bo->map) in drm_tegra_bo_free()
44 munmap(bo->map, bo->size); in drm_tegra_bo_free()
47 args.handle = bo->handle; in drm_tegra_bo_free()
51 free(bo); in drm_tegra_bo_free()
108 struct drm_tegra_bo *bo; in drm_tegra_bo_new() local
114 bo = calloc(1, sizeof(*bo)); in drm_tegra_bo_new()
115 if (!bo) in drm_tegra_bo_new()
118 atomic_set(&bo->ref, 1); in drm_tegra_bo_new()
119 bo->flags = flags; in drm_tegra_bo_new()
120 bo->size = size; in drm_tegra_bo_new()
121 bo->drm = drm; in drm_tegra_bo_new()
131 free(bo); in drm_tegra_bo_new()
135 bo->handle = args.handle; in drm_tegra_bo_new()
137 *bop = bo; in drm_tegra_bo_new()
145 struct drm_tegra_bo *bo; in drm_tegra_bo_wrap() local
150 bo = calloc(1, sizeof(*bo)); in drm_tegra_bo_wrap()
151 if (!bo) in drm_tegra_bo_wrap()
154 atomic_set(&bo->ref, 1); in drm_tegra_bo_wrap()
155 bo->handle = handle; in drm_tegra_bo_wrap()
156 bo->flags = flags; in drm_tegra_bo_wrap()
157 bo->size = size; in drm_tegra_bo_wrap()
158 bo->drm = drm; in drm_tegra_bo_wrap()
160 *bop = bo; in drm_tegra_bo_wrap()
165 drm_public struct drm_tegra_bo *drm_tegra_bo_ref(struct drm_tegra_bo *bo) in drm_tegra_bo_ref() argument
167 if (bo) in drm_tegra_bo_ref()
168 atomic_inc(&bo->ref); in drm_tegra_bo_ref()
170 return bo; in drm_tegra_bo_ref()
173 drm_public void drm_tegra_bo_unref(struct drm_tegra_bo *bo) in drm_tegra_bo_unref() argument
175 if (bo && atomic_dec_and_test(&bo->ref)) in drm_tegra_bo_unref()
176 drm_tegra_bo_free(bo); in drm_tegra_bo_unref()
179 drm_public int drm_tegra_bo_get_handle(struct drm_tegra_bo *bo, uint32_t *handle) in drm_tegra_bo_get_handle() argument
181 if (!bo || !handle) in drm_tegra_bo_get_handle()
184 *handle = bo->handle; in drm_tegra_bo_get_handle()
189 drm_public int drm_tegra_bo_map(struct drm_tegra_bo *bo, void **ptr) in drm_tegra_bo_map() argument
191 struct drm_tegra *drm = bo->drm; in drm_tegra_bo_map()
193 if (!bo->map) { in drm_tegra_bo_map()
198 args.handle = bo->handle; in drm_tegra_bo_map()
205 bo->offset = args.offset; in drm_tegra_bo_map()
207 bo->map = mmap(0, bo->size, PROT_READ | PROT_WRITE, MAP_SHARED, in drm_tegra_bo_map()
208 drm->fd, bo->offset); in drm_tegra_bo_map()
209 if (bo->map == MAP_FAILED) { in drm_tegra_bo_map()
210 bo->map = NULL; in drm_tegra_bo_map()
216 *ptr = bo->map; in drm_tegra_bo_map()
221 drm_public int drm_tegra_bo_unmap(struct drm_tegra_bo *bo) in drm_tegra_bo_unmap() argument
223 if (!bo) in drm_tegra_bo_unmap()
226 if (!bo->map) in drm_tegra_bo_unmap()
229 if (munmap(bo->map, bo->size)) in drm_tegra_bo_unmap()
232 bo->map = NULL; in drm_tegra_bo_unmap()
237 drm_public int drm_tegra_bo_get_flags(struct drm_tegra_bo *bo, uint32_t *flags) in drm_tegra_bo_get_flags() argument
240 struct drm_tegra *drm = bo->drm; in drm_tegra_bo_get_flags()
243 if (!bo) in drm_tegra_bo_get_flags()
247 args.handle = bo->handle; in drm_tegra_bo_get_flags()
260 drm_public int drm_tegra_bo_set_flags(struct drm_tegra_bo *bo, uint32_t flags) in drm_tegra_bo_set_flags() argument
263 struct drm_tegra *drm = bo->drm; in drm_tegra_bo_set_flags()
266 if (!bo) in drm_tegra_bo_set_flags()
270 args.handle = bo->handle; in drm_tegra_bo_set_flags()
281 drm_public int drm_tegra_bo_get_tiling(struct drm_tegra_bo *bo, in drm_tegra_bo_get_tiling() argument
285 struct drm_tegra *drm = bo->drm; in drm_tegra_bo_get_tiling()
288 if (!bo) in drm_tegra_bo_get_tiling()
292 args.handle = bo->handle; in drm_tegra_bo_get_tiling()
307 drm_public int drm_tegra_bo_set_tiling(struct drm_tegra_bo *bo, in drm_tegra_bo_set_tiling() argument
311 struct drm_tegra *drm = bo->drm; in drm_tegra_bo_set_tiling()
314 if (!bo) in drm_tegra_bo_set_tiling()
318 args.handle = bo->handle; in drm_tegra_bo_set_tiling()