2006-03-14 Vesa Jaaskelainen <chaac@nic.fi>

* DISTLIST: Added include/grub/video.h, term/gfxterm.c,
        video/video.c, commands/videotest.c.  Removed term/i386/pc/vesafb.c.

        * conf/i386-pc.rmk (pkgdata_MODULES): Added video.mod,
        gfxterm.mod, videotest.mod.  Removed vga.mod, vesafb.mod.
        (video_mod_SOURCES): Added.
        (video_mod_CFLAGS): Likewise.
        (video_mod_LDFLAGS): Likewise.
        (gfxterm_mod_SOURCES): Likewise.
        (gfxterm_mod_CFLAGS): Likewise.
        (gfxterm_mod_LDFLAGS): Likewise.
        (videotest_mod_SOURCES): Likewise.
        (videotest_mod_CFLAGS): Likewise.
        (videotest_mod_LDFLAGS): Likewise.
        (vesafb_mod_SOURCES): Removed.
        (vesafb_mod_CFLAGS): Likewise.
        (vesafb_mod_LDFLAGS): Likewise.
        (vga_mod_SOURCES): Likewise.
        (vga_mod_CFLAGS): Likewise.
        (vga_mod_LDFLAGS): Likewise.

        * commands/videotest.c: New file.

        * font/manager.c (fill_with_default_glyph): Modified to use
        grub_font_glyph.
        (grub_font_get_glyph): Likewise.
        (fontmanager): Renamed from this...
        (font_manager): ... to this.

        * include/grub/font.h (grub_font_glyph): Added new structure.
        (grub_font_get_glyph): Modified to use grub_font_glyph.

        * include/grub/misc.h (grub_abs): Added as inline function.

        * include/grub/video.h: New file.

        * include/grub/i386/pc/vbe.h (GRUB_VBE_STATUS_OK): New macro.
        (GRUB_VBE_MEMORY_MODEL_PACKED_PIXEL): Likewise.
        (GRUB_VBE_MEMORY_MODEL_DIRECT_COLOR): Likewise.
        (grub_vbe_get_controller_info): Renamed from this...
        (grub_vbe_bios_get_controller_info): ... to this.
        (grub_vbe_get_mode_info): Renamed from this...
        (grub_vbe_bios_get_mode_info): ... to this.
        (grub_vbe_set_mode): Renamed from this...
        (grub_vbe_bios_set_mode): ... to this.
        (grub_vbe_get_mode): Renamed from this...
        (grub_vbe_bios_get_mode): ... to this.
        (grub_vbe_set_memory_window): Renamed from this...
        (grub_vbe_bios_set_memory_window): ... to this.
        (grub_vbe_get_memory_window): Renamed from this...
        (grub_vbe_bios_get_memory_window): ... to this.
        (grub_vbe_set_scanline_length): Renamed from this...
        (grub_vbe_set_scanline_length): ... to this.
        (grub_vbe_get_scanline_length): Renamed from this...
        (grub_vbe_bios_get_scanline_length): ... to this.
        (grub_vbe_set_display_start): Renamed from this...
        (grub_vbe_bios_set_display_start): ... to this.
        (grub_vbe_get_display_start): Renamed from this...
        (grub_vbe_bios_get_display_start): ... to this.
        (grub_vbe_set_palette_data): Renamed from this...
        (grub_vbe_bios_set_palette_data): ... to this.
        (grub_vbe_set_pixel_rgb): Removed.
        (grub_vbe_set_pixel_index): Likewise.

        * kern/i386/pc/startup.S (grub_vbe_get_controller_info): Renamed
        from this...
        (grub_vbe_bios_get_controller_info): ... to this.
        (grub_vbe_get_mode_info): Renamed from this...
        (grub_vbe_bios_get_mode_info): ... to this.
        (grub_vbe_set_mode): Renamed from this...
        (grub_vbe_bios_set_mode): ... to this.
        (grub_vbe_get_mode): Renamed from this...
        (grub_vbe_bios_get_mode): ... to this.
        (grub_vbe_set_memory_window): Renamed from this...
        (grub_vbe_bios_set_memory_window): ... to this.
        (grub_vbe_get_memory_window): Renamed from this...
        (grub_vbe_bios_get_memory_window): ... to this.
        (grub_vbe_set_scanline_length): Renamed from this...
        (grub_vbe_set_scanline_length): ... to this.
        (grub_vbe_get_scanline_length): Renamed from this...
        (grub_vbe_bios_get_scanline_length): ... to this.
        (grub_vbe_set_display_start): Renamed from this...
        (grub_vbe_bios_set_display_start): ... to this.
        (grub_vbe_get_display_start): Renamed from this...
        (grub_vbe_bios_get_display_start): ... to this.
        (grub_vbe_set_palette_data): Renamed from this...
        (grub_vbe_bios_set_palette_data): ... to this.
        (grub_vbe_bios_get_controller_info): Fixed problem with registers
        getting corrupted after calling it.  Added more pushes and pops.
        (grub_vbe_bios_set_mode): Likewise.
        (grub_vbe_bios_get_mode): Likewise.
        (grub_vbe_bios_get_memory_window): Likewise.
        (grub_vbe_bios_set_scanline_length): Likewise.
        (grub_vbe_bios_get_scanline_length): Likewise.
        (grub_vbe_bios_get_display_start): Likewise.
        (grub_vbe_bios_set_palette_data): Likewise.

        * normal/cmdline.c (cl_set_pos): Refresh the screen.
        (cl_insert): Likewise.
        (cl_delete): Likewise.

        * term/gfxterm.c: New file.

        * term/i386/pc/vesafb.c: Removed file.

        * video/video.c: New file.

        * video/i386/pc/vbe.c (real2pm): Added new function.
        (grub_video_vbe_draw_pixel): Likewise.
        (grub_video_vbe_get_video_ptr): Likewise.
        (grub_video_vbe_get_pixel): Likewise
        (grub_video_vbe_init): Likewise.
        (grub_video_vbe_fini): Likewise.
        (grub_video_vbe_setup): Likewise.
        (grub_video_vbe_get_info): Likewise.
        (grub_video_vbe_set_palette): Likewise.
        (grub_video_vbe_get_palette): Likewise.
        (grub_video_vbe_set_viewport): Likewise.
        (grub_video_vbe_get_viewport): Likewise.
        (grub_video_vbe_map_color): Likewise.
        (grub_video_vbe_map_rgb): Likewise.
        (grub_video_vbe_map_rgba): Likewise.
        (grub_video_vbe_unmap_color): Likewise.
        (grub_video_vbe_fill_rect): Likewise.
        (grub_video_vbe_blit_glyph): Likewise.
        (grub_video_vbe_blit_bitmap): Likewise.
        (grub_video_vbe_blit_render_target): Likewise.
        (grub_video_vbe_scroll): Likewise.
        (grub_video_vbe_swap_buffers): Likewise.
        (grub_video_vbe_create_render_target): Likewise.
        (grub_video_vbe_delete_render_target): Likewise.
        (grub_video_vbe_set_active_render_target): Likewise.
        (grub_vbe_set_pixel_rgb): Remove function.
        (grub_vbe_set_pixel_index): Likewise.
        (index_color_mode): Remove static variable.
        (active_mode): Likewise.
        (framebuffer): Likewise.
        (bytes_per_scan_line): Likewise.
        (grub_video_vbe_adapter): Added new static variable.
        (framebuffer): Likewise.
        (render_target): Likewise.
        (initial_mode): Likewise.
        (mode_in_use): Likewise.
        (mode_list): Likewise.
