Commit graph

66 commits

Author SHA1 Message Date
Vladimir Serbinenko
36bcaf2903 * include/grub/video.h (grub_video_rgba_color_rgb): Fix prototype
to use uint8_t for color.
2013-12-21 14:31:47 +01:00
Vladimir Serbinenko
184c61ddce Add Radeon Yeeloong 3A support. 2013-12-17 22:52:04 +01:00
Vladimir Serbinenko
71669c3b76 Implement XEN VFB support. 2013-12-17 13:07:26 +01:00
Vladimir Serbinenko
7e47e27bd8 Add gcc_struct to all packed structures when compiling with mingw.
Just "packed" doesn't always pack the way we expect.
2013-12-15 14:14:30 +01:00
Vladimir Testov
4db2250000 * grub-core/gfxmenu/gui_box.c: Updated to work with area status.
* grub-core/gfxmenu/gui_canvas.c: Likewise.
        * grub-core/gfxmenu/view.c: Likewise.
        * grub-core/video/fb/video_fb.c: Introduce new functions:
        grub_video_set_area_status, grub_video_get_area_status,
        grub_video_set_region, grub_video_get_region.
        * grub-core/video/bochs.c: Likewise.
        * grub-core/video/capture.c: Likewise.
        * grub-core/video/video.c: Likewise.
        * grub-core/video/cirrus.c: Likewise.
        * grub-core/video/efi_gop.c: Likewise.
        * grub-core/video/efi_uga.c: Likewise.
        * grub-core/video/emu/sdl.c: Likewise.
        * grub-core/video/radeon_fuloong2e.c: Likewise.
        * grub-core/video/sis315pro.c: Likewise.
        * grub-core/video/sm712.c: Likewise.
        * grub-core/video/i386/pc/vbe.c: Likewise.
        * grub-core/video/i386/pc/vga.c: Likewise.
        * grub-core/video/ieee1275.c: Likewise.
        * grub-core/video/i386/coreboot/cbfb.c: Likewise.
        * include/grub/video.h: Likewise.
        * include/grub/video_fb.h: Likewise.
        * include/grub/fbfill.h: Updated render_target structure.
        grub_video_rect_t viewport, region, area
        int area_offset_x, area_offset_y, area_enabled
        * include/grub/gui.h: New helper function
        grub_video_bounds_inside_region.
        * docs/grub-dev.texi: Added information about new functions.
2013-11-08 15:42:38 +04:00
Vladimir 'phcoder' Serbinenko
fa471bfaaf * include/grub/video.h (grub_video_register): Keep double-linked as
well as single-linked invariants.
	Reported by: qwertial.
