* conf/common.rmk (pkglib_MODULES): Add bufio.mod.
(bufio_mod_SOURCES): New macro.
(bufio_mod_CFLAGS): Likewise.
(bufio_mod_LDFLAGS): Likewise.
* include/grub/bufio.h: New file.
* io/bufio.c: Likewise.
* video/png.c: Replace <grub/file.h> with <grub/bufio.h>.
(grub_video_reader_png): Use grub_buffile_open to open file.
* video/jpeg.c: Replace <grub/file.h> with <grub/bufio.h>.
(grub_video_reader_jpeg): Use grub_buffile_open to open file.
* video/tga.c: Replace <grub/file.h> with <grub/bufio.h>.
(grub_video_reader_tga): Use grub_buffile_open to open file.
* font/manager.c: Include <grub/bufio.h>.
(add_font): Use grub_buffile_open to open file.
* video/reader/png.c (grub_png_data): New member is_16bit and
image_data.
(grub_png_decode_image_header): Detect 16 bit png image.
(grub_png_convert_image): New function to convert 16 bit image to 8 bit.
(grub_png_decode_png): Call grub_png_convert_image for 16 bit image.
(grub_video_reader_png): Release memory occupied by image_data.
* fs/ntfs.c (find_attr): Handle non-resident attribute list larger than
4096 bytes.
(grub_nfs_mount): Skip the test for sector per cluster.
* include/grub/ntfs.h (MAX_SPC): Removed.
* conf/i386-pc.rmk (GRUB_MEMORY_MACHINE_LINK_ADDR): New variable.
(kernel_img_LDFLAGS): Use `GRUB_MEMORY_MACHINE_LINK_ADDR' as link
address.
(grub_mkimage_CFLAGS): Propagate `GRUB_MEMORY_MACHINE_LINK_ADDR' as
a C macro.
* include/grub/i386/pc/memory.h (GRUB_MEMORY_MACHINE_UPPER): New macro.
Indicates start of upper memory.
* util/i386/pc/grub-mkimage.c: Include `<grub/machine/memory.h>'.
(generate_image): Abort when image size is big enough to corrupt
upper memory.
* include/grub/i386/pc/vga.h: Include `<grub/machine/memory.h>'.
(GRUB_MEMORY_MACHINE_VGA_ADDR): Alias for `GRUB_MEMORY_MACHINE_UPPER'.
* term/i386/pc/vga.c (VGA_MEM): Use `GRUB_MEMORY_MACHINE_VGA_ADDR'
instead of hardcoding 0xA0000.
* video/i386/pc/vbe.c: Include `<grub/machine/vga.h>'.
(grub_vbe_set_video_mode): Use `GRUB_MEMORY_MACHINE_VGA_ADDR'
instead of hardcoding 0xA0000.
* include/grub/video.h: Added grub_video_unmap_color and
grub_video_get_active_render_target.
(grub_video_adapter): Added unmap_color and get_active_render_target.
* video/video.c: Added grub_video_unmap_color and
grub_video_get_active_render_target.
(grub_video_get_info): Changed method to accept NULL pointer as an
argument to allow detection of active video adapter.
* video/i386/pc/vbe.c: Renamed grub_video_vbe_unmap_color as
grub_video_vbe_unmap_color_int.
Added grub_video_vbe_unmap_color and
grub_video_vbe_get_active_render_target.
(grub_video_vbe_adapter): Added unmap_color and
get_active_render_target.
* video/i386/pc/vbeblit.c: Replaced grub_video_vbe_unmap_color usage
with grub_video_vbe_unmap_color_int.
* term/gfxterm.c (DEFAULT_STANDARD_COLOR): Added.
(DEFAULT_NORMAL_COLOR): Likewise.
(DEFAULT_HIGHLIGHT_COLOR) Likewise.
(DEFAULT_FG_COLOR): Removed.
(DEFAULT_BG_COLOR): Likewise.
(DEFAULT_CURSOR_COLOR): Changed value.
(grub_virtual_screen): Added standard_color_setting,
normal_color_setting, highlight_color_setting and term_color.
(grub_virtual_screen): Removed fg_color_setting and bg_color_setting.
(bitmap_width): Added.
(bitmap_height): Likewise.
(bitmap): Likewise.
(set_term_color): Likewise.
(grub_virtual_screen_setup): Changed to use new terminal coloring
settings.
(grub_gfxterm_init): Added init for bitmap.
(grub_gfxterm_fini): Added destroy for bitmap.
(redraw_screen_rect): Updated to use background bitmap and new
terminal coloring.
(scroll_up): Added optimization for case when there is no bitmap.
(grub_gfxterm_cls): Fixed to use correct background color.
(grub_virtual_screen_setcolorstate): Changed to use new terminal
coloring.
(grub_virtual_screen_setcolor): Likewise.
(grub_virtual_screen_getcolor): Added.
(grub_gfxterm_background_image_cmd): Likewise.
(grub_video_term): Added setcolor and getcolor.
(MOD_INIT): Added registration of background_image command.
(MOD_TERM): Added unregistration for background_image command.
* DISTLIST: Added include/grub/i386/pc/vbeblit.h,
include/grub/i386/pc/vbefill.h, video/i386/pc/vbeblit.c,
video/i386/pc/vbefill.c.
* conf/i386-pc.rmk (vbe_mod_SOURCES): Added video/i386/pc/vbeblit.c,
video/i386/pc/vbefill.c.
* include/grub/video.h (grub_video_blit_format): New enum.
(grub_video_mode_info): Added new member blit_format.
(grub_video_get_blit_format): New function prototype.
* include/grub/i386/pc/vbe.h (grub_video_vbe_get_video_ptr): New
function prototype.
(grub_video_vbe_map_rgb): Likewise.
(grub_video_vbe_unmap_color): Likewise.
* include/grub/i386/pc/vbeblit.h: New file.
* include/grub/i386/pc/vbefill.h: New file.
* video/video.c (grub_video_get_blit_format): New function.
(grub_video_vbe_get_video_ptr): Re-declared as non-static.
(grub_video_vbe_map_rgb): Likewise.
(grub_video_vbe_unmap_color): Likewise.
* video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Changed to use more
optimized fills.
(grub_video_vbe_blit_render_target): Changed to use more optimized
blits.
(grub_video_vbe_setup): Added detection for optimized settings.
(grub_video_vbe_create_render_target): Likewise.
* video/i386/pc/vbeblit.c: New file.
* video/i386/pc/vbefill.c: New file.
* DISTLIST: Replace commands/i386/pc/vbe_list_modes.c and
commands/i386/pc/vbe_test.c with commands/i386/pc/vbeinfo.c and
commands/i386/pc/vbetest.c.
* video/i386/pc/vbe.c (grub_vbe_probe): If INFOBLOCK is not NULL,
call grub_vbe_get_controller_info again, because the returned
information is volatile.
(grub_vbe_set_video_mode): Mostly rewritten.
(grub_vbe_get_video_mode): Use grub_vbe_probe and use
grub_vbe_status_t correctly.
(grub_vbe_get_video_mode_info): Likewise.
(grub_vbe_set_pixel_rgb): Use a switch statement rather than
several if statements.
* commands/i386/pc/vbe_list_modes.c: Renamed to ...
* commands/i386/pc/vbeinfo.c: ... this.
* commands/i386/pc/vbe_test.c: Renamed to ...
* commands/i386/pc/vbetest.c: ... this.
* commands/i386/pc/vbeinfo.c (grub_cmd_vbe_list_modes): Renamed to
...
(grub_cmd_vbeinfo): ... this. Save video modes before
iterating. Skip a video mode, if it is not available, not enough
information is given or it is monochrome. Show the memory
model. Leave the interpretation of MODEVAR to grub_strtoul
completely.
(GRUB_MOD_INIT): Rename vbe_list_modes to vbeinfo.
(GRUB_MOD_FINI): Likewise.
* commands/i386/pc/vbetest.c (grub_cmd_vbe_test): Renamed to ...
(grub_cmd_vbetest): ... this. Don't print unnecessarily. Use
grub_err_t instead of grub_uint32_t. Don't use SPTR. Remove a
duplicated grub_env_get. Leave the interpretation of MODEVAR to
grub_strtoul completely.
(real2pm): Removed.
(GRUB_MOD_INIT): Rename vbe_test to vbetest.
(GRUB_MOD_FINI): Likewise.
* normal/misc.c: Include grub/mm.h.
* conf/i386-pc.rmk (pkgdata_MODULES): Replaced vbe_test.mod and
vbe_list_modes with vbetest.mod and vbeinfo.mod.
(vbe_list_modes_mod_SOURCES): Removed.
(vbe_list_modes_mod_CFLAGS): Likewise.
(vbe_test_mod_SOURCES): Likewise.
(vbe_test_mod_CFLAGS): Likewise.
(vbeinfo_mod_SOURCES): New variable.
(vbeinfo_mod_CFLAGS): Likewise.
(vbetest_mod_SOURCES): Likewise.
(vbetest_mod_CFLAGS): Likewise.