Lines Matching refs:screen

52 vc5_bo_dump_stats(struct vc5_screen *screen)  in vc5_bo_dump_stats()  argument
54 struct vc5_bo_cache *cache = &screen->bo_cache; in vc5_bo_dump_stats()
56 fprintf(stderr, " BOs allocated: %d\n", screen->bo_count); in vc5_bo_dump_stats()
57 fprintf(stderr, " BOs size: %dkb\n", screen->bo_size / 1024); in vc5_bo_dump_stats()
91 vc5_bo_from_cache(struct vc5_screen *screen, uint32_t size, const char *name) in vc5_bo_from_cache() argument
93 struct vc5_bo_cache *cache = &screen->bo_cache; in vc5_bo_from_cache()
124 vc5_bo_alloc(struct vc5_screen *screen, uint32_t size, const char *name) in vc5_bo_alloc() argument
131 bo = vc5_bo_from_cache(screen, size, name); in vc5_bo_alloc()
136 vc5_bo_dump_stats(screen); in vc5_bo_alloc()
146 bo->screen = screen; in vc5_bo_alloc()
159 ret = vc5_ioctl(screen->fd, DRM_IOCTL_VC5_CREATE_BO, &create); in vc5_bo_alloc()
164 if (!list_empty(&screen->bo_cache.time_list) && in vc5_bo_alloc()
167 vc5_bo_cache_free_all(&screen->bo_cache); in vc5_bo_alloc()
175 screen->bo_count++; in vc5_bo_alloc()
176 screen->bo_size += bo->size; in vc5_bo_alloc()
179 vc5_bo_dump_stats(screen); in vc5_bo_alloc()
188 struct vc5_screen *screen = bo->screen; in vc5_bo_last_unreference() local
192 mtx_lock(&screen->bo_cache.lock); in vc5_bo_last_unreference()
194 mtx_unlock(&screen->bo_cache.lock); in vc5_bo_last_unreference()
200 struct vc5_screen *screen = bo->screen; in vc5_bo_free() local
215 int ret = vc5_ioctl(screen->fd, DRM_IOCTL_GEM_CLOSE, &c); in vc5_bo_free()
219 screen->bo_count--; in vc5_bo_free()
220 screen->bo_size -= bo->size; in vc5_bo_free()
227 vc5_bo_dump_stats(screen); in vc5_bo_free()
234 free_stale_bos(struct vc5_screen *screen, time_t time) in free_stale_bos() argument
236 struct vc5_bo_cache *cache = &screen->bo_cache; in free_stale_bos()
243 vc5_bo_dump_stats(screen); in free_stale_bos()
258 vc5_bo_dump_stats(screen); in free_stale_bos()
277 struct vc5_screen *screen = bo->screen; in vc5_bo_last_unreference_locked_timed() local
278 struct vc5_bo_cache *cache = &screen->bo_cache; in vc5_bo_last_unreference_locked_timed()
288 ralloc_array(screen, struct list_head, page_index + 1); in vc5_bo_last_unreference_locked_timed()
319 vc5_bo_dump_stats(screen); in vc5_bo_last_unreference_locked_timed()
323 free_stale_bos(screen, time); in vc5_bo_last_unreference_locked_timed()
327 vc5_bo_open_handle(struct vc5_screen *screen, in vc5_bo_open_handle() argument
335 mtx_lock(&screen->bo_handles_mutex); in vc5_bo_open_handle()
337 bo = util_hash_table_get(screen->bo_handles, (void*)(uintptr_t)handle); in vc5_bo_open_handle()
345 bo->screen = screen; in vc5_bo_open_handle()
352 vc5_simulator_open_from_handle(screen->fd, winsys_stride, in vc5_bo_open_handle()
357 util_hash_table_set(screen->bo_handles, (void *)(uintptr_t)handle, bo); in vc5_bo_open_handle()
360 mtx_unlock(&screen->bo_handles_mutex); in vc5_bo_open_handle()
365 vc5_bo_open_name(struct vc5_screen *screen, uint32_t name, in vc5_bo_open_name() argument
371 int ret = vc5_ioctl(screen->fd, DRM_IOCTL_GEM_OPEN, &o); in vc5_bo_open_name()
378 return vc5_bo_open_handle(screen, winsys_stride, o.handle, o.size); in vc5_bo_open_name()
382 vc5_bo_open_dmabuf(struct vc5_screen *screen, int fd, uint32_t winsys_stride) in vc5_bo_open_dmabuf() argument
385 int ret = drmPrimeFDToHandle(screen->fd, fd, &handle); in vc5_bo_open_dmabuf()
399 return vc5_bo_open_handle(screen, winsys_stride, handle, size); in vc5_bo_open_dmabuf()
406 int ret = drmPrimeHandleToFD(bo->screen->fd, bo->handle, in vc5_bo_get_dmabuf()
414 mtx_lock(&bo->screen->bo_handles_mutex); in vc5_bo_get_dmabuf()
416 util_hash_table_set(bo->screen->bo_handles, (void *)(uintptr_t)bo->handle, bo); in vc5_bo_get_dmabuf()
417 mtx_unlock(&bo->screen->bo_handles_mutex); in vc5_bo_get_dmabuf()
428 int ret = vc5_ioctl(bo->screen->fd, DRM_IOCTL_GEM_FLINK, &flink); in vc5_bo_flink()
457 vc5_wait_seqno(struct vc5_screen *screen, uint64_t seqno, uint64_t timeout_ns, in vc5_wait_seqno() argument
460 if (screen->finished_seqno >= seqno) in vc5_wait_seqno()
464 if (vc5_wait_seqno_ioctl(screen->fd, seqno, 0) == -ETIME) { in vc5_wait_seqno()
470 int ret = vc5_wait_seqno_ioctl(screen->fd, seqno, timeout_ns); in vc5_wait_seqno()
480 screen->finished_seqno = seqno; in vc5_wait_seqno()
501 struct vc5_screen *screen = bo->screen; in vc5_bo_wait() local
504 if (vc5_wait_bo_ioctl(screen->fd, bo->handle, 0) == -ETIME) { in vc5_bo_wait()
510 int ret = vc5_wait_bo_ioctl(screen->fd, bo->handle, timeout_ns); in vc5_bo_wait()
535 ret = vc5_ioctl(bo->screen->fd, DRM_IOCTL_VC5_MMAP_BO, &map); in vc5_bo_map_unsynchronized()
543 bo->screen->fd, offset); in vc5_bo_map_unsynchronized()
571 struct vc5_screen *screen = vc5_screen(pscreen); in vc5_bufmgr_destroy() local
572 struct vc5_bo_cache *cache = &screen->bo_cache; in vc5_bufmgr_destroy()
578 vc5_bo_dump_stats(screen); in vc5_bufmgr_destroy()