1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2015-2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3  * SPDX-License-Identifier: MIT
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 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21  * DEALINGS IN THE SOFTWARE.
22  */
23 
24 #pragma once
25 
26 #include <nvtypes.h>
27 
28 //
29 // This file was generated with FINN, an NVIDIA coding tool.
30 // Source file:      ctrl/ctrl0080/ctrl0080unix.finn
31 //
32 
33 #include "ctrl/ctrl0080/ctrl0080base.h"
34 
35 /* NV01_DEVICE_XX/NV03_DEVICE UNIX-specific control commands and parameters */
36 
37 /*
38  * NV0080_CTRL_CMD_OS_UNIX_VT_SWITCH
39  *
40  * This command notifies RM to save or restore the current console state. It is
41  * intended to be called just before the display driver starts using the display
42  * engine, and after it has finished using it.
43  *
44  *   cmd
45  *    Indicates which operation should be performed.
46  *
47  *      SAVE_VT_STATE
48  *        Records the current state of the console, to be restored later.
49  *      RESTORE_VT_STATE
50  *        Restores the previously-saved console state.
51  *
52  *   fbInfo
53  *     Returns information about the system's framebuffer console, if one
54  *     exists. If no console is present, all fields will be zero.
55  *
56  * Possible status values returned are:
57  *   NV_OK
58  *   NV_ERR_INVALID_ARGUMENT
59  */
60 #define NV0080_CTRL_CMD_OS_UNIX_VT_SWITCH (0x801e01) /* finn: Evaluated from "(FINN_NV01_DEVICE_0_OS_UNIX_INTERFACE_ID << 8) | NV0080_CTRL_OS_UNIX_VT_SWITCH_PARAMS_MESSAGE_ID" */
61 
62 #define NV0080_CTRL_OS_UNIX_VT_SWITCH_PARAMS_MESSAGE_ID (0x1U)
63 
64 typedef struct NV0080_CTRL_OS_UNIX_VT_SWITCH_PARAMS {
65     NvU32 cmd;                                    /* in */
66 } NV0080_CTRL_OS_UNIX_VT_SWITCH_PARAMS;
67 
68 /* Called when the display driver needs RM to save the console data,
69  * which will be used in RM based console restore */
70 #define NV0080_CTRL_OS_UNIX_VT_SWITCH_CMD_SAVE_VT_STATE    (0x00000001)
71 
72 /* Called when the display driver needs RM to restore the console */
73 #define NV0080_CTRL_OS_UNIX_VT_SWITCH_CMD_RESTORE_VT_STATE (0x00000002)
74 
75 /* Called when the display driver has restored the console -- RM doesn't
76  * need to do anything further, but needs to be informed to avoid turning the
77  * GPU off and thus destroying the console state. */
78 #define NV0080_CTRL_OS_UNIX_VT_SWITCH_CMD_CONSOLE_RESTORED (0x00000003)
79 
80 #define NV0080_CTRL_CMD_OS_UNIX_VT_GET_FB_INFO             (0x801e02) /* finn: Evaluated from "(FINN_NV01_DEVICE_0_OS_UNIX_INTERFACE_ID << 8) | NV0080_CTRL_OS_UNIX_VT_GET_FB_INFO_PARAMS_MESSAGE_ID" */
81 
82 #define NV0080_CTRL_OS_UNIX_VT_GET_FB_INFO_PARAMS_MESSAGE_ID (0x2U)
83 
84 typedef struct NV0080_CTRL_OS_UNIX_VT_GET_FB_INFO_PARAMS {
85     NvU32 subDeviceInstance; /* out */
86 
87     NvU16 width; /* out */
88     NvU16 height; /* out */
89     NvU16 depth; /* out */
90     NvU16 pitch; /* out */
91 } NV0080_CTRL_OS_UNIX_VT_GET_FB_INFO_PARAMS;
92 
93 /* _ctrl0080unix_h_ */
94