2013-07-25 16:58:26 +02:00
Vladimir 'phcoder' Serbinenko
fc4c4fddf6 Detach optional parts of gfxterm and integrate in with coreboot init. 2013-05-31 00:42:33 +02:00
Vladimir 'phcoder' Serbinenko
92323d1fb0 Speed-up gfxterm by saving intermediate results in index+alpha
format.
2013-05-04 13:58:30 +02:00
Vladimir 'phcoder' Serbinenko
813c16222f Add missing exports on mips. 2013-05-02 18:10:11 +02:00
Vladimir 'phcoder' Serbinenko
5036166022 First automated video test (running videotest and comparing results) 2013-05-02 14:39:03 +02:00
Vladimir 'phcoder' Serbinenko
45fbd9a23f Add missing video ids to coreboot and ieee1275 video. 2013-04-24 14:44:15 +02:00
Vladimir 'phcoder' Serbinenko
a79b8a1584 Merge powerpc grub-mkrescue flavour with common. Use xorriso HFS+
feature for it.
2013-04-11 23:15:26 +02:00
Vladimir 'phcoder' Serbinenko
3056d3e752 Remove nested functions from videoinfo iterators. 2013-03-01 11:11:36 +01:00
Vladimir 'phcoder' Serbinenko
036985b8ce Remove grub_{modname}_init and grub_{modname}_fini. They should never
be used directly if it's really a module and GRUB_MOD_INIT shouldn't
	be used on non-modules.

	* grub-core/commands/boot.c (GRUB_MOD_INIT) [LOONGSON || QEMU_MIPS]:
	Rename to grub_boot_init.
	(GRUB_MOD_FINI) [LOONGSON || QEMU_MIPS]: Rename to grub_boot_fini.
	* grub-core/commands/keylayouts.c (GRUB_MOD_INIT)
	[LOONGSON || QEMU_MIPS]: Rename to grub_keylayouts_init.
	(GRUB_MOD_FINI) [LOONGSON || QEMU_MIPS]: Rename to grub_keylayouts_fini.
	* grub-core/font/font_cmd.c (GRUB_MOD_INIT)
	[LOONGSON || QEMU_MIPS]: Rename to grub_font_init.
	(GRUB_MOD_FINI) [LOONGSON || QEMU_MIPS]: Rename to grub_font_fini.
	* grub-core/kern/mips/loongson/init.c: Replace explicit protos with
	includes.
	(grub_machine_init): Remove empty inits.
	* grub-core/kern/mips/qemu_mips/init.c: Replace explicit protos with
	includes.
	(grub_machine_init): Remove empty inits.
	* grub-core/term/arc/console.c: Remove explicit proto.
	* grub-core/term/at_keyboard.c (GRUB_MOD_INIT)
	[LOONGSON || QEMU_MIPS]: Rename to grub_at_keyboard_init.
	(GRUB_MOD_FINI) [LOONGSON || QEMU_MIPS]: Rename to
	grub_at_keyboard_fini.
	* grub-core/term/gfxterm.c (GRUB_MOD_INIT)
	[LOONGSON || QEMU_MIPS]: Rename to grub_gfxterm_init.
	(GRUB_MOD_FINI) [LOONGSON || QEMU_MIPS]: Rename to
	grub_gfxterm_fini.
	* grub-core/term/i386/pc/vga_text.c (GRUB_MOD_INIT)
	[LOONGSON || QEMU_MIPS]: Rename to grub_vgatext_init.
	(GRUB_MOD_FINI) [LOONGSON || QEMU_MIPS]: Rename to
	grub_vgatext_fini.
	* grub-core/term/ieee1275/console.c: Remove explicit proto.
	* grub-core/term/serial.c (GRUB_MOD_INIT)
	[LOONGSON || QEMU_MIPS]: Rename to grub_serial_init.
	(GRUB_MOD_FINI) [LOONGSON || QEMU_MIPS]: Rename to
	grub_serial_fini.
	* grub-core/term/terminfo.c (GRUB_MOD_INIT)
	[LOONGSON || QEMU_MIPS]: Rename to grub_terminfo_init.
	(GRUB_MOD_FINI) [LOONGSON || QEMU_MIPS]: Rename to
	grub_terminfo_fini.
	* grub-core/video/bitmap.c (GRUB_MOD_INIT): Removed.
	(GRUB_MOD_FINI): Likewise.
	* grub-core/video/radeon_fuloong2e.c (GRUB_MOD_INIT)
	[LOONGSON]: Rename to grub_video_radeon_fuloong2e_init.
	(GRUB_MOD_FINI) [LOONGSON]: Rename to
	grub_video_radeon_fuloong2e_fini.
	* grub-core/video/sis315pro.c (GRUB_MOD_INIT)
	[LOONGSON]: Rename to grub_video_sis315pro_init.
	(GRUB_MOD_FINI) [LOONGSON]: Rename to
	grub_video_sis315pro_fini.
	* grub-core/video/sm712.c (GRUB_MOD_INIT)
	[LOONGSON]: Rename to grub_video_sm712_init.
	(GRUB_MOD_FINI) [LOONGSON]: Rename to
	grub_video_sm712_fini.
	* include/grub/at_keyboard.h (grub_at_keyboard_init): New proto.
	(grub_at_keyboard_fini): Likewise.
	* include/grub/dl.h (GRUB_MOD_INIT) [!GRUB_UTIL && !EMU]:
	Don't declare grub_{modname}_init.
	(GRUB_MOD_INIT) [!GRUB_UTIL && !EMU]: Don't declare grub_{modname}_fini.
	* include/grub/keyboard_layouts.h (grub_keylayouts_init) [!EMU]:
	New proto.
	(grub_keylayouts_fini) [!EMU]: Likewise.
	* include/grub/serial.h (grub_serial_init) [!EMU]:
	New proto.
	(grub_serial_fini) [!EMU]: Likewise.
	* include/grub/terminfo.h (grub_terminfo_init) [!EMU]:
	New proto.
	(grub_terminfo_fini) [!EMU]: Likewise.
	* include/grub/video.h (grub_font_init) [!EMU]:
	New proto.
	(grub_font_fini) [!EMU]: Likewise.
	(grub_gfxterm_init) [!EMU]: Likewise.
	(grub_gfxterm_fini) [!EMU]: Likewise.
	(grub_video_sm712_init) [!EMU]: Likewise.
	(grub_video_sm712_fini) [!EMU]: Likewise.
	(grub_video_sis315pro_init) [!EMU]: Likewise.
	(grub_video_sis315pro_fini) [!EMU]: Likewise.
	(grub_video_radeon_fuloong2e_init) [!EMU]: Likewise.
	(grub_video_radeon_fuloong2e_fini) [!EMU]: Likewise.
