xref: /linux/drivers/gpu/drm/etnaviv/etnaviv_cmdbuf.h (revision ea1f5729aa1bbe68f9a394e259288d6ff894b0aa)
1*ea1f5729SLucas Stach /*
2*ea1f5729SLucas Stach  * Copyright (C) 2017 Etnaviv Project
3*ea1f5729SLucas Stach  *
4*ea1f5729SLucas Stach  * This program is free software; you can redistribute it and/or modify it
5*ea1f5729SLucas Stach  * under the terms of the GNU General Public License version 2 as published by
6*ea1f5729SLucas Stach  * the Free Software Foundation.
7*ea1f5729SLucas Stach  *
8*ea1f5729SLucas Stach  * This program is distributed in the hope that it will be useful, but WITHOUT
9*ea1f5729SLucas Stach  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10*ea1f5729SLucas Stach  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
11*ea1f5729SLucas Stach  * more details.
12*ea1f5729SLucas Stach  *
13*ea1f5729SLucas Stach  * You should have received a copy of the GNU General Public License along with
14*ea1f5729SLucas Stach  * this program.  If not, see <http://www.gnu.org/licenses/>.
15*ea1f5729SLucas Stach  */
16*ea1f5729SLucas Stach 
17*ea1f5729SLucas Stach #ifndef __ETNAVIV_CMDBUF_H__
18*ea1f5729SLucas Stach #define __ETNAVIV_CMDBUF_H__
19*ea1f5729SLucas Stach 
20*ea1f5729SLucas Stach #include <drm/drm_mm.h>
21*ea1f5729SLucas Stach #include <linux/types.h>
22*ea1f5729SLucas Stach 
23*ea1f5729SLucas Stach struct etnaviv_cmdbuf {
24*ea1f5729SLucas Stach 	/* device this cmdbuf is allocated for */
25*ea1f5729SLucas Stach 	struct etnaviv_gpu *gpu;
26*ea1f5729SLucas Stach 	/* user context key, must be unique between all active users */
27*ea1f5729SLucas Stach 	struct etnaviv_file_private *ctx;
28*ea1f5729SLucas Stach 	/* cmdbuf properties */
29*ea1f5729SLucas Stach 	void *vaddr;
30*ea1f5729SLucas Stach 	dma_addr_t paddr;
31*ea1f5729SLucas Stach 	u32 size;
32*ea1f5729SLucas Stach 	u32 user_size;
33*ea1f5729SLucas Stach 	/* vram node used if the cmdbuf is mapped through the MMUv2 */
34*ea1f5729SLucas Stach 	struct drm_mm_node vram_node;
35*ea1f5729SLucas Stach 	/* fence after which this buffer is to be disposed */
36*ea1f5729SLucas Stach 	struct dma_fence *fence;
37*ea1f5729SLucas Stach 	/* target exec state */
38*ea1f5729SLucas Stach 	u32 exec_state;
39*ea1f5729SLucas Stach 	/* per GPU in-flight list */
40*ea1f5729SLucas Stach 	struct list_head node;
41*ea1f5729SLucas Stach 	/* BOs attached to this command buffer */
42*ea1f5729SLucas Stach 	unsigned int nr_bos;
43*ea1f5729SLucas Stach 	struct etnaviv_vram_mapping *bo_map[0];
44*ea1f5729SLucas Stach };
45*ea1f5729SLucas Stach 
46*ea1f5729SLucas Stach #endif /* __ETNAVIV_CMDBUF_H__ */
47