aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h
diff options
context:
space:
mode:
authorLikun Gao <Likun.Gao@amd.com>2018-11-08 00:43:46 -0500
committerAlex Deucher <alexander.deucher@amd.com>2018-11-09 16:29:02 -0500
commit88dfc9a3dd47027c9ffc831635e5cf4e8ed3b781 (patch)
treeaf39f500da7c656ab14c92fed89e4a0e5aefa8fb /drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h
parentfdb81fd788a732b5efda8638be3fe159550b032d (diff)
drm/amdgpu: separate amdgpu_rlc into a single file
Separate the function and struct of RLC from the file of GFX. Abstract the function of amdgpu_gfx_rlc_fini. Signed-off-by: Likun Gao <Likun.Gao@amd.com> Acked-by: Christian König <christian.koenig@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h60
1 files changed, 1 insertions, 59 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h
index 0a7c285c0454..f790e15bcd08 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h
@@ -29,6 +29,7 @@
29 */ 29 */
30#include "clearstate_defs.h" 30#include "clearstate_defs.h"
31#include "amdgpu_ring.h" 31#include "amdgpu_ring.h"
32#include "amdgpu_rlc.h"
32 33
33/* GFX current status */ 34/* GFX current status */
34#define AMDGPU_GFX_NORMAL_MODE 0x00000000L 35#define AMDGPU_GFX_NORMAL_MODE 0x00000000L
@@ -37,65 +38,6 @@
37#define AMDGPU_GFX_CG_DISABLED_MODE 0x00000004L 38#define AMDGPU_GFX_CG_DISABLED_MODE 0x00000004L
38#define AMDGPU_GFX_LBPW_DISABLED_MODE 0x00000008L 39#define AMDGPU_GFX_LBPW_DISABLED_MODE 0x00000008L
39 40
40
41struct amdgpu_rlc_funcs {
42 void (*enter_safe_mode)(struct amdgpu_device *adev);
43 void (*exit_safe_mode)(struct amdgpu_device *adev);
44 int (*init)(struct amdgpu_device *adev);
45 void (*fini)(struct amdgpu_device *adev);
46 int (*resume)(struct amdgpu_device *adev);
47 void (*stop)(struct amdgpu_device *adev);
48 void (*reset)(struct amdgpu_device *adev);
49 void (*start)(struct amdgpu_device *adev);
50};
51
52struct amdgpu_rlc {
53 /* for power gating */
54 struct amdgpu_bo *save_restore_obj;
55 uint64_t save_restore_gpu_addr;
56 volatile uint32_t *sr_ptr;
57 const u32 *reg_list;
58 u32 reg_list_size;
59 /* for clear state */
60 struct amdgpu_bo *clear_state_obj;
61 uint64_t clear_state_gpu_addr;
62 volatile uint32_t *cs_ptr;
63 const struct cs_section_def *cs_data;
64 u32 clear_state_size;
65 /* for cp tables */
66 struct amdgpu_bo *cp_table_obj;
67 uint64_t cp_table_gpu_addr;
68 volatile uint32_t *cp_table_ptr;
69 u32 cp_table_size;
70
71 /* safe mode for updating CG/PG state */
72 bool in_safe_mode;
73 const struct amdgpu_rlc_funcs *funcs;
74
75 /* for firmware data */
76 u32 save_and_restore_offset;
77 u32 clear_state_descriptor_offset;
78 u32 avail_scratch_ram_locations;
79 u32 reg_restore_list_size;
80 u32 reg_list_format_start;
81 u32 reg_list_format_separate_start;
82 u32 starting_offsets_start;
83 u32 reg_list_format_size_bytes;
84 u32 reg_list_size_bytes;
85 u32 reg_list_format_direct_reg_list_length;
86 u32 save_restore_list_cntl_size_bytes;
87 u32 save_restore_list_gpm_size_bytes;
88 u32 save_restore_list_srm_size_bytes;
89
90 u32 *register_list_format;
91 u32 *register_restore;
92 u8 *save_restore_list_cntl;
93 u8 *save_restore_list_gpm;
94 u8 *save_restore_list_srm;
95
96 bool is_rlc_v2_1;
97};
98
99#define AMDGPU_MAX_COMPUTE_QUEUES KGD_MAX_QUEUES 41#define AMDGPU_MAX_COMPUTE_QUEUES KGD_MAX_QUEUES
100 42
101struct amdgpu_mec { 43struct amdgpu_mec {