1 | /** |
---|
2 | * @file fb_vesa.h |
---|
3 | * |
---|
4 | * @ingroup i386_pc386 |
---|
5 | * |
---|
6 | * @brief Definitioins for vesa based framebuffer drivers. |
---|
7 | */ |
---|
8 | |
---|
9 | /* |
---|
10 | * Headers specific for framebuffer drivers utilizing VESA VBE. |
---|
11 | * |
---|
12 | * Copyright (C) 2014 Jan DoleÅŸal (dolezj21@fel.cvut.cz) |
---|
13 | * CTU in Prague. |
---|
14 | * |
---|
15 | * The license and distribution terms for this file may be |
---|
16 | * found in the file LICENSE in this distribution or at |
---|
17 | * http://www.rtems.org/license/LICENSE. |
---|
18 | */ |
---|
19 | |
---|
20 | #include <bsp/vbe3.h> |
---|
21 | #include <edid.h> |
---|
22 | |
---|
23 | #ifndef _FB_VESA_H |
---|
24 | #define _FB_VESA_H |
---|
25 | |
---|
26 | #ifndef ASM /* ASM */ |
---|
27 | |
---|
28 | #include <stdint.h> |
---|
29 | |
---|
30 | #ifdef __cplusplus |
---|
31 | extern "C" { |
---|
32 | #endif /* __cplusplus */ |
---|
33 | |
---|
34 | |
---|
35 | /* ----- Prototypes ----- */ |
---|
36 | |
---|
37 | /** |
---|
38 | * Returns information about graphic's controller in the infoBlock structure. |
---|
39 | * |
---|
40 | * @param infoBlock pointer to the struct to be filled with |
---|
41 | controller information |
---|
42 | * @param queriedVBEVersion if >0x200 then video bios is asked to fill in |
---|
43 | * parameters which appeared with second version |
---|
44 | * of VBE. |
---|
45 | * @retval register ax content as defined in VBE RETURN STATUS paragraph |
---|
46 | * -1 error calling graphical bios |
---|
47 | */ |
---|
48 | uint32_t VBEControllerInformation ( |
---|
49 | struct VBE_VbeInfoBlock *infoBlock, |
---|
50 | uint16_t queriedVBEVersion |
---|
51 | ); |
---|
52 | |
---|
53 | /** |
---|
54 | * Fills structure infoBlock with informations about selected mode in |
---|
55 | * modeNumber variable. |
---|
56 | * |
---|
57 | * @param infoBlock pointer to the struct to be filled with mode information |
---|
58 | * @param modeNumber detailes of this mode to be filled |
---|
59 | * @retval register ax content as defined in VBE RETURN STATUS paragraph |
---|
60 | * -1 error calling graphical bios |
---|
61 | */ |
---|
62 | uint32_t VBEModeInformation ( |
---|
63 | struct VBE_ModeInfoBlock *infoBlock, |
---|
64 | uint16_t modeNumber |
---|
65 | ); |
---|
66 | |
---|
67 | /** |
---|
68 | * Sets graphics mode selected. If mode has refreshRateCtrl bit set, than the |
---|
69 | * infoBlock must be filled accordingly. |
---|
70 | * |
---|
71 | * @param modeNumber number of mode to be set |
---|
72 | * @param infoBlock pointer to struct containing refresh rate control info |
---|
73 | * @retval register ax content as defined in VBE RETURN STATUS paragraph |
---|
74 | * -1 error calling graphical bios |
---|
75 | */ |
---|
76 | uint32_t VBESetMode ( |
---|
77 | uint16_t modeNumber, |
---|
78 | struct VBE_CRTCInfoBlock *infoBlock |
---|
79 | ); |
---|
80 | |
---|
81 | /** |
---|
82 | * Get currently set mode number. |
---|
83 | * |
---|
84 | * @param modeNumber variable to be filled with current mode number |
---|
85 | * @retval register ax content as defined in VBE RETURN STATUS paragraph |
---|
86 | * -1 error calling graphical bios |
---|
87 | */ |
---|
88 | uint32_t VBECurrentMode ( |
---|
89 | uint16_t *modeNumber |
---|
90 | ); |
---|
91 | |
---|
92 | /** |
---|
93 | * Gets information about display data channel implemented in the |
---|
94 | * graphic's controller. |
---|
95 | * |
---|
96 | * @param controllerUnitNumber |
---|
97 | * @param secondsToTransferEDIDBlock approximate time to transfer one EDID block |
---|
98 | * rounded up to seconds |
---|
99 | * @param DDCLevelSupported after call contains DDC version supported and |
---|
100 | * screen blanking state during transfer |
---|
101 | * @retval register ax content as defined in VBE RETURN STATUS paragraph |
---|
102 | * -1 error calling graphical bios |
---|
103 | */ |
---|
104 | uint32_t VBEReportDDCCapabilities ( |
---|
105 | uint16_t controllerUnitNumber, |
---|
106 | uint8_t *secondsToTransferEDIDBlock, |
---|
107 | uint8_t *DDCLevelSupported |
---|
108 | ); |
---|
109 | |
---|
110 | /** |
---|
111 | * Reads selected EDID block from display attached to controller's interface. |
---|
112 | * |
---|
113 | * @param controllerUnitNumber |
---|
114 | * @param EDIDBlockNumber block no. to be read from the display |
---|
115 | * @param buffer place to store block fetched from the display |
---|
116 | * @retval register ax content as defined in VBE RETURN STATUS paragraph |
---|
117 | * -1 error calling graphical bios |
---|
118 | */ |
---|
119 | uint32_t VBEReadEDID ( |
---|
120 | uint16_t controllerUnitNumber, |
---|
121 | uint16_t EDIDBlockNumber, |
---|
122 | struct edid1 *buffer |
---|
123 | ); |
---|
124 | |
---|
125 | #ifdef __cplusplus |
---|
126 | } |
---|
127 | #endif /* __cplusplus */ |
---|
128 | |
---|
129 | #endif /* ASM */ |
---|
130 | |
---|
131 | #endif /* _FB_VESA_H */ |
---|