Rev 3675 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 3675 | Rev 4377 | ||
|---|---|---|---|
| Line 54... | Line 54... | ||
| 54 | uint16_t vesa_width; |
54 | uint16_t vesa_width; |
| 55 | uint16_t vesa_height; |
55 | uint16_t vesa_height; |
| 56 | uint16_t vesa_bpp; |
56 | uint16_t vesa_bpp; |
| 57 | uint16_t vesa_scanline; |
57 | uint16_t vesa_scanline; |
| 58 | 58 | ||
| - | 59 | uint8_t vesa_red_mask; |
|
| - | 60 | uint8_t vesa_red_pos; |
|
| - | 61 | ||
| - | 62 | uint8_t vesa_green_mask; |
|
| - | 63 | uint8_t vesa_green_pos; |
|
| - | 64 | ||
| - | 65 | uint8_t vesa_blue_mask; |
|
| - | 66 | uint8_t vesa_blue_pos; |
|
| - | 67 | ||
| 59 | int vesa_present(void) |
68 | int vesa_present(void) |
| 60 | { |
69 | { |
| 61 | if (vesa_width != 0xffff) |
- | |
| 62 | return true; |
- | |
| 63 | if (vesa_height != 0xffff) |
70 | if ((vesa_width != 0xffff) && (vesa_height != 0xffff)) |
| 64 | return true; |
71 | return true; |
| - | 72 | ||
| 65 | return false; |
73 | return false; |
| 66 | } |
74 | } |
| 67 | 75 | ||
| 68 | void vesa_init(void) |
76 | void vesa_init(void) |
| 69 | { |
77 | { |
| Line 72... | Line 80... | ||
| 72 | switch (vesa_bpp) { |
80 | switch (vesa_bpp) { |
| 73 | case 8: |
81 | case 8: |
| 74 | visual = VISUAL_INDIRECT_8; |
82 | visual = VISUAL_INDIRECT_8; |
| 75 | break; |
83 | break; |
| 76 | case 16: |
84 | case 16: |
| - | 85 | if ((vesa_red_mask == 5) && (vesa_red_pos == 10) |
|
| - | 86 | && (vesa_green_mask == 5) && (vesa_green_pos == 5) |
|
| - | 87 | && (vesa_blue_mask == 5) && (vesa_blue_pos == 0)) |
|
| - | 88 | visual = VISUAL_RGB_5_5_5; |
|
| - | 89 | else |
|
| 77 | visual = VISUAL_RGB_5_6_5; |
90 | visual = VISUAL_RGB_5_6_5; |
| 78 | break; |
91 | break; |
| 79 | case 24: |
92 | case 24: |
| 80 | visual = VISUAL_RGB_8_8_8; |
93 | visual = VISUAL_RGB_8_8_8; |
| 81 | break; |
94 | break; |
| 82 | case 32: |
95 | case 32: |
| 83 | visual = VISUAL_RGB_0_8_8_8; |
96 | visual = VISUAL_RGB_0_8_8_8; |
| 84 | break; |
97 | break; |
| 85 | default: |
98 | default: |
| 86 | panic("Unsupported bits per pixel"); |
99 | panic("Unsupported bits per pixel."); |
| 87 | } |
100 | } |
| 88 | 101 | ||
| 89 | fb_properties_t vesa_props = { |
102 | fb_properties_t vesa_props = { |
| 90 | .addr = vesa_ph_addr, |
103 | .addr = vesa_ph_addr, |
| 91 | .offset = 0, |
104 | .offset = 0, |
| Line 95... | Line 108... | ||
| 95 | .visual = visual, |
108 | .visual = visual, |
| 96 | }; |
109 | }; |
| 97 | fb_init(&vesa_props); |
110 | fb_init(&vesa_props); |
| 98 | } |
111 | } |
| 99 | 112 | ||
| - | 113 | void vesa_redraw(void) |
|
| - | 114 | { |
|
| - | 115 | fb_redraw(); |
|
| - | 116 | } |
|
| - | 117 | ||
| 100 | #endif |
118 | #endif |
| 101 | 119 | ||
| 102 | /** @} |
120 | /** @} |
| 103 | */ |
121 | */ |