2012-02-27 00:28:45 +01:00
Vladimir 'phcoder' Serbinenko
87edb8940a Replace single-linked with double-linked lists. It results in more
compact and more efficient code.

	* grub-core/kern/list.c (grub_list_push): Moved from here ...
	* include/grub/list.h (grub_list_push): ... to here. Set prev.
	(grub_list_remove): Moved from here ...
	* include/grub/list.h (grub_list_remove): ... here. Use and set prev.
	(grub_prio_list_insert): Set prev.
	* include/grub/list.h (grub_list): Add prev. All users updated.
2012-01-24 13:31:12 +01:00
Vladimir 'phcoder' Serbinenko
d94497eaca * grub-core/Makefile.core.def (kernel): Add video/radeon_fuloong2e.c on
loongson.
	* grub-core/kern/mips/loongson/init.c (grub_machine_init): Init
	video_radeon_fuloong2e.
	* grub-core/video/radeon_fuloong2e.c: New file.
	* include/grub/video.h (grub_video_id_t): Add new ID
	GRUB_VIDEO_DRIVER_RADEON_FULOONG2E.
2011-08-19 23:08:36 +02:00
Vladimir 'phcoder' Serbinenko
6be1c01fd7 * include/grub/video.h: add missing EXPORT_FUND on
grub_video_edid_checksum and grub_video_edid_preferred_mode.
2011-07-23 17:18:31 +02:00
Colin Watson
e806ce60ee merge trunk 2011-05-18 16:53:36 +01:00
Colin Watson
e2965f4a32 Move gfxmenu color handling to video, so that gfxterm can use it
too.

* grub-core/gfxmenu/named_colors.c: Move to ...
* grub-core/video/colors.c: ... here.  Rename
grub_gui_get_named_color to grub_video_get_named_color.
* grub-core/gfxmenu/gui_string_util.c (my_isxdigit): Move to ...
* grub-core/video/colors.c (my_isxdigit): ... here.
* grub-core/gfxmenu/gui_string_util.c (parse_hex_color_component):
Move to ...
* grub-core/video/colors.c (parse_hex_color_component): ... here.
* grub-core/gfxmenu/gui_string_util.c (grub_gui_parse_color): Move
to ...
* grub-core/video/colors.c (grub_video_parse_color): ... here.

* include/grub/gui.h (grub_gui_color_t): Move to ...
* include/grub/video.h (grub_video_rgba_color_t): ... here.
* include/grub/gui.h (grub_gui_color_rgb): Move to ...
* include/grub/video.h (grub_video_rgba_color_rgb): ... here.
* include/grub/gui.h (grub_gui_map_color): Move to ...
* include/grub/video.h (grub_video_map_rgba_color): ... here.
* include/grub/gui_string_util.h (grub_gui_get_named_color): Move
to ...
* include/grub/video.h (grub_video_get_named_color): ... here.
* include/grub/gui_string_util.h (grub_gui_parse_color): Move to ...
* include/grub/video.h (grub_video_parse_color): ... here.

* grub-core/Makefile.core.def (kernel) [videoinkernel]: Add
video/colors.c.
(gfxmenu): Remove gfxmenu/named_colors.c.
(video) [videomodules]: Add video/colors.c.

Add a background_color command.

* grub-core/term/gfxterm.c (grub_gfxterm_background_color_cmd): New
function.
(GRUB_MOD_INIT): Register background_color command.
(GRUB_MOD_FINI): Unregister background_color command.
(redraw_screen_rect): Allow blend/replace of text layer to be
controlled independently from whether there is a background bitmap.
(grub_gfxterm_background_image_cmd): Change blend_text_bg when
changing bitmap.
2011-05-18 12:44:24 +01:00
Vladimir 'phcoder' Serbinenko
01b08a0f15 initial SIS315PRO support 2011-01-18 13:44:16 +01:00
Colin Watson
9b300caf84 grub_video_get_edid is not usable from grub_vbe_get_preferred_mode, as a
video adapter has not necessarily yet been set.  Use grub_video_vbe_get_edid
and grub_video_edid_checksum directly instead.  Remove grub_video_get_edid
as it now has no users.
Reported by: Marjo Mercado.
2011-01-17 12:07:47 +00:00
Colin Watson
129185cfaa move more EDID-handling functions to generic code, and make videoinfo display EDID information 2010-12-14 18:03:34 +00:00
Colin Watson
25d884a52a move generic parts of EDID handling (structure, checksumming) to generic location 2010-12-14 17:06:32 +00:00
Colin Watson
52832c554c Move gfxmenu color handling to video, so that gfxterm can use it
too.

* grub-core/gfxmenu/named_colors.c: Move to ...
* grub-core/video/colors.c: ... here.  Rename
grub_gui_get_named_color to grub_video_get_named_color.
* grub-core/gfxmenu/gui_string_util.c (my_isxdigit): Move to ...
* grub-core/video/colors.c (my_isxdigit): ... here.
* grub-core/gfxmenu/gui_string_util.c (parse_hex_color_component):
Move to ...
* grub-core/video/colors.c (parse_hex_color_component): ... here.
* grub-core/gfxmenu/gui_string_util.c (grub_gui_parse_color): Move
to ...
* grub-core/video/colors.c (grub_video_parse_color): ... here.

