revert between 56095 -> 55830 in arch
[AROS.git] / compiler / include / hardware / vbe.h
blob026d1da682a721c37eb525bc01381d565f4b2d2f
1 /*
2 Copyright © 2002-2011, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: VESA BIOS information structures
6 Lang: english
7 */
9 #ifndef HARDWARE_VBE_H
10 #define HARDWARE_VBE_H
13 * VESA BIOS return code. Returned in AX register.
14 * This comes in the lower half (AL) and indicates that the upper half
15 * (AH) is valid.
17 #define VBE_RC_SUPPORTED 0x004F
19 /* Upper half (contents of AH, shifted by 8) */
20 #define VBE_RC_OK 0x0000 /* All went OK */
21 #define VBE_RC_FAIL 0x0200 /* Call failed */
22 #define VBE_RC_NOHW 0x0200 /* The given parameters are not supported by the hardware */
23 #define VBE_RC_NOMODE 0X0300 /* The given parameters are not supported by the current video mode */
25 /* VBE controller information */
26 struct vbe_controller
28 unsigned char signature[4]; /* 'VESA' string */
29 unsigned short version; /* VBE version number */
30 unsigned int oem_string; /* 16-bit far pointer to OEM string pointer */
31 unsigned int capabilities; /* Capabilities flags, see below */
32 unsigned int video_mode; /* 16-bit far pointer to video mode table */
33 unsigned short total_memory; /* Total amount of VRAM in 64KB units */
34 unsigned short oem_software_rev; /* ROM version number */
35 unsigned int oem_vendor_name; /* 16-bit far pointer to hardware vendor string */
36 unsigned int oem_product_name; /* 16-bit far pointer to name string */
37 unsigned int oem_product_rev; /* 16-bit far pointer to version string */
38 unsigned char reserved[222]; /* BIOS scratchpad */
39 unsigned char oem_data[256]; /* Strings can be copied here */
40 } __attribute__ ((packed));
43 * A macro for transforming 16-bit far pointers (segment:offset)
44 * into 32-bit linear addresses
46 #define GET_FAR_PTR(x) ((void *)((x & 0xffff0000) >> 12) + (x & 0xffff))
48 /* Controller capabilities flags */
49 #define VC_PALETTE_WIDTH 0x0001 /* Can change palette width to 8 */
50 #define VC_NO_VGA_HW 0x0002 /* The hardware is not VGA-compatible */
51 #define VC_RAMDAC_BLANK 0x0004 /* Use blank bit for function 09 */
52 #define VC_STEREO 0x0008 /* Stereoscopic signalling is supported */
53 #define VC_STEREO_EVC 0x0010 /* EVC connector is used for stereoscopic signalling */
55 /* Mode number format for setting video mode */
56 #define VBE_MODE_NUMBER_MASK 0x01FF /* Mask for actual mode number */
57 #define VBE_MODE_STANDARD 0x0100 /* This is VESA standard mode */
58 #define VBE_MODE_CUSTOM_RATE 0x0800 /* Custom refresh rate is supplied */
59 #define VBE_MODE_LINEAR_FB 0x4000 /* Select linear framebuffer mode */
60 #define VBE_MODE_KEEP 0x8000 /* Do not clear video memory */
62 /* VBE mode information. */
63 struct vbe_mode
65 unsigned short mode_attributes; /* Mode flags, see below */
66 unsigned char win_a_attributes;
67 unsigned char win_b_attributes;
68 unsigned short win_granularity;
69 unsigned short win_size;
70 unsigned short win_a_segment;
71 unsigned short win_b_segment;
72 unsigned int win_func;
73 unsigned short bytes_per_scanline; /* Number of bytes per line */
75 /* >=1.2 */
76 unsigned short x_resolution; /* Number of pixels (or characters) per line */
77 unsigned short y_resolution; /* Number of pixels (or characters) per column */
78 unsigned char x_char_size;
79 unsigned char y_char_size;
80 unsigned char number_of_planes;
81 unsigned char bits_per_pixel; /* Number of bits per pixel */
82 unsigned char number_of_banks;
83 unsigned char memory_model; /* Memory model type, see below */
84 unsigned char bank_size;
85 unsigned char number_of_image_pages;
86 unsigned char reserved0;
88 /* direct color */
89 unsigned char red_mask_size; /* Number of bits for the color */
90 unsigned char red_field_position; /* LSB bit position of the color mask */
91 unsigned char green_mask_size; /* Number of bits in the color mask */
92 unsigned char green_field_position;
93 unsigned char blue_mask_size;
94 unsigned char blue_field_position;
95 unsigned char reserved_mask_size;
96 unsigned char reserved_field_position;
97 unsigned char direct_color_mode_info; /* Direct color mode flags, see below */
99 /* >=2.0 */
100 unsigned int phys_base; /* Linear framebuffer address (32-bit) */
101 unsigned int reserved1;
102 unsigned short reserved2;
104 /* >=3.0 */
105 unsigned short linear_bytes_per_scanline;
106 unsigned char banked_number_of_image_pages;
107 unsigned char linear_number_of_image_pages;
108 unsigned char linear_red_mask_size;
109 unsigned char linear_red_field_position;
110 unsigned char linear_green_mask_size;
111 unsigned char linear_green_field_position;
112 unsigned char linear_blue_mask_size;
113 unsigned char linear_blue_field_position;
114 unsigned char linear_reserved_mask_size;
115 unsigned char linear_reserved_field_position;
116 unsigned int max_pixel_clock;
118 unsigned char reserved3[189];
119 } __attribute__ ((packed));
121 /* Video mode flags */
122 #define VM_SUPPORTED 0x0001 /* The mode is supported by the hardware */
123 #define VM_BIOSTTY 0x0004 /* The mode is supported by BIOS TTY functions */
124 #define VM_COLOR 0x0008 /* The mode is color; monochrome if unset */
125 #define VM_GRAPHICS 0x0010 /* The mode is graphical; text if unset */
126 #define VM_NO_VGA_HW 0x0020 /* VGA hardware registers are available for this mode */
127 #define VM_NO_VGA_MEM 0x0040 /* VGA memory window is available for this mode */
128 #define VM_LINEAR_FB 0x0080 /* Linear framebuffer is available for this mode */
129 #define VM_DBLSCAN 0x0200 /* Double-scan is available for this mode */
130 #define VM_LACE 0x0200 /* Interlace is available for this mode */
131 #define VM_TPLBUF 0x0400 /* Triple-buffering is supported for this mode */
132 #define VM_STEREO 0x0800 /* Stereoscopic display is supported for this mode */
133 #define VM_DUALDISP 0x1000 /* Dual display start address is supported */
135 /* Memory model types */
136 #define VMEM_TEXT 0x00 /* Text mode */
137 #define VMEM_CGA 0x01 /* CGA graphics */
138 #define VMEM_HERCULES 0x02 /* Hercules */
139 #define VMEM_PLANAR 0x03 /* Planar */
140 #define VMEM_PACKED 0x04 /* Packet pixel */
141 #define VMEM_NONCHAIN 0x05 /* Non-chained 4,256 color */
142 #define VMEM_RGB 0x06 /* Direct-color RGB */
143 #define VMEM_YUV 0x07 /* Direct-color YUV */
145 /* Direct color mode flags */
146 #define DAC_RAMP_PROGRAMMABLE 0x01 /* DAC ramp can be programmed */
147 #define USER_RESERVED_FIELD 0x02 /* Reserved fields are available for user */
149 #endif