xref: /aosp_15_r20/external/mesa3d/src/nouveau/headers/nvidia/classes/cl0042.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 _cl0042_h_
25 #define _cl0042_h_
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
31 #include "nvtypes.h"
32 
33 #define  NV04_CONTEXT_SURFACES_2D                                  (0x00000042)
34 /* NvNotification[] elements */
35 #define NV042_NOTIFIERS_NOTIFY                                     (0)
36 #define NV042_NOTIFIERS_MAXCOUNT								   (1)
37 /* NvNotification[] fields and values */
38 #define NV042_NOTIFICATION_STATUS_IN_PROGRESS                      (0x8000)
39 #define NV042_NOTIFICATION_STATUS_ERROR_PROTECTION_FAULT           (0x4000)
40 #define NV042_NOTIFICATION_STATUS_ERROR_BAD_ARGUMENT               (0x2000)
41 #define NV042_NOTIFICATION_STATUS_ERROR_INVALID_STATE              (0x1000)
42 #define NV042_NOTIFICATION_STATUS_ERROR_STATE_IN_USE               (0x0800)
43 #define NV042_NOTIFICATION_STATUS_DONE_SUCCESS                     (0x0000)
44 /* pio method data structure */
45 typedef volatile struct _cl0042_tag0 {
46  NvV32 NoOperation;             /* ignored                          0100-0103*/
47  NvV32 Notify;                  /* NV042_NOTIFY_*                   0104-0107*/
48  NvV32 Reserved00[0x01e];
49  NvV32 SetContextDmaNotifies;   /* NV01_CONTEXT_DMA                 0180-0183*/
50  NvV32 SetContextDmaImageSource;/* NV01_CONTEXT_DMA                 0184-0187*/
51  NvV32 SetContextDmaImageDestin;/* NV01_CONTEXT_DMA                 0188-018b*/
52  NvV32 Reserved01[0x05d];
53  NvV32 SetColorFormat;          /* NV042_SET_COLOR_FORMAT_*         0300-0303*/
54  NvU32 SetPitch;                /* destin_source U16_U16            0304-0307*/
55  NvU32 SetOffsetSource;         /* byte offset of top-left pixel    0308-030b*/
56  NvU32 SetOffsetDestin;         /* byte offset of top-left pixel    030c-030f*/
57  NvV32 Reserved02[0x73c];
58 } Nv042Typedef, Nv04ContextSurfaces2d;
59 #define NV042_TYPEDEF                                     Nv04ContextSurfaces2d
60 /* dma method offsets, fields, and values */
61 #define NV042_SET_OBJECT                                           (0x00000000)
62 #define NV042_NO_OPERATION                                         (0x00000100)
63 #define NV042_NOTIFY                                               (0x00000104)
64 #define NV042_NOTIFY_WRITE_ONLY                                    (0x00000000)
65 #define NV042_NOTIFY_WRITE_THEN_AWAKEN                             (0x00000001)
66 #define NV042_SET_CONTEXT_DMA_NOTIFIES                             (0x00000180)
67 #define NV042_SET_CONTEXT_DMA_IMAGE_SOURCE                         (0x00000184)
68 #define NV042_SET_CONTEXT_DMA_IMAGE_DESTIN                         (0x00000188)
69 #define NV042_SET_COLOR_FORMAT                                     (0x00000300)
70 #define NV042_SET_COLOR_FORMAT_LE_Y8                               (0x00000001)
71 #define NV042_SET_COLOR_FORMAT_LE_X1R5G5B5_Z1R5G5B5                (0x00000002)
72 #define NV042_SET_COLOR_FORMAT_LE_X1R5G5B5_O1R5G5B5                (0x00000003)
73 #define NV042_SET_COLOR_FORMAT_LE_R5G6B5                           (0x00000004)
74 #define NV042_SET_COLOR_FORMAT_LE_Y16                              (0x00000005)
75 #define NV042_SET_COLOR_FORMAT_LE_X8R8G8B8_Z8R8G8B8                (0x00000006)
76 #define NV042_SET_COLOR_FORMAT_LE_X8R8G8B8_O8R8G8B8                (0x00000007)
77 #define NV042_SET_COLOR_FORMAT_LE_X1A7R8G8B8_Z1A7R8G8B8            (0x00000008)
78 #define NV042_SET_COLOR_FORMAT_LE_X1A7R8G8B8_O1A7R8G8B8            (0x00000009)
79 #define NV042_SET_COLOR_FORMAT_LE_A8R8G8B8                         (0x0000000A)
80 #define NV042_SET_COLOR_FORMAT_LE_Y32                              (0x0000000B)
81 #define NV042_SET_PITCH                                            (0x00000304)
82 #define NV042_SET_PITCH_SOURCE                                     15:0
83 #define NV042_SET_PITCH_DESTIN                                     31:16
84 #define NV042_SET_OFFSET_SOURCE                                    (0x00000308)
85 #define NV042_SET_OFFSET_DESTIN                                    (0x0000030C)
86 /* obsolete stuff */
87 #define NV4_CONTEXT_SURFACES_2D                                    (0x00000042)
88 #define Nv4ContextSurfaces2d                              Nv04ContextSurfaces2d
89 #define nv4ContextSurfaces2d                              Nv04ContextSurfaces2d
90 #define nv4ContextSurfaces2D                              Nv04ContextSurfaces2d
91 #define nv04ContextSurfaces2d                             Nv04ContextSurfaces2d
92 
93 #ifdef __cplusplus
94 };     /* extern "C" */
95 #endif
96 
97 #endif /* _cl0042_h_ */
98