* include/grub/gui.h (grub_gui_color_t): Move to ...
* include/grub/video.h (grub_video_rgba_color_t): ... here.
* include/grub/gui.h (grub_gui_color_rgb): Move to ...
* include/grub/video.h (grub_video_rgba_color_rgb): ... here.
* include/grub/gui.h (grub_gui_map_color): Move to ...
* include/grub/video.h (grub_video_map_rgba_color): ... here.
* include/grub/gui_string_util.h (grub_gui_get_named_color): Move
to ...
* include/grub/video.h (grub_video_get_named_color): ... here.
* include/grub/gui_string_util.h (grub_gui_parse_color): Move to ...
* include/grub/video.h (grub_video_parse_color): ... here.

* grub-core/Makefile.core.def (kernel) [videoinkernel]: Add
video/colors.c.
(gfxmenu): Remove gfxmenu/named_colors.c.
(video_colors) [videomodules]: New module, containing
video/colors.c.
2010-12-10 16:45:58 +00:00
Vladimir 'phcoder' Serbinenko
4dd58a6edd Change video_mode_type to an enum, fix collisions and add a bit more info 2010-09-12 02:09:09 +02:00
Vladimir 'phcoder' Serbinenko
d2467d2361 Add Hercules, Planar and YUV to videoinfo (not tested) 2010-09-12 01:45:58 +02:00
Vladimir 'phcoder' Serbinenko
380c39cb25 Show adapter-specific info 2010-09-03 22:11:22 +02:00
Vladimir 'phcoder' Serbinenko
4787931fe0 Show mode id 2010-09-03 21:40:40 +02:00
Vladimir 'phcoder' Serbinenko
540e2fe185 Initial videoinfo implementation 2010-09-03 21:19:22 +02:00
Vladimir 'phcoder' Serbinenko
e8d0a8f85c Merge mainline into bidi 2010-07-02 19:35:07 +02:00
Vladimir 'phcoder' Serbinenko
05e5187978 Cirrus 5446 and Bochs video cards support.
* conf/i386.rmk (pkglib_MODULES): Add video_cirrus.mod and
	video_bochs.mod
	(video_cirrus_mod_SOURCES): New variable.
	(video_cirrus_mod_CFLAGS): Likewise.
	(video_cirrus_mod_LDFLAGS): Likewise.
	(video_bochs_mod_SOURCES): Likewise.
	(video_bochs_mod_CFLAGS): Likewise.
	(video_bochs_mod_LDFLAGS): Likewise.
	* include/grub/vga.h: New file.
	* include/grub/video_fb.h (grub_video_fb_doublebuf_blit_init): Removed.
	(grub_video_fb_set_page_t): New type.
	(grub_video_fb_setup): New prototype.
	(grub_video_fb_swap_buffers): Likewise.
	(grub_video_fb_get_info_and_fini): Likewise.
	* term/i386/pc/vga_text.c (CRTC_ADDR_PORT): Moved to include/grub/vga.h.
	(CRTC_DATA_PORT): Likewise.
	(CRTC_CURSOR): Likewise.
	(CRTC_CURSOR_ADDR_HIGH): Likewise.
	(CRTC_CURSOR_ADDR_LOW): Likewise.
	(CRTC_CURSOR_DISABLE): Likewise.
	(update_cursor): Use grub_vga_cr_write.
	(grub_vga_text_setcursor): Likewise.
	* video/bochs.c: New file.
	* video/fb/video_fb.c (render_target): Moved into framebuffer variable.
	(palette): Likewise.
	(palette_size): Likewise.
	(framebuffer): New variable.
	(grub_video_fb_init): Use 'framebuffer'.
	(grub_video_fb_fini): Likewise.
	(grub_video_fb_get_info): Likewise.
	(grub_video_fb_get_palette): Likewise.
	(grub_video_fb_set_palette): Likewise.
	(grub_video_fb_set_viewport): Likewise.
	(grub_video_fb_get_viewport): Likewise.
	(grub_video_fb_map_color): Likewise.
	(grub_video_fb_map_rgb): Likewise.
	(grub_video_fb_map_rgba): Likewise.
	(grub_video_fb_unmap_color): Likewise.
	(grub_video_fb_unmap_color_int): Likewise.
	(grub_video_fb_fill_rect): Likewise.
	(grub_video_fb_blit_bitmap): Likewise.
	(grub_video_fb_blit_render_target): Likewise.
	(grub_video_fb_scroll): Likewise.
	(grub_video_fb_create_render_target): Likewise.
	(grub_video_fb_doublebuf_blit_init): Likewise.
	(grub_video_fb_set_active_render_target): Handle doublebuffering.
	(doublebuf_pageflipping_update_screen): New function.
	(doublebuf_pageflipping_init): Likewise.
	(grub_video_fb_setup): Likewise.
	(grub_video_fb_swap_buffers): Likewise.
	(grub_video_fb_get_info_and_fini): Likewise.
	* video/i386/pc/vbe.c (framebuffer): Remove all doublebuffering fields.
	All users updated.
	(doublebuf_pageflipping_commit): Restructured into ...
	(doublebuf_pageflipping_set_page): ... this.
	(doublebuf_pageflipping_update_screen): Removed.
	(doublebuf_pageflipping_init): Likewise.
	(double_buffering_init): Likewise.
	(grub_video_vbe_setup): Use grub_video_fb_setup.
	(grub_video_vbe_swap_buffers): Removed.
	(grub_video_vbe_set_active_render_target): Likewise.
	(grub_video_vbe_get_active_render_target): Likewise.
	(grub_video_vbe_get_info_and_fini): Use grub_video_fb_get_info_and_fini.
	(grub_video_vbe_adapter): Use grub_video_fb_swap_buffers,
	grub_video_fb_set_active_render_target and
	grub_video_fb_get_active_render_target.
	* video/i386/pc/vga.c (SEQUENCER_ADDR_PORT): Move to include/grub/vga.h.
	(SEQUENCER_DATA_PORT): Likewise.
	(MAP_MASK_REGISTER): Likewise.
	(CRTC_ADDR_PORT): Likewise.
	(CRTC_DATA_PORT): Likewise.
	(START_ADDR_HIGH_REGISTER): Likewise.
	(START_ADDR_LOW_REGISTER): Likewise.
	(GRAPHICS_ADDR_PORT): Likewise.
	(GRAPHICS_DATA_PORT): Likewise.
	(READ_MAP_REGISTER): Likewise.
	(INPUT_STATUS1_REGISTER): Likewise.
	(INPUT_STATUS1_VERTR_BIT): Likewise.
	(get_map_mask): Use grub_vga_sr_read.
	(set_map_mask): Use grub_vga_sr_write.
	(set_read_map): Use grub_vga_gr_write.
	(set_start_address): Use grub_vga_cr_write.
	* video/sm712.c (framebuffer): Remove leftover fields.
