1 /******************************************************************************* 2 Copyright (c) 2020, 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 _cl004a_h_ 25 #define _cl004a_h_ 26 27 #ifdef __cplusplus 28 extern "C" { 29 #endif 30 31 #include "nvtypes.h" 32 33 #define NV04_GDI_RECTANGLE_TEXT (0x0000004A) 34 /* NvNotification[] elements */ 35 #define NV04A_NOTIFIERS_NOTIFY (0) 36 #define NV04A_NOTIFIERS_MAXCOUNT (1) 37 /* NvNotification[] fields and values */ 38 #define NV04A_NOTIFICATION_STATUS_IN_PROGRESS (0x8000) 39 #define NV04A_NOTIFICATION_STATUS_ERROR_PROTECTION_FAULT (0x4000) 40 #define NV04A_NOTIFICATION_STATUS_ERROR_BAD_ARGUMENT (0x2000) 41 #define NV04A_NOTIFICATION_STATUS_ERROR_INVALID_STATE (0x1000) 42 #define NV04A_NOTIFICATION_STATUS_ERROR_STATE_IN_USE (0x0800) 43 #define NV04A_NOTIFICATION_STATUS_DONE_SUCCESS (0x0000) 44 /* memory data structures */ 45 typedef struct { /* start of data structure 0000- */ 46 NvV32 size; /* height_width U16_U16 in pixels 0- 3*/ 47 NvV32 monochrome[1]; /* 32 monochrome pixels per write 4- 7*/ 48 } Nv04aCharacter8[]; /* end of data structure -0007*/ 49 typedef struct { /* start of data structure 0000- */ 50 NvV32 size; /* height_width U16_U16 in pixels 0- 3*/ 51 NvV32 monochrome[3]; /* 32 monochrome pixels per write 4- f*/ 52 } Nv04aCharacter16[]; /* end of data structure -000f*/ 53 typedef struct { /* start of data structure 0000- */ 54 NvV32 size; /* height_width U16_U16 in pixels 00- 03*/ 55 NvV32 monochrome[7]; /* 32 monochrome pixels per write 04- 1f*/ 56 } Nv04aCharacter32[]; /* end of data structure -001f*/ 57 typedef struct { /* start of data structure 0000- */ 58 NvV32 size; /* height_width U16_U16 in pixels 00- 03*/ 59 NvV32 monochrome[15]; /* 32 monochrome pixels per write 04- 3f*/ 60 } Nv04aCharacter64[]; /* end of data structure -003f*/ 61 typedef struct { /* start of data structure 0000- */ 62 NvV32 size; /* height_width U16_U16 in pixels 00- 03*/ 63 NvV32 monochrome[31]; /* 32 monochrome pixels per write 04- 7f*/ 64 } Nv04aCharacter128[]; /* end of data structure -007f*/ 65 typedef struct { /* start of data structure 0000- */ 66 NvV32 size; /* height_width U16_U16 in pixels 00- 03*/ 67 NvV32 monochrome[63]; /* 32 monochrome pixels per write 04- ff*/ 68 } Nv04aCharacter256[]; /* end of data structure -00ff*/ 69 typedef struct { /* start of data structure 0000- */ 70 NvV32 size; /* height_width U16_U16 in pixels 000- 003*/ 71 NvV32 monochrome[127]; /* 32 monochrome pixels per write 004- 1ff*/ 72 } Nv04aCharacter512[]; /* end of data structure -01ff*/ 73 /* pio method data structure */ 74 typedef volatile struct _cl004a_tag0 { 75 NvV32 NoOperation; /* ignored 0100-0103*/ 76 NvV32 Notify; /* NV04A_NOTIFY_* 0104-0107*/ 77 NvV32 Reserved00[0x01e]; 78 NvV32 SetContextDmaNotifies; /* NV01_CONTEXT_DMA 0180-0183*/ 79 NvV32 SetContextDmaFonts; /* NV01_CONTEXT_DMA 0184-0187*/ 80 NvV32 SetContextPattern; /* NV04_CONTEXT_PATTERN 0188-018b*/ 81 NvV32 SetContextRop; /* NV03_CONTEXT_ROP 018c-018f*/ 82 NvV32 SetContextBeta1; /* NV01_CONTEXT_BETA 0190-0193*/ 83 NvV32 SetContextBeta4; /* NV04_CONTEXT_BETA 0194-0197*/ 84 NvV32 SetContextSurface; /* NV04_CONTEXT_SURFACES_2D 0198-019b*/ 85 NvV32 Reserved01[0x058]; 86 NvV32 SetOperation; /* NV04A_SET_OPERATION_* 02fc-02ff*/ 87 NvV32 SetColorFormat; /* NV04A_SET_COLOR_FORMAT_* 0300-0303*/ 88 NvV32 SetMonochromeFormat; /* NV04A_SET_MONOCHROME_FORMAT_* 0304-0307*/ 89 NvV32 Reserved02[0x03D]; 90 NvV32 Color1A; /* rectangle color 03fc-03ff*/ 91 struct { /* start aliased methods in array 0400- */ 92 NvV32 point; /* x_y S16_S16 in pixels 0- 3*/ 93 NvV32 size; /* width_height U16_U16 in pixels 4- 7*/ 94 } UnclippedRectangle[32]; /* end of aliased methods in array -04ff*/ 95 NvV32 Reserved03[0x03D]; 96 NvV32 ClipPoint0B; /* top_left S16_S16 in pixels 05f4-05f7*/ 97 NvV32 ClipPoint1B; /* bottom_right S16_S16 in pixels 05f8-05fb*/ 98 NvV32 Color1B; /* rectangle color 05fc-05ff*/ 99 struct { /* start aliased methods in array 0600- */ 100 NvV32 point0; /* top_left S16_S16 in pixels 0- 3*/ 101 NvV32 point1; /* bottom_right S16_S16 in pixels 4- 7*/ 102 } ClippedRectangle[32]; /* end of aliased methods in array -06ff*/ 103 NvV32 Reserved04[0x03B]; 104 NvV32 ClipPoint0C; /* top_left S16_S16 in pixels 07ec-07ef*/ 105 NvV32 ClipPoint1C; /* bottom_right S16_S16 in pixe 07f0-07f3*/ 106 NvV32 Color1C; /* color of 1 pixels 07f4-07f7*/ 107 NvV32 SizeC; /* height_width U16_U16 in pixels 07f8-07fb*/ 108 NvV32 PointC; /* y_x S16_S16 in pixels 07fc-07ff*/ 109 NvV32 MonochromeColor1C[128]; /* 32 monochrome pixels per write 0800-09ff*/ 110 NvV32 Reserved05[0x079]; 111 NvV32 ClipPoint0E; /* top_left S16_S16 in pixels 0be4-0be7*/ 112 NvV32 ClipPoint1E; /* bottom_right S16_S16 in pixels 0be8-0beb*/ 113 NvV32 Color0E; /* color of 0 pixels 0bec-0bef*/ 114 NvV32 Color1E; /* color of 1 pixels 0bf0-0bf3*/ 115 NvV32 SizeInE; /* height_width U16_U16 in pixels 0bf4-0bf7*/ 116 NvV32 SizeOutE; /* height_width U16_U16 in pixels 0bf8-0bfb*/ 117 NvV32 PointE; /* y_x S16_S16 in pixels 0bfc-0bff*/ 118 NvV32 MonochromeColor01E[128]; /* 32 monochrome pixels per write 0c00-0dff*/ 119 NvV32 Reserved06[0x07C]; 120 NvV32 FontF; /* pitch_offset V4_U28 0ff0-0ff3*/ 121 NvV32 ClipPoint0F; /* top_left S16_S16 in pixels 0ff4-0ff7*/ 122 NvV32 ClipPoint1F; /* bottom_right S16_S16 in pixels 0ff8-0ffb*/ 123 NvV32 Color1F; /* color of 1 pixels 0ffc-0fff*/ 124 NvV32 CharacterColor1F[256]; /* y_x_index S12_S12_U8 1000-13ff*/ 125 NvV32 Reserved07[0x0FC]; 126 NvV32 FontG; /* pitch_offset V4_U28 17f0-17f3*/ 127 NvV32 ClipPoint0G; /* top_left S16_S16 in pixels 17f4-17f7*/ 128 NvV32 ClipPoint1G; /* bottom_right S16_S16 in pixels 17f8-17fb*/ 129 NvV32 Color1G; /* color of 1 pixels 17fc-17ff*/ 130 struct { /* start aliased methods in array 1800- */ 131 NvV32 point; /* y_x S16_S16 in pixels 0- 3*/ 132 NvU32 index; /* 0<=index<=65525 4- 7*/ 133 } CharacterColor1G[256]; /* end of aliased methods in array -1fff*/ 134 } Nv04aTypedef, Nv04GdiRectangleText; 135 #define NV04A_TYPEDEF Nv04GdiRectangleText 136 /* dma method offsets, fields, and values */ 137 #define NV04A_SET_OBJECT (0x00000000) 138 #define NV04A_NO_OPERATION (0x00000100) 139 #define NV04A_NOTIFY (0x00000104) 140 #define NV04A_NOTIFY_WRITE_ONLY (0x00000000) 141 #define NV04A_NOTIFY_WRITE_THEN_AWAKEN (0x00000001) 142 #define NV04A_SET_CONTEXT_DMA_NOTIFIES (0x00000180) 143 #define NV04A_SET_CONTEXT_DMA_FONTS (0x00000184) 144 #define NV04A_SET_CONTEXT_PATTERN (0x00000188) 145 #define NV04A_SET_CONTEXT_ROP (0x0000018C) 146 #define NV04A_SET_CONTEXT_BETA1 (0x00000190) 147 #define NV04A_SET_CONTEXT_BETA4 (0x00000194) 148 #define NV04A_SET_CONTEXT_SURFACE (0x00000198) 149 #define NV04A_SET_OPERATION (0x000002FC) 150 #define NV04A_SET_OPERATION_SRCCOPY_AND (0x00000000) 151 #define NV04A_SET_OPERATION_ROP_AND (0x00000001) 152 #define NV04A_SET_OPERATION_BLEND_AND (0x00000002) 153 #define NV04A_SET_OPERATION_SRCCOPY (0x00000003) 154 #define NV04A_SET_OPERATION_SRCCOPY_PREMULT (0x00000004) 155 #define NV04A_SET_OPERATION_BLEND_PREMULT (0x00000005) 156 #define NV04A_SET_COLOR_FORMAT (0x00000300) 157 #define NV04A_SET_COLOR_FORMAT_LE_X16R5G6B5 (0x00000001) 158 #define NV04A_SET_COLOR_FORMAT_LE_X17R5G5B5 (0x00000002) 159 #define NV04A_SET_COLOR_FORMAT_LE_X8R8G8B8 (0x00000003) 160 #define NV04A_SET_MONOCHROME_FORMAT (0x00000304) 161 #define NV04A_SET_MONOCHROME_FORMAT_CGA6_M1 (0x00000001) 162 #define NV04A_SET_MONOCHROME_FORMAT_LE_M1 (0x00000002) 163 #define NV04A_COLOR1_A (0x000003FC) 164 #define NV04A_UNCLIPPED_RECTANGLE(a) (0x00000400\ 165 +(a)*0x0008) 166 #define NV04A_UNCLIPPED_RECTANGLE_POINT(a) (0x00000400\ 167 +(a)*0x0008) 168 #define NV04A_UNCLIPPED_RECTANGLE_POINT_Y 15:0 169 #define NV04A_UNCLIPPED_RECTANGLE_POINT_X 31:16 170 #define NV04A_UNCLIPPED_RECTANGLE_SIZE(a) (0x00000404\ 171 +(a)*0x0008) 172 #define NV04A_UNCLIPPED_RECTANGLE_SIZE_HEIGHT 15:0 173 #define NV04A_UNCLIPPED_RECTANGLE_SIZE_WIDTH 31:16 174 #define NV04A_CLIP_POINT0_B (0x000005F4) 175 #define NV04A_CLIP_POINT0_B_LEFT 15:0 176 #define NV04A_CLIP_POINT0_B_TOP 31:16 177 #define NV04A_CLIP_POINT1_B (0x000005F8) 178 #define NV04A_CLIP_POINT1_B_RIGHT 15:0 179 #define NV04A_CLIP_POINT1_B_BOTTOM 31:16 180 #define NV04A_COLOR1_B (0x000005FC) 181 #define NV04A_CLIPPED_RECTANGLE(a) (0x00000600\ 182 +(a)*0x0008) 183 #define NV04A_CLIPPED_RECTANGLE_POINT_0(a) (0x00000600\ 184 +(a)*0x0008) 185 #define NV04A_CLIPPED_RECTANGLE_POINT_0_LEFT 15:0 186 #define NV04A_CLIPPED_RECTANGLE_POINT_0_TOP 31:16 187 #define NV04A_CLIPPED_RECTANGLE_POINT_1(a) (0x00000604\ 188 +(a)*0x0008) 189 #define NV04A_CLIPPED_RECTANGLE_POINT_1_RIGHT 15:0 190 #define NV04A_CLIPPED_RECTANGLE_POINT_1_BOTTOM 31:16 191 #define NV04A_CLIP_POINT0_C (0x000007EC) 192 #define NV04A_CLIP_POINT0_C_LEFT 15:0 193 #define NV04A_CLIP_POINT0_C_TOP 31:16 194 #define NV04A_CLIP_POINT1_C (0x000007F0) 195 #define NV04A_CLIP_POINT1_C_RIGHT 15:0 196 #define NV04A_CLIP_POINT1_C_BOTTOM 31:16 197 #define NV04A_COLOR1_C (0x000007F4) 198 #define NV04A_SIZE_C (0x000007F8) 199 #define NV04A_SIZE_C_WIDTH 15:0 200 #define NV04A_SIZE_C_HEIGHT 31:16 201 #define NV04A_POINT_C (0x000007FC) 202 #define NV04A_POINT_C_X 15:0 203 #define NV04A_POINT_C_Y 31:16 204 #define NV04A_MONOCHROME_COLOR1_C(a) (0x00000800\ 205 +(a)*0x0004) 206 #define NV04A_CLIP_POINT0_E (0x00000BE4) 207 #define NV04A_CLIP_POINT0_E_LEFT 15:0 208 #define NV04A_CLIP_POINT0_E_TOP 31:16 209 #define NV04A_CLIP_POINT1_E (0x00000BE8) 210 #define NV04A_CLIP_POINT1_E_RIGHT 15:0 211 #define NV04A_CLIP_POINT1_E_BOTTOM 31:16 212 #define NV04A_COLOR0_E (0x00000BEC) 213 #define NV04A_COLOR1_E (0x00000BF0) 214 #define NV04A_SIZE_IN_E (0x00000BF4) 215 #define NV04A_SIZE_IN_E_WIDTH 15:0 216 #define NV04A_SIZE_IN_E_HEIGHT 31:16 217 #define NV04A_SIZE_OUT_E (0x00000BF8) 218 #define NV04A_SIZE_OUT_E_WIDTH 15:0 219 #define NV04A_SIZE_OUT_E_HEIGHT 31:16 220 #define NV04A_POINT_E (0x00000BFC) 221 #define NV04A_POINT_E_X 15:0 222 #define NV04A_POINT_E_Y 31:16 223 #define NV04A_MONOCHROME_COLOR01_E(a) (0x00000C00\ 224 +(a)*0x0004) 225 #define NV04A_FONT_F (0x00000FF0) 226 #define NV04A_FONT_F_OFFSET 27:0 227 #define NV04A_FONT_F_PITCH 31:28 228 #define NV04A_FONT_F_PITCH_8 (0x00000003) 229 #define NV04A_FONT_F_PITCH_16 (0x00000004) 230 #define NV04A_FONT_F_PITCH_32 (0x00000005) 231 #define NV04A_FONT_F_PITCH_64 (0x00000006) 232 #define NV04A_FONT_F_PITCH_128 (0x00000007) 233 #define NV04A_FONT_F_PITCH_256 (0x00000008) 234 #define NV04A_FONT_F_PITCH_512 (0x00000009) 235 #define NV04A_CLIP_POINT0_F (0x00000FF4) 236 #define NV04A_CLIP_POINT0_F_LEFT 15:0 237 #define NV04A_CLIP_POINT0_F_TOP 31:16 238 #define NV04A_CLIP_POINT1_F (0x00000FF8) 239 #define NV04A_CLIP_POINT1_F_RIGHT 15:0 240 #define NV04A_CLIP_POINT1_F_BOTTOM 31:16 241 #define NV04A_COLOR1_F (0x00000FFC) 242 #define NV04A_CHARACTER_COLOR1_F(a) (0x00001000\ 243 +(a)*0x0004) 244 #define NV04A_CHARACTER_COLOR1_F_INDEX 7:0 245 #define NV04A_CHARACTER_COLOR1_F_X 19:8 246 #define NV04A_CHARACTER_COLOR1_F_Y 31:20 247 #define NV04A_FONT_G (0x000017F0) 248 #define NV04A_FONT_G_OFFSET 27:0 249 #define NV04A_FONT_G_PITCH 31:28 250 #define NV04A_FONT_G_PITCH_8 (0x00000003) 251 #define NV04A_FONT_G_PITCH_16 (0x00000004) 252 #define NV04A_FONT_G_PITCH_32 (0x00000005) 253 #define NV04A_FONT_G_PITCH_64 (0x00000006) 254 #define NV04A_FONT_G_PITCH_128 (0x00000007) 255 #define NV04A_FONT_G_PITCH_256 (0x00000008) 256 #define NV04A_FONT_G_PITCH_512 (0x00000009) 257 #define NV04A_CLIP_POINT0_G (0x000017F4) 258 #define NV04A_CLIP_POINT0_G_LEFT 15:0 259 #define NV04A_CLIP_POINT0_G_TOP 31:16 260 #define NV04A_CLIP_POINT1_G (0x000017F8) 261 #define NV04A_CLIP_POINT1_G_RIGHT 15:0 262 #define NV04A_CLIP_POINT1_G_BOTTOM 31:16 263 #define NV04A_COLOR1_G (0x000017FC) 264 #define NV04A_CHARACTER_COLOR1_G(a) (0x00001800\ 265 +(a)*0x0008) 266 #define NV04A_CHARACTER_COLOR1_G_POINT(a) (0x00001800\ 267 +(a)*0x0008) 268 #define NV04A_CHARACTER_COLOR1_G_POINT_X 15:0 269 #define NV04A_CHARACTER_COLOR1_G_POINT_Y 31:16 270 #define NV04A_CHARACTER_COLOR1_G_INDEX(a) (0x00001804\ 271 +(a)*0x0008) 272 /* obsolete stuff */ 273 #define NV4_GDI_RECTANGLE_TEXT (0x0000004A) 274 #define Nv4GdiRectangleText Nv04GdiRectangleText 275 #define nv4GdiRectangleText Nv04GdiRectangleText 276 #define nv04GdiRectangleText Nv04GdiRectangleText 277 278 #ifdef __cplusplus 279 }; /* extern "C" */ 280 #endif 281 282 #endif /* _cl004a_h_ */ 283