2 * This file and its contents are supplied under the terms of the
3 * Common Development and Distribution License ("CDDL"), version 1.0.
4 * You may only use this file in accordance with the terms of version
7 * A full copy of the text of the CDDL should have accompanied this
8 * source. A copy of the CDDL is also available via the Internet at
9 * http://www.illumos.org/license/CDDL.
13 * Copyright 2017 Toomas Soome <tsoome@me.com>
20 #include <sys/visual_io.h>
21 #include <sys/multiboot2.h>
28 #define EDID_MAGIC { 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00 }
31 uint8_t header
[8]; /* fixed header pattern */
32 uint16_t manufacturer_id
;
33 uint16_t product_code
;
34 uint32_t serial_number
;
35 uint8_t week_of_manufacture
;
36 uint8_t year_of_manufacture
;
41 struct edid_basic_display_parameters
{
42 uint8_t video_input_parameters
;
43 uint8_t max_horizontal_image_size
;
44 uint8_t max_vertical_image_size
;
45 uint8_t display_gamma
;
46 uint8_t supported_features
;
49 struct edid_chromaticity_coordinates
{
51 uint8_t blue_white_lo
;
62 struct edid_detailed_timings
{
64 uint8_t horizontal_active_lo
;
65 uint8_t horizontal_blanking_lo
;
66 uint8_t horizontal_hi
;
67 uint8_t vertical_active_lo
;
68 uint8_t vertical_blanking_lo
;
70 uint8_t horizontal_sync_offset_lo
;
71 uint8_t horizontal_sync_pulse_width_lo
;
72 uint8_t vertical_sync_lo
;
74 uint8_t horizontal_image_size_lo
;
75 uint8_t vertical_image_size_lo
;
76 uint8_t image_size_hi
;
77 uint8_t horizontal_border
;
78 uint8_t vertical_border
;
82 struct vesa_edid_info
{
83 struct edid_header header
;
84 struct edid_basic_display_parameters display
;
85 #define EDID_FEATURE_PREFERRED_TIMING_MODE (1 << 1)
86 struct edid_chromaticity_coordinates chromaticity
;
87 uint8_t established_timings_1
;
88 uint8_t established_timings_2
;
89 uint8_t manufacturer_reserved_timings
;
90 uint16_t standard_timings
[8];
91 struct edid_detailed_timings detailed_timings
[4];
92 uint8_t number_of_extensions
;
96 extern multiboot_tag_framebuffer_t gfx_fb
;
98 void gfx_framework_init(struct visual_ops
*);
99 uint32_t gfx_fb_color_map(uint8_t);
100 void gfx_fb_display_cursor(struct vis_conscursor
*);
101 void gfx_fb_setpixel(uint32_t, uint32_t);
102 void gfx_fb_drawrect(uint32_t, uint32_t, uint32_t, uint32_t, uint32_t);
103 void gfx_term_drawrect(uint32_t, uint32_t, uint32_t, uint32_t);
104 void gfx_fb_line(uint32_t, uint32_t, uint32_t, uint32_t, uint32_t);
105 void gfx_fb_bezier(uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t,
107 void plat_cons_update_mode(int);
108 int gfx_fb_putimage(png_t
*);
110 bool gfx_parse_mode_str(char *, int *, int *, int *);
115 #endif /* _GFX_FB_H */