]> Git Repo - linux.git/blob - drivers/gpu/drm/amd/amdgpu/amdgpu_rlc.h
drm/amdgpu: separate amdgpu_rlc into a single file
[linux.git] / drivers / gpu / drm / amd / amdgpu / amdgpu_rlc.h
1
2 /*
3  * Copyright 2014 Advanced Micro Devices, Inc.
4  *
5  * Permission is hereby granted, free of charge, to any person obtaining a
6  * copy of this software and associated documentation files (the "Software"),
7  * to deal in the Software without restriction, including without limitation
8  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9  * and/or sell copies of the Software, and to permit persons to whom the
10  * Software is furnished to do so, subject to the following conditions:
11  *
12  * The above copyright notice and this permission notice shall be included in
13  * all copies or substantial portions of the Software.
14  *
15  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
18  * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
19  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
20  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
21  * OTHER DEALINGS IN THE SOFTWARE.
22  *
23  */
24
25 #ifndef __AMDGPU_RLC_H__
26 #define __AMDGPU_RLC_H__
27
28 #include "clearstate_defs.h"
29
30 struct amdgpu_rlc_funcs {
31         void (*enter_safe_mode)(struct amdgpu_device *adev);
32         void (*exit_safe_mode)(struct amdgpu_device *adev);
33         int  (*init)(struct amdgpu_device *adev);
34         int  (*resume)(struct amdgpu_device *adev);
35         void (*stop)(struct amdgpu_device *adev);
36         void (*reset)(struct amdgpu_device *adev);
37         void (*start)(struct amdgpu_device *adev);
38 };
39
40 struct amdgpu_rlc {
41         /* for power gating */
42         struct amdgpu_bo        *save_restore_obj;
43         uint64_t                save_restore_gpu_addr;
44         volatile uint32_t       *sr_ptr;
45         const u32               *reg_list;
46         u32                     reg_list_size;
47         /* for clear state */
48         struct amdgpu_bo        *clear_state_obj;
49         uint64_t                clear_state_gpu_addr;
50         volatile uint32_t       *cs_ptr;
51         const struct cs_section_def   *cs_data;
52         u32                     clear_state_size;
53         /* for cp tables */
54         struct amdgpu_bo        *cp_table_obj;
55         uint64_t                cp_table_gpu_addr;
56         volatile uint32_t       *cp_table_ptr;
57         u32                     cp_table_size;
58
59         /* safe mode for updating CG/PG state */
60         bool in_safe_mode;
61         const struct amdgpu_rlc_funcs *funcs;
62
63         /* for firmware data */
64         u32 save_and_restore_offset;
65         u32 clear_state_descriptor_offset;
66         u32 avail_scratch_ram_locations;
67         u32 reg_restore_list_size;
68         u32 reg_list_format_start;
69         u32 reg_list_format_separate_start;
70         u32 starting_offsets_start;
71         u32 reg_list_format_size_bytes;
72         u32 reg_list_size_bytes;
73         u32 reg_list_format_direct_reg_list_length;
74         u32 save_restore_list_cntl_size_bytes;
75         u32 save_restore_list_gpm_size_bytes;
76         u32 save_restore_list_srm_size_bytes;
77
78         u32 *register_list_format;
79         u32 *register_restore;
80         u8 *save_restore_list_cntl;
81         u8 *save_restore_list_gpm;
82         u8 *save_restore_list_srm;
83
84         bool is_rlc_v2_1;
85 };
86
87 void amdgpu_gfx_rlc_fini(struct amdgpu_device *adev);
88
89 #endif
This page took 0.035547 seconds and 4 git commands to generate.