2010-06-20 14:15:20 +02:00
Vladimir 'phcoder' Serbinenko
d49703d151 Add priorities support 2010-06-12 17:38:48 +02:00
Colin Watson
7beac90c5f Avoid false positives in fs.lst, partmap.lst, and video.lst due to
prototype declarations.
* genmk.rb (PModule::rule): Define GRUB_LST_GENERATOR when
generating fs, partmap, and video lists.
* include/grub/fs.h (grub_fs_register): Omit prototype if
GRUB_LST_GENERATOR is defined.
* include/grub/partition.h (grub_partition_map_register): Likewise.
* include/grub/video.h (grub_video_register): Likewise.
2010-06-12 14:33:09 +01:00
Vladimir 'phcoder' Serbinenko
3a37e3226b Use FOR_* macros instead of *_iterate whenever possible.
* commands/handler.c: Removed.
	* commands/help.c (grub_cmd_help): Use FOR_COMMANDS.
	* commands/minicmd.c (grub_mini_cmd_lsmod): Use FOR_DL_MODULES.
	* conf/any-emu.rmk (kernel_img_SOURCES): Remove kern/handler.c.
	* conf/common.rmk (script/lexer.c_DEPENDENCIES): Add grub_script.yy.h.
	(grub_probe_SOURCES): Remove kern/parser.c.
	(util/grub-script-check.c_DEPENDENCIES): Removed.
	(grub_script_check_SOURCES): Remove kern/handler.c, kern/parser.c
	and grub_script_check_init.c.
	(grub_script_check_init.lst): Removed.
	(grub_script_check_init.h): Likewise.
	(grub_script_check_init.c): Likewise.
	(pkglib_MODULES): Remove handler.mod and sh.mod.
	(handler_mod_SOURCES): Removed.
	(handler_mod_CFLAGS): Likewise.
	(handler_mod_LDFLAGS): Likewise.
	(normal_mod_SOURCES): Remove normal/handler.c.
	Add script/main.c, script/script.c, script/execute.c,
	script/function.c, script/lexer.c, grub_script.tab.c
	and grub_script.yy.c.
	* conf/i386-coreboot.rmk (kernel_img_SOURCES): Remove kern/handler.c.
	* conf/i386-ieee1275.rmk (kernel_img_SOURCES): Likewise.
	* conf/i386-pc.rmk (kernel_img_SOURCES): Likewise.
	(grub_setup_SOURCES): Remove kern/parser.c.
	* conf/i386-qemu.rmk (kernel_img_SOURCES): Remove kern/handler.c.
	* conf/mips-qemu-mips.rmk (kernel_img_SOURCES): Likewise.
	* conf/mips-yeeloong.rmk (kernel_img_SOURCES): Likewise.
	* conf/powerpc-ieee1275.rmk (kernel_img_SOURCES): Likewise.
	* conf/sparc64-ieee1275.rmk (kernel_img_SOURCES): Likewise.
	(grub_setup_SOURCES): Remove kern/parser.c.
	* conf/x86-efi.rmk (kernel_img_SOURCES): Remove kern/handler.c.
	* gettext/gettext.c (grub_gettext_delete_list): Don't use grub_list_pop.
	* include/grub/command.h (grub_command_iterate): Removed.
	(FOR_COMMANDS): New macro.
	* include/grub/dl.h (grub_dl): New member next.
	(grub_dl_iterate): Removed.
	(grub_dl_head): New variable declaration.
	(FOR_DL_MODULES): New macro.
	* include/grub/fs.h: Include list.h.
	(grub_fs): Make next first element.
	(grub_fs_list): New variable declaration.
	(grub_fs_register): Make inline.
	(grub_fs_unregister): Likewise.
	(grub_fs_iterate): Removed.
	(FOR_FILESYSTEMS): New macro.
	* include/grub/handler.h: Removed.
	* include/grub/list.h (grub_list_hook_t): Removed.
	(grub_list_test_t): Likewise.
	(grub_list_pop): Likewise.
	(grub_list_iterate): Likewise.
	(grub_list_insert): Likewise.
	(FOR_LIST_ELEMENTS): New macro.
	* include/grub/parser.h (grub_parser_class): Removed.
	(grub_parser_register): Likewise.
	(grub_parser_unregister): Likewise.
	(grub_parser_get_current): Likewise.
	(grub_parser_set_current): Likewise.
	(grub_register_rescue_parser): Likewise.
	(grub_rescue_parse_line): New function.
	* include/grub/partition.h (FOR_PARTITION_MAPS): Use FOR_LIST_ELEMENTS.
	* include/grub/script_sh.h (grub_script_function_list): New variable
	declaration.
	(FOR_SCRIPT_FUNCTIONS): New macro.
	(grub_script_function_iterate): Removed.
	(grub_normal_parse_line): New prototype.
	* include/grub/term.h (FOR_ACTIVE_TERM_INPUTS): Use FOR_LIST_ELEMENTS.
	(FOR_DISABLED_TERM_INPUTS): Likewise.
	(FOR_ACTIVE_TERM_OUTPUTS): Likewise.
	(FOR_DISABLED_TERM_OUTPUTS): Likewise.
	* include/grub/video.h (grub_video_adapter): Move 'next' to first
	element.
	(grub_video_register): Inline.
	(grub_video_unregister): Likewise.
	(grub_video_adapter_list): New variable declaration.
	(grub_video_iterate): Removed.
	(FOR_VIDEO_ADAPTERS): New macro.
	* kern/dl.c (grub_dl_list): Removed. All users updated.
	(grub_dl_iterate): Removed.
	* kern/fs.c (grub_fs_list): Make global.
	(grub_fs_register): Removed.
	(grub_fs_unregister): Likewise.
	(grub_fs_iterate): Likewise.
	* kern/handler.c: Removed.
	* kern/list.c (grub_list_pop): Removed.
	(grub_list_iterate): Likewise.
	(grub_list_insert): Likewise.
	(grub_named_list_find): Use FOR_LIST_ELEMENTS.
	(grub_prio_list_insert): Don't use grub_list_insert.
	* kern/main.c (grub_register_rescue_parser): Don't call
	grub_register_rescue_parser.
	* kern/parser.c (grub_parser_class): Removed.
	(grub_parser_execute): Use grub_rescue_parse_line.
	* kern/rescue_parser.c (grub_rescue_parse_line): Make global.
	(grub_rescue_parser): Removed.
	(grub_register_rescue_parser): Likewise.
	* kern/rescue_reader.c (grub_rescue_run): Use grub_rescue_parse_line.
	* normal/auth.c (is_authenticated): Use FOR_LIST_ELEMENTS.
	(grub_auth_check_authentication): Likewise.
	* normal/completion.c (iterate_command): Removed.
	(grub_normal_do_completion): Use FOR_COMMANDS.
	* normal/handler.c: Removed.
	* normal/main.c (read_config_file): Remove parser changing.
	(grub_normal_execute): Don't call read_handler_list.
	(grub_normal_read_line_real): Statically allocate prompt.
	(grub_cmdline_run): Use grub_normal_parse_line.
	(GRUB_MOD_FINI): Don't call free_handler_list.
	* normal/menu_entry.c (run): Likewise.
	* script/function.c (grub_script_function_list): Make global.
	(grub_script_function_iterate): Removed.
	* script/main.c (grub_normal_parse_line): Make global.
	(grub_sh_parser): Removed.
	(GRUB_MOD_INIT): Likewise.
	(GRUB_MOD_FINI): Likewise.
	* tests/lib/functional_test.c (grub_functional_test): Use
	FOR_LIST_ELEMENTS.
	* tests/lib/test.c (free_failures): Don't use grub_list_pop.
	(grub_test_run): Use FOR_LIST_ELEMENTS.
	* tests/lib/unit_test.c (main): Likewise.
	* util/deviceiter.c (grub_util_iterate_devices): Don't use
	grub_list_pop.
	* util/grub-fstest.c (grub_term_input_class): Removed.
	(grub_term_output_class): Likewise.
	* util/grub-probe.c: Likewise.
	* util/i386/pc/grub-setup.c: Likewise.
	* util/sparc64/ieee1275/grub-setup.c: Likewise.
	* util/grub-script-check.c (main): Don't call grub_init_all and
	grub_fini_all.
	* video/video.c (grub_video_adapter_list): Make global.
	(grub_video_register): Removed.
	(grub_video_unregister): Likewise.
	(grub_video_iterate): Likewise.