This commit is contained in:
chaac 2006-03-14 19:08:34 +00:00
parent 5f97350bc7
commit bd0d7896cf
15 changed files with 3234 additions and 313 deletions

View file

@ -1758,14 +1758,15 @@ FUNCTION(grub_vga_get_font)
ret
/*
* grub_vbe_status_t grub_vbe_get_controller_info (struct grub_vbe_info_block *controller_info)
* grub_vbe_bios_status_t grub_vbe_get_controller_info (struct grub_vbe_info_block *controller_info)
*
* Register allocations for parameters:
* %eax *controller_info
*/
FUNCTION(grub_vbe_get_controller_info)
FUNCTION(grub_vbe_bios_get_controller_info)
pushl %ebp
pushl %edi
pushl %edx
movw %ax, %di /* Store *controller_info to %edx:%di. */
xorw %ax, %ax
@ -1791,19 +1792,20 @@ FUNCTION(grub_vbe_get_controller_info)
movl %edx, %eax
andl $0x0FFFF, %eax /* Return value in %eax. */
pop %edx
popl %edi
popl %ebp
ret
/*
* grub_vbe_status_t grub_vbe_get_mode_info (grub_uint32_t mode,
* struct grub_vbe_mode_info_block *mode_info)
* grub_vbe_status_t grub_vbe_bios_get_mode_info (grub_uint32_t mode,
* struct grub_vbe_mode_info_block *mode_info)
*
* Register allocations for parameters:
* %eax mode
* %edx *mode_info
*/
FUNCTION(grub_vbe_get_mode_info)
FUNCTION(grub_vbe_bios_get_mode_info)
pushl %ebp
pushl %edi
@ -1837,16 +1839,17 @@ FUNCTION(grub_vbe_get_mode_info)
ret
/*
* grub_vbe_status_t grub_vbe_set_mode (grub_uint32_t mode,
* struct grub_vbe_crtc_info_block *crtc_info)
* grub_vbe_status_t grub_vbe_bios_set_mode (grub_uint32_t mode,
* struct grub_vbe_crtc_info_block *crtc_info)
*
* Register allocations for parameters:
* %eax mode
* %edx *crtc_info
*/
FUNCTION(grub_vbe_set_mode)
FUNCTION(grub_vbe_bios_set_mode)
pushl %ebp
pushl %ebx
pushl %edi
movl %eax, %ebx /* Store mode in %ebx. */
@ -1874,19 +1877,22 @@ FUNCTION(grub_vbe_set_mode)
movw %dx, %ax
andl $0xFFFF, %eax /* Return value in %eax. */
popl %edi
popl %ebx
popl %ebp
ret
/*
* grub_vbe_status_t grub_vbe_get_mode (grub_uint32_t *mode)
* grub_vbe_status_t grub_vbe_bios_get_mode (grub_uint32_t *mode)
*
* Register allocations for parameters:
* %eax *mode
*/
FUNCTION(grub_vbe_get_mode)
FUNCTION(grub_vbe_bios_get_mode)
pushl %ebp
pushl %ebx
pushl %edi
pushl %edx
pushl %eax /* Push *mode to stack. */
call prot_to_real
@ -1907,19 +1913,21 @@ FUNCTION(grub_vbe_get_mode)
movw %dx, %ax
andl $0xFFFF, %eax /* Return value in %eax. */
popl %edx
popl %edi
popl %ebx
popl %ebp
ret
/*
* grub_vbe_status_t grub_vbe_set_memory_window (grub_uint32_t window,
* grub_uint32_t position);
* grub_vbe_status_t grub_vbe_bios_set_memory_window (grub_uint32_t window,
* grub_uint32_t position);
*
* Register allocations for parameters:
* %eax window
* %edx position
*/
FUNCTION(grub_vbe_set_memory_window)
FUNCTION(grub_vbe_bios_set_memory_window)
pushl %ebp
pushl %ebx
@ -1945,16 +1953,17 @@ FUNCTION(grub_vbe_set_memory_window)
ret
/*
* grub_vbe_status_t grub_vbe_get_memory_window (grub_uint32_t window,
* grub_uint32_t *position);
* grub_vbe_status_t grub_vbe_bios_get_memory_window (grub_uint32_t window,
* grub_uint32_t *position);
*
* Register allocations for parameters:
* %eax window
* %edx *position
*/
FUNCTION(grub_vbe_get_memory_window)
FUNCTION(grub_vbe_bios_get_memory_window)
pushl %ebp
pushl %ebx
pushl %edi
pushl %edx /* Push *position to stack. */
movl %eax, %ebx /* Store window in %ebx. */
@ -1979,19 +1988,21 @@ FUNCTION(grub_vbe_get_memory_window)
movw %bx, %ax
andl $0xFFFF, %eax /* Return value in %eax. */
popl %edi
popl %ebx
popl %ebp
ret
/*
* grub_vbe_status_t grub_vbe_set_scanline_length (grub_uint32_t length)
* grub_vbe_status_t grub_vbe_bios_set_scanline_length (grub_uint32_t length)
*
* Register allocations for parameters:
* %eax length
*/
FUNCTION(grub_vbe_set_scanline_length)
FUNCTION(grub_vbe_bios_set_scanline_length)
pushl %ebp
pushl %ebx
pushl %edx
movl %eax, %ecx /* Store length in %ecx. */
@ -2010,19 +2021,21 @@ FUNCTION(grub_vbe_set_scanline_length)
movw %dx, %ax
andl $0xFFFF, %eax /* Return value in %eax. */
popl %edx
popl %ebx
popl %ebp
ret
/*
* grub_vbe_status_t grub_vbe_get_scanline_length (grub_uint32_t *length)
* grub_vbe_status_t grub_vbe_bios_get_scanline_length (grub_uint32_t *length)
*
* Register allocations for parameters:
* %eax *length
*/
FUNCTION(grub_vbe_get_scanline_length)
FUNCTION(grub_vbe_bios_get_scanline_length)
pushl %ebp
pushl %ebx
pushl %edi
pushl %edx /* Push *length to stack. */
call prot_to_real
@ -2044,19 +2057,20 @@ FUNCTION(grub_vbe_get_scanline_length)
movw %dx, %ax
andl $0xFFFF, %eax /* Return value in %eax. */
popl %edi
popl %ebx
popl %ebp
ret
/*
* grub_vbe_status_t grub_vbe_set_display_start (grub_uint32_t x,
* grub_uint32_t y)
* grub_vbe_status_t grub_vbe_bios_set_display_start (grub_uint32_t x,
* grub_uint32_t y)
*
* Register allocations for parameters:
* %eax x
* %edx y
*/
FUNCTION(grub_vbe_set_display_start)
FUNCTION(grub_vbe_bios_set_display_start)
pushl %ebp
pushl %ebx
@ -2083,16 +2097,17 @@ FUNCTION(grub_vbe_set_display_start)
ret
/*
* grub_vbe_status_t grub_vbe_get_display_start (grub_uint32_t *x,
* grub_uint32_t *y)
* grub_vbe_status_t grub_vbe_bios_get_display_start (grub_uint32_t *x,
* grub_uint32_t *y)
*
* Register allocations for parameters:
* %eax *x
* %edx *y
*/
FUNCTION(grub_vbe_get_display_start)
FUNCTION(grub_vbe_bios_get_display_start)
pushl %ebp
pushl %ebx
pushl %edi
pushl %eax /* Push *x to stack. */
pushl %edx /* Push *y to stack. */
@ -2119,23 +2134,25 @@ FUNCTION(grub_vbe_get_display_start)
movw %bx, %ax
andl $0xFFFF, %eax /* Return value in %eax. */
popl %edi
popl %ebx
popl %ebp
ret
/*
* grub_vbe_status_t grub_vbe_set_palette_data (grub_uint32_t color_count,
* grub_uint32_t start_index,
* struct grub_vbe_palette_data *palette_data)
* grub_vbe_status_t grub_vbe_bios_set_palette_data (grub_uint32_t color_count,
* grub_uint32_t start_index,
* struct grub_vbe_palette_data *palette_data)
*
* Register allocations for parameters:
* %eax color_count
* %edx start_index
* %ecx *palette_data
*/
FUNCTION(grub_vbe_set_palette_data)
FUNCTION(grub_vbe_bios_set_palette_data)
pushl %ebp
pushl %ebx
pushl %edi
movl %eax, %ebx /* Store color_count in %ebx. */
@ -2165,6 +2182,7 @@ FUNCTION(grub_vbe_set_palette_data)
movw %dx, %ax
andl $0xFFFF, %eax /* Return value in %eax. */
popl %edi
popl %ebx
popl %ebp
ret