Merge tag 'block-5.11-2021-01-10' of git://git.kernel.dk/linux-block
[linux/fpc-iii.git] / drivers / gpu / drm / etnaviv / etnaviv_cmdbuf.h
blobad6fd8eb03786d387b65248d94818e77078188fd
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3 * Copyright (C) 2017 Etnaviv Project
4 */
6 #ifndef __ETNAVIV_CMDBUF_H__
7 #define __ETNAVIV_CMDBUF_H__
9 #include <linux/types.h>
11 struct device;
12 struct etnaviv_iommu_context;
13 struct etnaviv_vram_mapping;
14 struct etnaviv_cmdbuf_suballoc;
15 struct etnaviv_perfmon_request;
17 struct 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;
27 struct etnaviv_cmdbuf_suballoc *
28 etnaviv_cmdbuf_suballoc_new(struct device *dev);
29 void etnaviv_cmdbuf_suballoc_destroy(struct etnaviv_cmdbuf_suballoc *suballoc);
30 int 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);
34 void etnaviv_cmdbuf_suballoc_unmap(struct etnaviv_iommu_context *context,
35 struct etnaviv_vram_mapping *mapping);
38 int etnaviv_cmdbuf_init(struct etnaviv_cmdbuf_suballoc *suballoc,
39 struct etnaviv_cmdbuf *cmdbuf, u32 size);
40 void etnaviv_cmdbuf_free(struct etnaviv_cmdbuf *cmdbuf);
42 u32 etnaviv_cmdbuf_get_va(struct etnaviv_cmdbuf *buf,
43 struct etnaviv_vram_mapping *mapping);
44 dma_addr_t etnaviv_cmdbuf_get_pa(struct etnaviv_cmdbuf *buf);
46 #endif /* __ETNAVIV_CMDBUF_H__ */