2010-06-11 22:31:16 +02:00
Vladimir 'phcoder' Serbinenko
368e544ba6 Add bochs video support 2010-05-17 01:18:50 +02:00
Vladimir 'phcoder' Serbinenko
94bf3dd564 somewhat working video_cirrus implementation 2010-05-16 01:32:07 +02:00
Vladimir 'phcoder' Serbinenko
7dcef22cd3 merge mainline into bidi 2010-05-09 11:03:03 +02:00
Vladimir 'phcoder' Serbinenko
c6e5caab1d Transform (broken) vga terminal into (working) vga video driver.
* conf/i386-pc.rmk (vga_mod_SOURCES): Change term/i386/pc/vga.c to
	video/i386/pc/vga.c.
	* include/grub/video.h (grub_video_driver_id):
	Add GRUB_VIDEO_DRIVER_VGA.
	* term/i386/pc/vga.c: Renamed to ...
	* video/i386/pc/vga.c: ...this
	(DEBUG_VGA): Removed.
	(CHAR_WIDTH): Likewise.
	(CHAR_HEIGHT): Likewise.
	(TEXT_WIDTH): Likewise.
	(TEXT_HEIGHT): Likewise.
	(DEFAULT_FG_COLOR): Likewise.
	(DEFAULT_BG_COLOR): Likewise.
	(colored_char): Likewise.
	(xpos): Likewise.
	(ypos): Likewise.
	(cursor_state): Likewise.
	(fg_color): Likewise.
	(bg_color): Likewise.
	(text_buf): Likewise.
	(page): Likewise.
	(font): Likewise.
	(framebuffer): New variable.
	(set_read_map): Disabled.
	(setup): New variable.
	(is_target): Likewise.
	(grub_vga_mod_init): Likewise.
	(grub_vga_mod_fini): Likewise.
	(check_vga_mem): Likewise.
	(write_char): Likewise.
	(write_cursor): Likewise.
	(scroll_up): Likewise.
	(grub_vga_putchar): Likewise.
	(grub_vga_getcharwidth): Likewise.
	(grub_vga_getwh): Likewise.
	(grub_vga_getxy): Likewise.
	(grub_vga_gotoxy): Likewise.
	(grub_vga_cls): Likewise.
	(grub_vga_setcolorstate): Likewise.
	(grub_vga_setcursor): Likewise.
	(grub_video_vga_init): New function.
	(grub_video_vga_setup): Likewise.
	(grub_video_vga_fini): Likewise.
	(update_target): Likewise.
	(grub_video_vga_blit_bitmap): Likewise.
	(grub_video_vga_blit_render_target): Likewise.
	(grub_video_vga_set_active_render_target): Likewise.
	(grub_video_vga_get_active_render_target): Likewise.
	(grub_video_vga_swap_buffers): Likewise.
	(grub_video_vga_set_palette): Likewise.
	(grub_video_vga_get_info_and_fini): Likewise.
	(grub_vga_term): Removed.
	(grub_video_vga_adapter): New variable.
	(GRUB_MOD_INIT): Register a video driver instead of terminal.
	(GRUB_MOD_FINI): Unrefister a video driver instead of terminal.
