xref: /aosp_15_r20/external/mesa3d/src/nouveau/headers/nvidia/classes/cl007b.h (revision 6104692788411f58d303aa86923a9ff6ecaded22)
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 _cl007b_h_
25 #define _cl007b_h_
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
31 #include "nvtypes.h"
32 
33 #define  NV10_TEXTURE_FROM_CPU                                     (0x0000007B)
34 /* NvNotification[] elements */
35 #define NV07B_NOTIFIERS_NOTIFY                                     (0)
36 #define NV07B_NOTIFIERS_MAXCOUNT								   (1)
37 /* NvNotification[] fields and values */
38 #define NV07B_NOTIFICATION_STATUS_IN_PROGRESS                      (0x8000)
39 #define NV07B_NOTIFICATION_STATUS_ERROR_PROTECTION_FAULT           (0x4000)
40 #define NV07B_NOTIFICATION_STATUS_ERROR_BAD_ARGUMENT               (0x2000)
41 #define NV07B_NOTIFICATION_STATUS_ERROR_INVALID_STATE              (0x1000)
42 #define NV07B_NOTIFICATION_STATUS_ERROR_STATE_IN_USE               (0x0800)
43 #define NV07B_NOTIFICATION_STATUS_DONE_SUCCESS                     (0x0000)
44 /* pio method data structure */
45 typedef volatile struct _cl007b_tag0 {
46  NvV32 NoOperation;             /* ignored                          0100-0103*/
47  NvV32 Notify;                  /* NV089_NOTIFY_*                   0104-0107*/
48  NvV32 Reserved00[0x01e];
49  NvV32 SetContextDmaNotifies;   /* NV01_CONTEXT_DMA                 0180-0183*/
50  NvV32 SetContextSurface;       /* NV04_CONTEXT_SURFACES_2D         0184-0187*/
51  NvV32 Reserved01[0x05e];
52  NvV32 SetColorFormat;          /* NV07B_SET_COLOR_FORMAT_*         0300-0303*/
53  NvV32 Point;                   /* y_x S16_S16 in pixels            0304-0307*/
54  NvV32 Size;                    /* height_width U16_U16, pixels     0308-030b*/
55  NvV32 ClipHorizontal;          /* width_x U16_U16                  030c-030f*/
56  NvV32 ClipVertical;            /* height_y U16_U16                 0310-0313*/
57  NvV32 Reserved02[0x03b];
58  struct {                       /* start aliased methods in array   0400-    */
59   NvV32 a;                      /* source colors (packed texels)       0-   3*/
60   NvV32 b;                      /* source colors (packed texels)       4-   7*/
61  } Color[896];                  /* end of aliased methods in array      -1fff*/
62 } Nv07bTypedef, Nv10TextureFromCpu;
63 #define NV07B_TYPEDEF                                        Nv10TextureFromCpu
64 /* dma method offsets, fields, and values */
65 #define NV07B_SET_OBJECT                                           (0x00000000)
66 #define NV07B_NO_OPERATION                                         (0x00000100)
67 #define NV07B_NOTIFY                                               (0x00000104)
68 #define NV07B_NOTIFY_WRITE_ONLY                                    (0x00000000)
69 #define NV07B_NOTIFY_WRITE_THEN_AWAKEN                             (0x00000001)
70 #define NV07B_SET_CONTEXT_DMA_NOTIFIES                             (0x00000180)
71 #define NV07B_SET_CONTEXT_SURFACE                                  (0x00000184)
72 #define NV07B_SET_COLOR_FORMAT                                     (0x00000300)
73 #define NV07B_SET_COLOR_FORMAT_LE_R5G6B5                           (0x00000001)
74 #define NV07B_SET_COLOR_FORMAT_LE_A1R5G5B5                         (0x00000002)
75 #define NV07B_SET_COLOR_FORMAT_LE_X1R5G5B5                         (0x00000003)
76 #define NV07B_SET_COLOR_FORMAT_LE_A8R8G8B8                         (0x00000004)
77 #define NV07B_SET_COLOR_FORMAT_LE_X8R8G8B8                         (0x00000005)
78 #define NV07B_POINT                                                (0x00000304)
79 #define NV07B_POINT_X                                              15:0
80 #define NV07B_POINT_Y                                              31:16
81 #define NV07B_SIZE                                                 (0x00000308)
82 #define NV07B_SIZE_WIDTH                                           15:0
83 #define NV07B_SIZE_HEIGHT                                          31:16
84 #define NV07B_CLIP_HORIZONTAL                                      (0x0000030C)
85 #define NV07B_CLIP_HORIZONTAL_X                                    15:0
86 #define NV07B_CLIP_HORIZONTAL_WIDTH                                31:16
87 #define NV07B_CLIP_VERTICAL                                        (0x00000310)
88 #define NV07B_CLIP_VERTICAL_Y                                      15:0
89 #define NV07B_CLIP_VERTICAL_HEIGHT                                 31:16
90 #define NV07B_COLOR(a)                                             (0x00000400\
91                                                                    +(a)*0x0008)
92 #define NV07B_COLOR_A(a)                                           (0x00000400\
93                                                                    +(a)*0x0008)
94 #define NV07B_COLOR_B(a)                                           (0x00000404\
95                                                                    +(a)*0x0008)
96 #define NV07B_COLOR__SIZE_1                                        896
97 
98 #ifdef __cplusplus
99 };     /* extern "C" */
100 #endif
101 
102 #endif /* _cl007b_h_ */
103