forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-13 9d77db3c730780c8ef5ccd4b66403ff5675cfe4e
kernel/drivers/gpu/drm/msm/adreno/a6xx_gpu.h
....@@ -1,5 +1,5 @@
11 /* SPDX-License-Identifier: GPL-2.0 */
2
-/* Copyright (c) 2017 The Linux Foundation. All rights reserved. */
2
+/* Copyright (c) 2017, 2019 The Linux Foundation. All rights reserved. */
33
44 #ifndef __A6XX_GPU_H__
55 #define __A6XX_GPU_H__
....@@ -20,7 +20,23 @@
2020
2121 struct msm_ringbuffer *cur_ring;
2222
23
+ /**
24
+ * cur_ctx_seqno:
25
+ *
26
+ * The ctx->seqno value of the context with current pgtables
27
+ * installed. Tracked by seqno rather than pointer value to
28
+ * avoid dangling pointers, and cases where a ctx can be freed
29
+ * and a new one created with the same address.
30
+ */
31
+ int cur_ctx_seqno;
32
+
2333 struct a6xx_gmu gmu;
34
+
35
+ struct drm_gem_object *shadow_bo;
36
+ uint64_t shadow_iova;
37
+ uint32_t *shadow;
38
+
39
+ bool has_whereami;
2440 };
2541
2642 #define to_a6xx_gpu(x) container_of(x, struct a6xx_gpu, base)
....@@ -30,7 +46,7 @@
3046 * REG_CP_PROTECT_REG(n) - this will block both reads and writes for _len
3147 * registers starting at _reg.
3248 */
33
-#define A6XX_PROTECT_RW(_reg, _len) \
49
+#define A6XX_PROTECT_NORDWR(_reg, _len) \
3450 ((1 << 31) | \
3551 (((_len) & 0x3FFF) << 18) | ((_reg) & 0x3FFFF))
3652
....@@ -42,19 +58,37 @@
4258 #define A6XX_PROTECT_RDONLY(_reg, _len) \
4359 ((((_len) & 0x3FFF) << 18) | ((_reg) & 0x3FFFF))
4460
61
+static inline bool a6xx_has_gbif(struct adreno_gpu *gpu)
62
+{
63
+ if(adreno_is_a630(gpu))
64
+ return false;
65
+
66
+ return true;
67
+}
68
+
69
+#define shadowptr(_a6xx_gpu, _ring) ((_a6xx_gpu)->shadow_iova + \
70
+ ((_ring)->id * sizeof(uint32_t)))
4571
4672 int a6xx_gmu_resume(struct a6xx_gpu *gpu);
4773 int a6xx_gmu_stop(struct a6xx_gpu *gpu);
4874
49
-int a6xx_gmu_wait_for_idle(struct a6xx_gpu *gpu);
75
+int a6xx_gmu_wait_for_idle(struct a6xx_gmu *gmu);
5076
51
-int a6xx_gmu_reset(struct a6xx_gpu *a6xx_gpu);
5277 bool a6xx_gmu_isidle(struct a6xx_gmu *gmu);
5378
5479 int a6xx_gmu_set_oob(struct a6xx_gmu *gmu, enum a6xx_gmu_oob_state state);
5580 void a6xx_gmu_clear_oob(struct a6xx_gmu *gmu, enum a6xx_gmu_oob_state state);
5681
57
-int a6xx_gmu_probe(struct a6xx_gpu *a6xx_gpu, struct device_node *node);
82
+int a6xx_gmu_init(struct a6xx_gpu *a6xx_gpu, struct device_node *node);
5883 void a6xx_gmu_remove(struct a6xx_gpu *a6xx_gpu);
5984
85
+void a6xx_gmu_set_freq(struct msm_gpu *gpu, struct dev_pm_opp *opp);
86
+unsigned long a6xx_gmu_get_freq(struct msm_gpu *gpu);
87
+
88
+void a6xx_show(struct msm_gpu *gpu, struct msm_gpu_state *state,
89
+ struct drm_printer *p);
90
+
91
+struct msm_gpu_state *a6xx_gpu_state_get(struct msm_gpu *gpu);
92
+int a6xx_gpu_state_put(struct msm_gpu_state *state);
93
+
6094 #endif /* __A6XX_GPU_H__ */