2010-05-09 11:00:21 +02:00
Vladimir 'phcoder' Serbinenko
4a55d631d7 Merge mainline into for_macros 2010-04-09 22:35:32 +02:00
Vladimir 'phcoder' Serbinenko
9e71201f48 merge mainline into bidi 2010-04-09 19:31:43 +02:00
Vladimir 'phcoder' Serbinenko
a60f822cb2 Add missing id field to grub_video_sm712_adapter 2010-04-03 14:12:43 +02:00
Vladimir 'phcoder' Serbinenko
9eade9dbd7 Remove grub_video_iterate 2010-03-27 00:36:28 +01:00
Vladimir 'phcoder' Serbinenko
53f312c1cf Merge mainline into bidi 2010-03-15 10:28:09 +01:00
Vladimir 'phcoder' Serbinenko
c140a18037 2010-02-25 Vladimir Serbinenko <phcoder@gmail.com>
Don't compile video modules on yeeloong since video subsystem is part
	of kernel.

	* conf/common.rmk (pkglib_MODULES) [yeeloong]: Remove video.mod,
	video_fb.mod, bitmap.mod, font.mod, gfxterm.mod and bufio.mod
	* conf/mips-yeeloong.rmk (kernel_img_HEADERS): Add bitmap.h,
	video.h, gfxterm.h, font.h, bitmap_scale.h and bufio.h.
	* conf/mips.rmk (kernel_img_HEADERS): Add values instead of overwriting.
	* include/grub/bitmap.h: Add EXPORT_FUNC and EXPORT_VAR.
	* include/grub/bitmap_scale.h: Likewise.
	* include/grub/bufio.h: Likewise.
	* include/grub/font.h: Likewise.
	* include/grub/gfxterm.h: Likewise.
	* include/grub/video.h: Likewise.
	* include/grub/vbe.h: Don't include video_fb.h.
	* video/i386/pc/vbe.c: Include video_fb.h.
	* commands/i386/pc/vbetest.c: Include video.h.
