diff options
author | Lucas Stach <l.stach@pengutronix.de> | 2017-01-16 16:09:51 +0100 |
---|---|---|
committer | Lucas Stach <l.stach@pengutronix.de> | 2017-02-02 10:30:15 +0100 |
commit | ea1f5729aa1bbe68f9a394e259288d6ff894b0aa (patch) | |
tree | b0f0d773e44d3eec4bfe48756df6420ec6393d88 /drivers/gpu/drm/etnaviv/etnaviv_cmdbuf.h | |
parent | drm/etnaviv: always flush MMU TLBs on map/unmap (diff) | |
download | linux-ea1f5729aa1bbe68f9a394e259288d6ff894b0aa.tar.xz linux-ea1f5729aa1bbe68f9a394e259288d6ff894b0aa.zip |
drm/etnaviv: move cmdbuf de-/allocation into own file
This will get more complex with the following changes, so move it
into its own place.
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Diffstat (limited to 'drivers/gpu/drm/etnaviv/etnaviv_cmdbuf.h')
-rw-r--r-- | drivers/gpu/drm/etnaviv/etnaviv_cmdbuf.h | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_cmdbuf.h b/drivers/gpu/drm/etnaviv/etnaviv_cmdbuf.h new file mode 100644 index 000000000000..883f03960f95 --- /dev/null +++ b/drivers/gpu/drm/etnaviv/etnaviv_cmdbuf.h @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2017 Etnaviv Project + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published by + * the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#ifndef __ETNAVIV_CMDBUF_H__ +#define __ETNAVIV_CMDBUF_H__ + +#include <drm/drm_mm.h> +#include <linux/types.h> + +struct etnaviv_cmdbuf { + /* device this cmdbuf is allocated for */ + struct etnaviv_gpu *gpu; + /* user context key, must be unique between all active users */ + struct etnaviv_file_private *ctx; + /* cmdbuf properties */ + void *vaddr; + dma_addr_t paddr; + u32 size; + u32 user_size; + /* vram node used if the cmdbuf is mapped through the MMUv2 */ + struct drm_mm_node vram_node; + /* fence after which this buffer is to be disposed */ + struct dma_fence *fence; + /* target exec state */ + u32 exec_state; + /* per GPU in-flight list */ + struct list_head node; + /* BOs attached to this command buffer */ + unsigned int nr_bos; + struct etnaviv_vram_mapping *bo_map[0]; +}; + +#endif /* __ETNAVIV_CMDBUF_H__ */ |