etnaviv_cmdbuf.h (1346B)
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 11struct device; 12struct etnaviv_iommu_context; 13struct etnaviv_vram_mapping; 14struct etnaviv_cmdbuf_suballoc; 15struct etnaviv_perfmon_request; 16 17struct etnaviv_cmdbuf { 18 /* suballocator this cmdbuf is allocated from */ 19 struct etnaviv_cmdbuf_suballoc *suballoc; 20 /* cmdbuf properties */ 21 int suballoc_offset; 22 void *vaddr; 23 u32 size; 24 u32 user_size; 25}; 26 27struct etnaviv_cmdbuf_suballoc * 28etnaviv_cmdbuf_suballoc_new(struct device *dev); 29void etnaviv_cmdbuf_suballoc_destroy(struct etnaviv_cmdbuf_suballoc *suballoc); 30int etnaviv_cmdbuf_suballoc_map(struct etnaviv_cmdbuf_suballoc *suballoc, 31 struct etnaviv_iommu_context *context, 32 struct etnaviv_vram_mapping *mapping, 33 u32 memory_base); 34void etnaviv_cmdbuf_suballoc_unmap(struct etnaviv_iommu_context *context, 35 struct etnaviv_vram_mapping *mapping); 36 37 38int etnaviv_cmdbuf_init(struct etnaviv_cmdbuf_suballoc *suballoc, 39 struct etnaviv_cmdbuf *cmdbuf, u32 size); 40void etnaviv_cmdbuf_free(struct etnaviv_cmdbuf *cmdbuf); 41 42u32 etnaviv_cmdbuf_get_va(struct etnaviv_cmdbuf *buf, 43 struct etnaviv_vram_mapping *mapping); 44dma_addr_t etnaviv_cmdbuf_get_pa(struct etnaviv_cmdbuf *buf); 45 46#endif /* __ETNAVIV_CMDBUF_H__ */