summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/etnaviv/etnaviv_cmdbuf.h
diff options
context:
space:
mode:
authorLucas Stach <l.stach@pengutronix.de>2017-01-16 16:09:51 +0100
committerLucas Stach <l.stach@pengutronix.de>2017-02-02 10:30:15 +0100
commitea1f5729aa1bbe68f9a394e259288d6ff894b0aa (patch)
treeb0f0d773e44d3eec4bfe48756df6420ec6393d88 /drivers/gpu/drm/etnaviv/etnaviv_cmdbuf.h
parentd46450737c007b16bb81f9d5dea56d1f4b9a2c21 (diff)
downloadop-kernel-dev-ea1f5729aa1bbe68f9a394e259288d6ff894b0aa.zip
op-kernel-dev-ea1f5729aa1bbe68f9a394e259288d6ff894b0aa.tar.gz
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.h46
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 0000000..883f039
--- /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__ */
OpenPOWER on IntegriCloud