xref: /linux/drivers/gpu/drm/nouveau/include/nvhw/class/cl507c.h (revision 4b4193256c8d3bc3a5397b5cd9494c2ad386317d)
1 /*
2  * Copyright (c) 1993-2014, NVIDIA CORPORATION. All rights reserved.
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining a
5  * copy of this software and associated documentation files (the "Software"),
6  * to deal in the Software without restriction, including without limitation
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8  * and/or sell copies of the Software, and to permit persons to whom the
9  * Software is furnished to do so, subject to the following conditions:
10  *
11  * The above copyright notice and this permission notice shall be included in
12  * all copies or substantial portions of the Software.
13  *
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
17  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20  * DEALINGS IN THE SOFTWARE.
21  */
22 
23 
24 #ifndef _cl507c_h_
25 #define _cl507c_h_
26 
27 #define NV_DISP_BASE_NOTIFIER_1                                                      0x00000000
28 #define NV_DISP_BASE_NOTIFIER_1_SIZEOF                                               0x00000004
29 #define NV_DISP_BASE_NOTIFIER_1__0                                                   0x00000000
30 #define NV_DISP_BASE_NOTIFIER_1__0_PRESENTATION_COUNT                                15:0
31 #define NV_DISP_BASE_NOTIFIER_1__0_TIMESTAMP                                         29:16
32 #define NV_DISP_BASE_NOTIFIER_1__0_STATUS                                            31:30
33 #define NV_DISP_BASE_NOTIFIER_1__0_STATUS_NOT_BEGUN                                  0x00000000
34 #define NV_DISP_BASE_NOTIFIER_1__0_STATUS_BEGUN                                      0x00000001
35 #define NV_DISP_BASE_NOTIFIER_1__0_STATUS_FINISHED                                   0x00000002
36 
37 
38 // dma opcode instructions
39 #define NV507C_DMA                                     0x00000000
40 #define NV507C_DMA_OPCODE                                   31:29
41 #define NV507C_DMA_OPCODE_METHOD                       0x00000000
42 #define NV507C_DMA_OPCODE_JUMP                         0x00000001
43 #define NV507C_DMA_OPCODE_NONINC_METHOD                0x00000002
44 #define NV507C_DMA_OPCODE_SET_SUBDEVICE_MASK           0x00000003
45 #define NV507C_DMA_OPCODE                                   31:29
46 #define NV507C_DMA_OPCODE_METHOD                       0x00000000
47 #define NV507C_DMA_OPCODE_NONINC_METHOD                0x00000002
48 #define NV507C_DMA_METHOD_COUNT                             27:18
49 #define NV507C_DMA_METHOD_OFFSET                             11:2
50 #define NV507C_DMA_DATA                                      31:0
51 #define NV507C_DMA_NOP                                 0x00000000
52 #define NV507C_DMA_OPCODE                                   31:29
53 #define NV507C_DMA_OPCODE_JUMP                         0x00000001
54 #define NV507C_DMA_JUMP_OFFSET                               11:2
55 #define NV507C_DMA_OPCODE                                   31:29
56 #define NV507C_DMA_OPCODE_SET_SUBDEVICE_MASK           0x00000003
57 #define NV507C_DMA_SET_SUBDEVICE_MASK_VALUE                  11:0
58 
59 // class methods
60 #define NV507C_PUT                                                              (0x00000000)
61 #define NV507C_PUT_PTR                                                          11:2
62 #define NV507C_GET                                                              (0x00000004)
63 #define NV507C_GET_PTR                                                          11:2
64 #define NV507C_UPDATE                                                           (0x00000080)
65 #define NV507C_UPDATE_INTERLOCK_WITH_CORE                                       0:0
66 #define NV507C_UPDATE_INTERLOCK_WITH_CORE_DISABLE                               (0x00000000)
67 #define NV507C_UPDATE_INTERLOCK_WITH_CORE_ENABLE                                (0x00000001)
68 #define NV507C_SET_PRESENT_CONTROL                                              (0x00000084)
69 #define NV507C_SET_PRESENT_CONTROL_BEGIN_MODE                                   9:8
70 #define NV507C_SET_PRESENT_CONTROL_BEGIN_MODE_NON_TEARING                       (0x00000000)
71 #define NV507C_SET_PRESENT_CONTROL_BEGIN_MODE_IMMEDIATE                         (0x00000001)
72 #define NV507C_SET_PRESENT_CONTROL_BEGIN_MODE_ON_LINE                           (0x00000002)
73 #define NV507C_SET_PRESENT_CONTROL_MIN_PRESENT_INTERVAL                         7:4
74 #define NV507C_SET_PRESENT_CONTROL_BEGIN_LINE                                   30:16
75 #define NV507C_SET_PRESENT_CONTROL_ON_LINE_MARGIN                               15:10
76 #define NV507C_SET_SEMAPHORE_CONTROL                                            (0x00000088)
77 #define NV507C_SET_SEMAPHORE_CONTROL_OFFSET                                     11:2
78 #define NV507C_SET_SEMAPHORE_ACQUIRE                                            (0x0000008C)
79 #define NV507C_SET_SEMAPHORE_ACQUIRE_VALUE                                      31:0
80 #define NV507C_SET_SEMAPHORE_RELEASE                                            (0x00000090)
81 #define NV507C_SET_SEMAPHORE_RELEASE_VALUE                                      31:0
82 #define NV507C_SET_CONTEXT_DMA_SEMAPHORE                                        (0x00000094)
83 #define NV507C_SET_CONTEXT_DMA_SEMAPHORE_HANDLE                                 31:0
84 #define NV507C_SET_NOTIFIER_CONTROL                                             (0x000000A0)
85 #define NV507C_SET_NOTIFIER_CONTROL_MODE                                        30:30
86 #define NV507C_SET_NOTIFIER_CONTROL_MODE_WRITE                                  (0x00000000)
87 #define NV507C_SET_NOTIFIER_CONTROL_MODE_WRITE_AWAKEN                           (0x00000001)
88 #define NV507C_SET_NOTIFIER_CONTROL_OFFSET                                      11:2
89 #define NV507C_SET_CONTEXT_DMA_NOTIFIER                                         (0x000000A4)
90 #define NV507C_SET_CONTEXT_DMA_NOTIFIER_HANDLE                                  31:0
91 #define NV507C_SET_CONTEXT_DMA_ISO                                              (0x000000C0)
92 #define NV507C_SET_CONTEXT_DMA_ISO_HANDLE                                       31:0
93 #define NV507C_SET_BASE_LUT_LO                                                  (0x000000E0)
94 #define NV507C_SET_BASE_LUT_LO_ENABLE                                           31:30
95 #define NV507C_SET_BASE_LUT_LO_ENABLE_DISABLE                                   (0x00000000)
96 #define NV507C_SET_BASE_LUT_LO_ENABLE_USE_CORE_LUT                              (0x00000001)
97 #define NV507C_SET_BASE_LUT_LO_ENABLE_ENABLE                                    (0x00000003)
98 #define NV507C_SET_BASE_LUT_LO_MODE                                             29:29
99 #define NV507C_SET_BASE_LUT_LO_MODE_LORES                                       (0x00000000)
100 #define NV507C_SET_BASE_LUT_LO_MODE_HIRES                                       (0x00000001)
101 #define NV507C_SET_BASE_LUT_LO_ORIGIN                                           7:2
102 #define NV507C_SET_PROCESSING                                                   (0x00000110)
103 #define NV507C_SET_PROCESSING_USE_GAIN_OFS                                      0:0
104 #define NV507C_SET_PROCESSING_USE_GAIN_OFS_DISABLE                              (0x00000000)
105 #define NV507C_SET_PROCESSING_USE_GAIN_OFS_ENABLE                               (0x00000001)
106 #define NV507C_SET_CONVERSION                                                   (0x00000114)
107 #define NV507C_SET_CONVERSION_GAIN                                              15:0
108 #define NV507C_SET_CONVERSION_OFS                                               31:16
109 
110 #define NV507C_SURFACE_SET_OFFSET(a,b)                                          (0x00000800 + (a)*0x00000020 + (b)*0x00000004)
111 #define NV507C_SURFACE_SET_OFFSET_ORIGIN                                        31:0
112 #define NV507C_SURFACE_SET_SIZE(a)                                              (0x00000808 + (a)*0x00000020)
113 #define NV507C_SURFACE_SET_SIZE_WIDTH                                           14:0
114 #define NV507C_SURFACE_SET_SIZE_HEIGHT                                          30:16
115 #define NV507C_SURFACE_SET_STORAGE(a)                                           (0x0000080C + (a)*0x00000020)
116 #define NV507C_SURFACE_SET_STORAGE_BLOCK_HEIGHT                                 3:0
117 #define NV507C_SURFACE_SET_STORAGE_BLOCK_HEIGHT_ONE_GOB                         (0x00000000)
118 #define NV507C_SURFACE_SET_STORAGE_BLOCK_HEIGHT_TWO_GOBS                        (0x00000001)
119 #define NV507C_SURFACE_SET_STORAGE_BLOCK_HEIGHT_FOUR_GOBS                       (0x00000002)
120 #define NV507C_SURFACE_SET_STORAGE_BLOCK_HEIGHT_EIGHT_GOBS                      (0x00000003)
121 #define NV507C_SURFACE_SET_STORAGE_BLOCK_HEIGHT_SIXTEEN_GOBS                    (0x00000004)
122 #define NV507C_SURFACE_SET_STORAGE_BLOCK_HEIGHT_THIRTYTWO_GOBS                  (0x00000005)
123 #define NV507C_SURFACE_SET_STORAGE_PITCH                                        17:8
124 #define NV507C_SURFACE_SET_STORAGE_MEMORY_LAYOUT                                20:20
125 #define NV507C_SURFACE_SET_STORAGE_MEMORY_LAYOUT_BLOCKLINEAR                    (0x00000000)
126 #define NV507C_SURFACE_SET_STORAGE_MEMORY_LAYOUT_PITCH                          (0x00000001)
127 #define NV507C_SURFACE_SET_PARAMS(a)                                            (0x00000810 + (a)*0x00000020)
128 #define NV507C_SURFACE_SET_PARAMS_FORMAT                                        15:8
129 #define NV507C_SURFACE_SET_PARAMS_FORMAT_I8                                     (0x0000001E)
130 #define NV507C_SURFACE_SET_PARAMS_FORMAT_VOID16                                 (0x0000001F)
131 #define NV507C_SURFACE_SET_PARAMS_FORMAT_VOID32                                 (0x0000002E)
132 #define NV507C_SURFACE_SET_PARAMS_FORMAT_RF16_GF16_BF16_AF16                    (0x000000CA)
133 #define NV507C_SURFACE_SET_PARAMS_FORMAT_A8R8G8B8                               (0x000000CF)
134 #define NV507C_SURFACE_SET_PARAMS_FORMAT_A2B10G10R10                            (0x000000D1)
135 #define NV507C_SURFACE_SET_PARAMS_FORMAT_A8B8G8R8                               (0x000000D5)
136 #define NV507C_SURFACE_SET_PARAMS_FORMAT_R5G6B5                                 (0x000000E8)
137 #define NV507C_SURFACE_SET_PARAMS_FORMAT_A1R5G5B5                               (0x000000E9)
138 #define NV507C_SURFACE_SET_PARAMS_SUPER_SAMPLE                                  1:0
139 #define NV507C_SURFACE_SET_PARAMS_SUPER_SAMPLE_X1_AA                            (0x00000000)
140 #define NV507C_SURFACE_SET_PARAMS_SUPER_SAMPLE_X4_AA                            (0x00000002)
141 #define NV507C_SURFACE_SET_PARAMS_GAMMA                                         2:2
142 #define NV507C_SURFACE_SET_PARAMS_GAMMA_LINEAR                                  (0x00000000)
143 #define NV507C_SURFACE_SET_PARAMS_GAMMA_SRGB                                    (0x00000001)
144 #define NV507C_SURFACE_SET_PARAMS_LAYOUT                                        5:4
145 #define NV507C_SURFACE_SET_PARAMS_LAYOUT_FRM                                    (0x00000000)
146 #define NV507C_SURFACE_SET_PARAMS_LAYOUT_FLD1                                   (0x00000001)
147 #define NV507C_SURFACE_SET_PARAMS_LAYOUT_FLD2                                   (0x00000002)
148 #define NV507C_SURFACE_SET_PARAMS_KIND                                          22:16
149 #define NV507C_SURFACE_SET_PARAMS_KIND_KIND_PITCH                               (0x00000000)
150 #define NV507C_SURFACE_SET_PARAMS_KIND_KIND_GENERIC_8BX2                        (0x00000070)
151 #define NV507C_SURFACE_SET_PARAMS_KIND_KIND_GENERIC_8BX2_BANKSWIZ               (0x00000072)
152 #define NV507C_SURFACE_SET_PARAMS_KIND_KIND_GENERIC_16BX1                       (0x00000074)
153 #define NV507C_SURFACE_SET_PARAMS_KIND_KIND_GENERIC_16BX1_BANKSWIZ              (0x00000076)
154 #define NV507C_SURFACE_SET_PARAMS_KIND_KIND_C32_MS4                             (0x00000078)
155 #define NV507C_SURFACE_SET_PARAMS_KIND_KIND_C32_MS8                             (0x00000079)
156 #define NV507C_SURFACE_SET_PARAMS_KIND_KIND_C32_MS4_BANKSWIZ                    (0x0000007A)
157 #define NV507C_SURFACE_SET_PARAMS_KIND_KIND_C32_MS8_BANKSWIZ                    (0x0000007B)
158 #define NV507C_SURFACE_SET_PARAMS_KIND_KIND_C64_MS4                             (0x0000007C)
159 #define NV507C_SURFACE_SET_PARAMS_KIND_KIND_C64_MS8                             (0x0000007D)
160 #define NV507C_SURFACE_SET_PARAMS_KIND_KIND_C128_MS4                            (0x0000007E)
161 #define NV507C_SURFACE_SET_PARAMS_KIND_FROM_PTE                                 (0x0000007F)
162 #define NV507C_SURFACE_SET_PARAMS_PART_STRIDE                                   24:24
163 #define NV507C_SURFACE_SET_PARAMS_PART_STRIDE_PARTSTRIDE_256                    (0x00000000)
164 #define NV507C_SURFACE_SET_PARAMS_PART_STRIDE_PARTSTRIDE_1024                   (0x00000001)
165 #endif // _cl507c_h
166