hc
2023-12-11 6778948f9de86c3cfaf36725a7c87dcff9ba247f
kernel/drivers/gpu/drm/msm/adreno/a5xx_gpu.h
....@@ -1,14 +1,5 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 /* Copyright (c) 2016-2017 The Linux Foundation. All rights reserved.
2
- *
3
- * This program is free software; you can redistribute it and/or modify
4
- * it under the terms of the GNU General Public License version 2 and
5
- * only version 2 as published by the Free Software Foundation.
6
- *
7
- * This program is distributed in the hope that it will be useful,
8
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
9
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
- * GNU General Public License for more details.
11
- *
123 */
134 #ifndef __A5XX_GPU_H__
145 #define __A5XX_GPU_H__
....@@ -40,17 +31,25 @@
4031 struct msm_ringbuffer *next_ring;
4132
4233 struct drm_gem_object *preempt_bo[MSM_GPU_MAX_RINGS];
34
+ struct drm_gem_object *preempt_counters_bo[MSM_GPU_MAX_RINGS];
4335 struct a5xx_preempt_record *preempt[MSM_GPU_MAX_RINGS];
4436 uint64_t preempt_iova[MSM_GPU_MAX_RINGS];
4537
4638 atomic_t preempt_state;
4739 struct timer_list preempt_timer;
40
+
41
+ struct drm_gem_object *shadow_bo;
42
+ uint64_t shadow_iova;
43
+ uint32_t *shadow;
44
+
45
+ /* True if the microcode supports the WHERE_AM_I opcode */
46
+ bool has_whereami;
4847 };
4948
5049 #define to_a5xx_gpu(x) container_of(x, struct a5xx_gpu, base)
5150
5251 #ifdef CONFIG_DEBUG_FS
53
-int a5xx_debugfs_init(struct msm_gpu *gpu, struct drm_minor *minor);
52
+void a5xx_debugfs_init(struct msm_gpu *gpu, struct drm_minor *minor);
5453 #endif
5554
5655 /*
....@@ -149,6 +148,9 @@
149148 return -ETIMEDOUT;
150149 }
151150
151
+#define shadowptr(a5xx_gpu, ring) ((a5xx_gpu)->shadow_iova + \
152
+ ((ring)->id * sizeof(uint32_t)))
153
+
152154 bool a5xx_idle(struct msm_gpu *gpu, struct msm_ringbuffer *ring);
153155 void a5xx_set_hwcg(struct msm_gpu *gpu, bool state);
154156
....@@ -158,6 +160,8 @@
158160 void a5xx_preempt_irq(struct msm_gpu *gpu);
159161 void a5xx_preempt_fini(struct msm_gpu *gpu);
160162
163
+void a5xx_flush(struct msm_gpu *gpu, struct msm_ringbuffer *ring, bool sync);
164
+
161165 /* Return true if we are in a preempt state */
162166 static inline bool a5xx_in_preempt(struct a5xx_gpu *a5xx_gpu)
163167 {