1 /* SPDX-License-Identifier: GPL-2.0 */ 2 /* 3 * Copyright (C) 2017 Etnaviv Project 4 */ 5 6 #ifndef __ETNAVIV_CMDBUF_H__ 7 #define __ETNAVIV_CMDBUF_H__ 8 9 #include <linux/types.h> 10 11 struct etnaviv_gpu; 12 struct etnaviv_cmdbuf_suballoc; 13 struct etnaviv_perfmon_request; 14 15 struct etnaviv_cmdbuf { 16 /* suballocator this cmdbuf is allocated from */ 17 struct etnaviv_cmdbuf_suballoc *suballoc; 18 /* cmdbuf properties */ 19 int suballoc_offset; 20 void *vaddr; 21 u32 size; 22 u32 user_size; 23 }; 24 25 struct etnaviv_cmdbuf_suballoc * 26 etnaviv_cmdbuf_suballoc_new(struct etnaviv_gpu * gpu); 27 void etnaviv_cmdbuf_suballoc_destroy(struct etnaviv_cmdbuf_suballoc *suballoc); 28 29 30 int etnaviv_cmdbuf_init(struct etnaviv_cmdbuf_suballoc *suballoc, 31 struct etnaviv_cmdbuf *cmdbuf, u32 size); 32 void etnaviv_cmdbuf_free(struct etnaviv_cmdbuf *cmdbuf); 33 34 u32 etnaviv_cmdbuf_get_va(struct etnaviv_cmdbuf *buf); 35 dma_addr_t etnaviv_cmdbuf_get_pa(struct etnaviv_cmdbuf *buf); 36 37 #endif /* __ETNAVIV_CMDBUF_H__ */ 38