Commit graph

8 commits

Author SHA1 Message Date
Vladimir 'phcoder' Serbinenko
f947ab49b0 Remove the dump of sm712 initialisation sequence.
* include/grub/pci.h (GRUB_PCI_CLASS_SUBCLASS_VGA): New const.
	* include/grub/vga.h (GRUB_VGA_IO_ARX_READ): New register.
	(GRUB_VGA_IO_MISC_WRITE): Likewise.
	(GRUB_VGA_CR_*): Added many registers.
	(GRUB_VGA_SR_*): Likewise.
	(GRUB_VGA_GR_*): Likewise.
	(grub_vga_write_arx): New function.
	(grub_video_hw_config): New struct.
	(grub_vga_set_geometry): New function.
	* kern/i386/qemu/init.c (load_palette): Use grub_vga_write_arx and
	GRUB_PCI_CLASS_SUBCLASS_VGA.
	* video/cirrus.c (grub_video_cirrus_setup): Use grub_vga_set_geometry.
	* video/sm712.c (grub_sm712_write_reg): New function
	(grub_sm712_read_reg): Likewise.
	(grub_sm712_sr_write): Likewise.
	(grub_sm712_gr_write): Likewise.
	(grub_sm712_cr_write): Likewise.
	(grub_sm712_write_arx): Likewise.
	(grub_sm712_cr_shadow_write): Likewise.
	(grub_sm712_write_dda_lookup): Likewise.
	(grub_video_sm712_setup): Initialise the video rather then
	blindly replay the dump.
	(main) [TEST]: Add a routine to be able to compile as standalone for
	tests.
	* video/sm712_init.c (sm712_init): Removed.
	(sm712_sr_seq1): New array.
	(sm712_sr_seq2): Likewise.
2010-08-11 04:18: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
967828eb5a macroify and share VGA registers 2010-05-17 02:25:37 +02:00
Vladimir 'phcoder' Serbinenko
9a3e298a7e Fix incorrect aperture size 2010-05-16 22:20:19 +02:00
Vladimir 'phcoder' Serbinenko
31e0ce4d10 Support index color in video_cirrus 2010-05-16 21:18:40 +02:00
Vladimir 'phcoder' Serbinenko
63c1b71cbb Cleanup hidden DAC part. 2010-05-16 20:44:44 +02:00
Vladimir 'phcoder' Serbinenko
d00b0b3f4d Support double buffering on video cirrus 2010-05-16 20:20:31 +02:00
Vladimir 'phcoder' Serbinenko
94bf3dd564 somewhat working video_cirrus implementation 2010-05-16 01:32:07 +02:00