1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Copyright (C) 2017 Etnaviv Project
6 #ifndef __ETNAVIV_CMDBUF_H__
7 #define __ETNAVIV_CMDBUF_H__
9 #include <linux/types.h>
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 */
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
,
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__ */