#pragma once #if defined (__cplusplus) extern "C" { #endif #include #include "CustomAssert.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include //normal nodes? //modesetting can be done #define DRM_IOCTL_CTRL_DEV_FILE_NAME "/dev/dri/card0" //render nodes //no modesetting --> so only for offscreen rendering #define DRM_IOCTL_RENDER_DEV_FILE_NAME "/dev/dri/renderD128" #define WAIT_TIMEOUT_INFINITE 0xffffffffffffffffull #define ARM_PAGE_SIZE 4096 int openIoctl(); void closeIoctl(); int vc4_get_chip_info(int fd); int vc4_has_feature(int fd, uint32_t feature); int vc4_test_tiling(int fd); uint64_t vc4_bo_get_tiling(int fd, uint32_t bo, uint64_t mod); int vc4_bo_set_tiling(int fd, uint32_t bo, uint64_t mod); void* vc4_bo_map_unsynchronized(int fd, uint32_t bo, uint32_t offset, uint32_t size); void vc4_bo_unmap_unsynchronized(int fd, void* ptr, uint32_t size); //int vc4_bo_wait_ioctl(int fd, uint32_t handle, uint64_t timeout_ns); int vc4_bo_wait(int fd, uint32_t bo, uint64_t timeout_ns); //int vc4_seqno_wait_ioctl(int fd, uint64_t seqno, uint64_t timeout_ns); int vc4_seqno_wait(int fd, uint64_t* lastFinishedSeqno, uint64_t seqno, uint64_t* timeout_ns); int vc4_bo_flink(int fd, uint32_t bo, uint32_t *name); uint32_t vc4_bo_alloc_shader(int fd, const void *data, uint32_t* size); uint32_t vc4_bo_open_name(int fd, uint32_t name); uint32_t vc4_bo_alloc(int fd, uint32_t size, const char *name); void vc4_bo_free(int fd, uint32_t bo, void* mappedAddr, uint32_t size); int vc4_bo_unpurgeable(int fd, uint32_t bo, int hasMadvise); void vc4_bo_purgeable(int fd, uint32_t bo, int hasMadvise); void vc4_bo_label(int fd, uint32_t bo, const char* name); int vc4_bo_get_dmabuf(int fd, uint32_t bo); void* vc4_bo_map(int fd, uint32_t bo, uint32_t offset, uint32_t size); void vc4_cl_submit(int fd, struct drm_vc4_submit_cl* submit, uint64_t* lastEmittedSeqno, uint64_t* lastFinishedSeqno); uint32_t getBOAlignedSize(uint32_t size); //TODO perfmon #if defined (__cplusplus) } #endif