XenevaOS
Loading...
Searching...
No Matches
aucon.h
Go to the documentation of this file.
1
30#ifndef __AU_CONSOLE_H__
31#define __AU_CONSOLE_H__
32
33#include <aurora.h>
34#if defined(__GNUC__) || defined(__clang__)
35#ifndef __cplusplus
36#include <stdbool.h>
37#endif
38#endif
39
40#define SCREEN_SETMODE 200
41#define SCREEN_GETWIDTH 201
42#define SCREEN_GETHEIGHT 202
43#define SCREEN_GETBPP 203
44#define SCREEN_SETBPP 204
45#define SCREEN_UPDATE 205
46#define SCREEN_GET_SCANLINE 206
47#define SCREEN_GET_PITCH 207
48#define SCREEN_REG_MNGR 208
49#define SCREEN_GET_FB 209
50#define SCREEN_RESTORE_BOOT_FB 210
51
52typedef struct _aucon_ {
61 /* desktop_width/height -- size reported to the compositor for the
62 * desktop scanout. Equals width/height unless the loader passed a
63 * manual desktop override (resolutions the firmware GOP never
64 * offers) and the console framebuffer is at least that big; a
65 * bigger override needs a GPU driver to repoint the console to it
66 * first. Text drawing always uses width/height (real GOP). --axiss */
70
71/*
72* AuConsoleInitialize -- initialize kernel direct screen
73* console
74* @param info -- Pointer to kernel boot info structure
75*/
76extern void AuConsoleInitialize(PKERNEL_BOOT_INFO info, bool early);
77
78/*
79* AuConsolePostInitialise -- initialise the post console process
80* @param info -- pointer to kernel boot info structure
81*/
83
84
89extern void AuPutS(char* str);
90
96extern void AuPutS_Color(char* str, uint32_t color);
97/*
98* AuTextOut -- standard text printing function
99* for entire kernel
100* @param text -- text to output
101*/
102AU_EXTERN AU_EXPORT void AuTextOut(const char* text, ...);
103
104AU_EXTERN AU_EXPORT void AuTextOut_profiler(const char* text, ...);
105
106/*
107* AuConsoleEarlyEnable -- enables or disable early
108* mode text output
109* @param value -- boolean value
110*/
111void AuConsoleEarlyEnable(bool value);
112
113/*
114* AuConsoleSetDisplayOwned -- hand the scanout to the compositor.
115* Once the display owner claims PROCESS_TOKEN_DISPLAY, framebuffer text
116* output is muted (UART logging is unaffected). The compositor draws into
117* the same physical framebuffer, so any further AuTextOut would scribble
118* over the live desktop. --term never claims the token, so its framebuffer
119* console keeps working.
120*/
121void AuConsoleSetDisplayOwned(void);
122
123/*
124* AuConsoleRestoreBootFb -- move the kernel console back onto the boot
125* framebuffer (see aucon.c). Used by TERM mode, which has no compositor
126* to present the GPU backing the console was repointed at.
127* Returns 1 when restored, 0 when there is nothing to restore.
128*/
129int AuConsoleRestoreBootFb(void);
130
131/*
132* AuConsolePresentFn -- mirrors console damage onto another scanout.
133* src is the console framebuffer, src_pitch its byte stride; (x, y, w, h)
134* is the damaged rectangle in pixels. The virtio-gpu driver installs this
135* so the text console stays visible on its display while no compositor
136* owns the screen (TERM mode). --axiss
137*/
138typedef void (*AuConsolePresentFn)(uint32_t* src, uint32_t src_pitch,
139 int x, int y, int w, int h);
141
142/*
143 * AuConsolePresentRect -- hand an explicit damage rectangle to the scanout
144 * mirror (see AuConsoleSetPresentHook). This is the path SCREEN_UPDATE takes
145 * for userspace, which paints into the mapped framebuffer directly.
146 */
147void AuConsolePresentRect(int x, int y, int w, int h);
148
149/*
150 * AuConsoleGetScreenWidth -- return the screen
151 * width
152 */
154
155/*
156 * AuConsoleGetScreenHeight -- return the screen
157 * height
158 */
160
161AU_EXTERN AU_EXPORT void AuConsoleSetConInfo(uint64_t phys, uint64_t virt, size_t xres, size_t yres);
162
163#endif
#define AU_EXTERN
Definition aurora.h:54
#define AU_EXPORT
Definition aurora.h:40
unsigned int uint32_t
Definition acefiex.h:163
COMPILER_DEPENDENT_UINT64 uint64_t
Definition acefiex.h:165
unsigned short int uint16_t
Definition acefiex.h:162
void AuConsoleSetDisplayOwned(void)
Put a character to console output.
Definition aucon.c:659
uint32_t AuConsoleGetScreenWidth()
AuConsoleGetScreenWidth – return the screen width.
Definition aucon.c:1108
void AuConsoleEarlyEnable(bool value)
AuConsoleEarlyEnable – enables or disable early mode text output.
Definition aucon.cpp:384
uint32_t AuConsoleGetScreenHeight()
AuConsoleGetScreenHeight – return the screen height.
Definition aucon.c:1123
void AuConsolePostInitialise(PKERNEL_BOOT_INFO info)
AuConsolePostInitialise – initialise the post console process.
Definition aucon.cpp:156
void AuConsolePresentRect(int x, int y, int w, int h)
AuConsolePresentRect – hand an explicit damage rectangle to the scanout mirror installed by AuConsole...
Definition aucon.c:679
void AuConsoleInitialize(PKERNEL_BOOT_INFO info, bool early)
AuConsoleInitialize – initialize kernel direct screen console.
Definition aucon.cpp:74
struct _aucon_ AuConsole
int AuConsoleRestoreBootFb(void)
AuConsoleRestoreBootFb – move the kernel console back onto the boot (GOP/ramfb) framebuffer saved by ...
Definition aucon.c:1175
AU_EXTERN AU_EXPORT void AuTextOut_profiler(const char *text,...)
void AuPutS_Color(char *str, uint32_t color)
Prints string to console output.
Definition aucon.c:844
void AuPutS(char *str)
Prints string to console output.
Definition aucon.cpp:234
void(* AuConsolePresentFn)(uint32_t *src, uint32_t src_pitch, int x, int y, int w, int h)
Definition aucon.h:138
void * fn
Definition audrv.c:980
void AuConsoleSetConInfo(void)
void AuConsoleSetPresentHook(void)
void AuTextOut(void)
int y
Definition layout.c:118
int h
Definition layout.c:118
int x
Definition layout.c:118
int w
Definition layout.c:118
char phys[]
Definition aurora.h:166
Definition aucon.h:52
uint32_t desktop_height
Definition aucon.h:68
uint32_t height
Definition aucon.h:54
uint32_t desktop_width
Definition aucon.h:67
uint32_t size
Definition aucon.h:58
uint16_t scanline
Definition aucon.h:57
uint32_t * buffer
Definition aucon.h:55
uint32_t width
Definition aucon.h:53
uint32_t bpp
Definition aucon.h:56
uint32_t pitch
Definition aucon.h:59
bool early_mode
Definition aucon.h:60
Definition i_video.h:141