Lines Matching refs:screen

52 vc4_bo_label(struct vc4_screen *screen, struct vc4_bo *bo, const char *fmt, ...)  in vc4_bo_label()  argument
72 vc4_ioctl(screen->fd, DRM_IOCTL_VC4_LABEL_BO, &label); in vc4_bo_label()
78 vc4_bo_dump_stats(struct vc4_screen *screen) in vc4_bo_dump_stats() argument
80 struct vc4_bo_cache *cache = &screen->bo_cache; in vc4_bo_dump_stats()
82 fprintf(stderr, " BOs allocated: %d\n", screen->bo_count); in vc4_bo_dump_stats()
83 fprintf(stderr, " BOs size: %dkb\n", screen->bo_size / 1024); in vc4_bo_dump_stats()
123 if (bo->screen->has_madvise) in vc4_bo_purgeable()
124 vc4_ioctl(bo->screen->fd, DRM_IOCTL_VC4_GEM_MADVISE, &arg); in vc4_bo_purgeable()
134 if (!bo->screen->has_madvise) in vc4_bo_unpurgeable()
137 if (vc4_ioctl(bo->screen->fd, DRM_IOCTL_VC4_GEM_MADVISE, &arg)) in vc4_bo_unpurgeable()
146 struct vc4_screen *screen = bo->screen; in vc4_bo_free() local
161 int ret = vc4_ioctl(screen->fd, DRM_IOCTL_GEM_CLOSE, &c); in vc4_bo_free()
165 screen->bo_count--; in vc4_bo_free()
166 screen->bo_size -= bo->size; in vc4_bo_free()
173 vc4_bo_dump_stats(screen); in vc4_bo_free()
180 vc4_bo_from_cache(struct vc4_screen *screen, uint32_t size, const char *name) in vc4_bo_from_cache() argument
182 struct vc4_bo_cache *cache = &screen->bo_cache; in vc4_bo_from_cache()
212 vc4_bo_label(screen, bo, "%s", name); in vc4_bo_from_cache()
221 vc4_bo_alloc(struct vc4_screen *screen, uint32_t size, const char *name) in vc4_bo_alloc() argument
230 bo = vc4_bo_from_cache(screen, size, name); in vc4_bo_alloc()
235 vc4_bo_dump_stats(screen); in vc4_bo_alloc()
245 bo->screen = screen; in vc4_bo_alloc()
254 ret = vc4_ioctl(screen->fd, DRM_IOCTL_VC4_CREATE_BO, &create); in vc4_bo_alloc()
258 if (!list_empty(&screen->bo_cache.time_list) && in vc4_bo_alloc()
261 vc4_bo_cache_free_all(&screen->bo_cache); in vc4_bo_alloc()
269 screen->bo_count++; in vc4_bo_alloc()
270 screen->bo_size += bo->size; in vc4_bo_alloc()
273 vc4_bo_dump_stats(screen); in vc4_bo_alloc()
276 vc4_bo_label(screen, bo, "%s", name); in vc4_bo_alloc()
284 struct vc4_screen *screen = bo->screen; in vc4_bo_last_unreference() local
288 mtx_lock(&screen->bo_cache.lock); in vc4_bo_last_unreference()
290 mtx_unlock(&screen->bo_cache.lock); in vc4_bo_last_unreference()
294 free_stale_bos(struct vc4_screen *screen, time_t time) in free_stale_bos() argument
296 struct vc4_bo_cache *cache = &screen->bo_cache; in free_stale_bos()
303 vc4_bo_dump_stats(screen); in free_stale_bos()
318 vc4_bo_dump_stats(screen); in free_stale_bos()
337 struct vc4_screen *screen = bo->screen; in vc4_bo_last_unreference_locked_timed() local
338 struct vc4_bo_cache *cache = &screen->bo_cache; in vc4_bo_last_unreference_locked_timed()
348 ralloc_array(screen, struct list_head, page_index + 1); in vc4_bo_last_unreference_locked_timed()
371 vc4_bo_dump_stats(screen); in vc4_bo_last_unreference_locked_timed()
374 vc4_bo_label(screen, bo, "mesa cache"); in vc4_bo_last_unreference_locked_timed()
376 free_stale_bos(screen, time); in vc4_bo_last_unreference_locked_timed()
380 vc4_bo_open_handle(struct vc4_screen *screen, in vc4_bo_open_handle() argument
388 mtx_lock(&screen->bo_handles_mutex); in vc4_bo_open_handle()
390 bo = util_hash_table_get(screen->bo_handles, (void*)(uintptr_t)handle); in vc4_bo_open_handle()
398 bo->screen = screen; in vc4_bo_open_handle()
405 vc4_simulator_open_from_handle(screen->fd, winsys_stride, in vc4_bo_open_handle()
410 util_hash_table_set(screen->bo_handles, (void *)(uintptr_t)handle, bo); in vc4_bo_open_handle()
413 mtx_unlock(&screen->bo_handles_mutex); in vc4_bo_open_handle()
418 vc4_bo_open_name(struct vc4_screen *screen, uint32_t name, in vc4_bo_open_name() argument
424 int ret = vc4_ioctl(screen->fd, DRM_IOCTL_GEM_OPEN, &o); in vc4_bo_open_name()
431 return vc4_bo_open_handle(screen, winsys_stride, o.handle, o.size); in vc4_bo_open_name()
435 vc4_bo_open_dmabuf(struct vc4_screen *screen, int fd, uint32_t winsys_stride) in vc4_bo_open_dmabuf() argument
438 int ret = drmPrimeFDToHandle(screen->fd, fd, &handle); in vc4_bo_open_dmabuf()
452 return vc4_bo_open_handle(screen, winsys_stride, handle, size); in vc4_bo_open_dmabuf()
459 int ret = drmPrimeHandleToFD(bo->screen->fd, bo->handle, in vc4_bo_get_dmabuf()
467 mtx_lock(&bo->screen->bo_handles_mutex); in vc4_bo_get_dmabuf()
469 util_hash_table_set(bo->screen->bo_handles, (void *)(uintptr_t)bo->handle, bo); in vc4_bo_get_dmabuf()
470 mtx_unlock(&bo->screen->bo_handles_mutex); in vc4_bo_get_dmabuf()
476 vc4_bo_alloc_shader(struct vc4_screen *screen, const void *data, uint32_t size) in vc4_bo_alloc_shader() argument
486 bo->screen = screen; in vc4_bo_alloc_shader()
496 ret = vc4_ioctl(screen->fd, DRM_IOCTL_VC4_CREATE_SHADER_BO, in vc4_bo_alloc_shader()
505 screen->bo_count++; in vc4_bo_alloc_shader()
506 screen->bo_size += bo->size; in vc4_bo_alloc_shader()
509 vc4_bo_dump_stats(screen); in vc4_bo_alloc_shader()
521 int ret = vc4_ioctl(bo->screen->fd, DRM_IOCTL_GEM_FLINK, &flink); in vc4_bo_flink()
550 vc4_wait_seqno(struct vc4_screen *screen, uint64_t seqno, uint64_t timeout_ns, in vc4_wait_seqno() argument
553 if (screen->finished_seqno >= seqno) in vc4_wait_seqno()
557 if (vc4_wait_seqno_ioctl(screen->fd, seqno, 0) == -ETIME) { in vc4_wait_seqno()
563 int ret = vc4_wait_seqno_ioctl(screen->fd, seqno, timeout_ns); in vc4_wait_seqno()
573 screen->finished_seqno = seqno; in vc4_wait_seqno()
594 struct vc4_screen *screen = bo->screen; in vc4_bo_wait() local
597 if (vc4_wait_bo_ioctl(screen->fd, bo->handle, 0) == -ETIME) { in vc4_bo_wait()
603 int ret = vc4_wait_bo_ioctl(screen->fd, bo->handle, timeout_ns); in vc4_bo_wait()
628 ret = vc4_ioctl(bo->screen->fd, DRM_IOCTL_VC4_MMAP_BO, &map); in vc4_bo_map_unsynchronized()
636 bo->screen->fd, offset); in vc4_bo_map_unsynchronized()
664 struct vc4_screen *screen = vc4_screen(pscreen); in vc4_bufmgr_destroy() local
665 struct vc4_bo_cache *cache = &screen->bo_cache; in vc4_bufmgr_destroy()
671 vc4_bo_dump_stats(screen); in vc4_bufmgr_destroy()