2010-02-25 15:10:18 +01:00
Vladimir 'phcoder' Serbinenko
1f534b6908 Merge mainline into gfxmenu 2010-02-03 01:24:07 +01:00
Vladimir 'phcoder' Serbinenko
b0b139075e 2010-01-17 Vladimir Serbinenko <phcoder@gmail.com>
Use flag-based instead of hook-based video mode selection and "auto"
	keyword.

	* include/grub/video.h (grub_video_adapter): Changed 'setup' member.
	(grub_video_set_mode): Changed prototype. All users updated.
	(grub_video_check_mode_flag): New inline function.
	* video/video.c (parse_modespec): New function.
	(grub_video_set_mode): Parse flags and keywords.
2010-01-17 17:52:01 +01:00
Vladimir 'phcoder' Serbinenko
0d90e8a6fb 2010-01-15 Vladimir Serbinenko <phcoder@gmail.com>
Video driver ids.

	* include/grub/video.h (grub_video_driver_id): New type.
	(grub_video_adapter): New member 'id'. All users updated.
	(grub_video_get_driver_id): New proto.
	* video/video.c (grub_video_get_driver_id): New function.
2010-01-15 16:11:18 +01:00
Vladimir 'phcoder' Serbinenko
4361ca1c37 Restructure rendering to make extensions easier 2010-01-08 18:48:41 +01:00
Vladimir 'phcoder' Serbinenko
9a17588459 Initial support for scalable gfxmenu 2009-12-29 17:31:02 +01:00
Colin D Bennet
c51a5caeab 2009-11-14 Colin D Bennet <colin@gibibit.com>
2009-11-14  Vladimir Serbinenko  <phcoder@gmail.com>

	Support for gfxterm in a window.

	* include/grub/gfxterm.h: New file.
	* include/grub/video.h (struct grub_video_rect): New declaration.
	(grub_video_rect_t): Likewise.
	* term/gfxterm.c (struct grub_gfxterm_window): New type.
	(refcount): New variable.
	(render_target): Likewise.
	(window): Likewise.
	(repaint_callback): Likewise.
	(grub_virtual_screen_setup): Use 'render_target'.
	(init_window): New function.
	(grub_gfxterm_init_window): Likewise.
	(grub_gfxterm_init): Check reference counter.
	Use init_window.
	(destroy_window): New function.
	(grub_gfxterm_destroy_window): Likewise.
	(grub_gfxterm_fini): Check reference counter.
	Use destroy_window.
	(redraw_screen_rect): Restore viewport.
	Use 'render_target' and 'window'.
	Call 'repaint_callback'.
	(write_char): Use 'render_target'.
	(draw_cursor): Likewise.
	(scroll_up): Restore viewport.
	Use 'render_target' and 'window'.
	Call 'repaint_callback'.
	(grub_gfxterm_cls): Likewise.
	(grub_gfxterm_refresh): Use 'window'.
	(grub_gfxterm_set_repaint_callback): New function.
	(grub_gfxterm_background_image_cmd): Use 'window'.
	(grub_gfxterm_get_term): New function.
	(GRUB_MOD_INIT(term_gfxterm)): Set 'refcount' to 0.

	Also-By: Vladimir Serbinenko <phcoder@gmail.com>
2009-11-15 00:03:03 +01:00