2006-03-31 Vesa Jaaskelainen <chaac@nic.fi>
* 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.
This commit is contained in:
parent
c2379b9c31
commit
b4b9367408
12 changed files with 845 additions and 21 deletions
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2005 Free Software Foundation, Inc.
|
||||
* Copyright (C) 2005,2006 Free Software Foundation, Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -23,6 +23,7 @@
|
|||
#include <grub/symbol.h>
|
||||
#include <grub/types.h>
|
||||
#include <grub/err.h>
|
||||
#include <grub/video.h>
|
||||
|
||||
/* Default video mode to be used. */
|
||||
#define GRUB_VBE_DEFAULT_VIDEO_MODE 0x101
|
||||
|
@ -203,4 +204,18 @@ grub_err_t grub_vbe_get_video_mode (grub_uint32_t *mode);
|
|||
grub_err_t grub_vbe_get_video_mode_info (grub_uint32_t mode,
|
||||
struct grub_vbe_mode_info_block *mode_info);
|
||||
|
||||
/* VBE module internal prototypes (should not be used from elsewhere). */
|
||||
grub_uint8_t * grub_video_vbe_get_video_ptr (struct grub_video_render_target *source,
|
||||
grub_uint32_t x,
|
||||
grub_uint32_t y);
|
||||
|
||||
grub_video_color_t grub_video_vbe_map_rgb (grub_uint8_t red,
|
||||
grub_uint8_t green,
|
||||
grub_uint8_t blue);
|
||||
|
||||
void grub_video_vbe_unmap_color (struct grub_video_render_target * source,
|
||||
grub_video_color_t color, grub_uint8_t *red,
|
||||
grub_uint8_t *green, grub_uint8_t *blue,
|
||||
grub_uint8_t *alpha);
|
||||
|
||||
#endif /* ! GRUB_VBE_MACHINE_HEADER */
|
||||
|
|
66
include/grub/i386/pc/vbeblit.h
Normal file
66
include/grub/i386/pc/vbeblit.h
Normal file
|
@ -0,0 +1,66 @@
|
|||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2006 Free Software Foundation, Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#ifndef GRUB_VBEBLIT_MACHINE_HEADER
|
||||
#define GRUB_VBEBLIT_MACHINE_HEADER 1
|
||||
|
||||
void
|
||||
grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8 (struct grub_video_render_target *dst,
|
||||
struct grub_video_render_target *src,
|
||||
int x, int y, int width, int height,
|
||||
int offset_x, int offset_y);
|
||||
|
||||
void
|
||||
grub_video_i386_vbeblit_R8G8B8_R8G8B8A8 (struct grub_video_render_target *dst,
|
||||
struct grub_video_render_target *src,
|
||||
int x, int y, int width, int height,
|
||||
int offset_x, int offset_y);
|
||||
|
||||
void
|
||||
grub_video_i386_vbeblit_index_R8G8B8A8 (struct grub_video_render_target *dst,
|
||||
struct grub_video_render_target *src,
|
||||
int x, int y, int width, int height,
|
||||
int offset_x, int offset_y);
|
||||
|
||||
|
||||
void
|
||||
grub_video_i386_vbeblit_R8G8B8A8_R8G8B8 (struct grub_video_render_target *dst,
|
||||
struct grub_video_render_target *src,
|
||||
int x, int y, int width, int height,
|
||||
int offset_x, int offset_y);
|
||||
|
||||
void
|
||||
grub_video_i386_vbeblit_R8G8B8_R8G8B8 (struct grub_video_render_target *dst,
|
||||
struct grub_video_render_target *src,
|
||||
int x, int y, int width, int height,
|
||||
int offset_x, int offset_y);
|
||||
|
||||
void
|
||||
grub_video_i386_vbeblit_index_R8G8B8 (struct grub_video_render_target *dst,
|
||||
struct grub_video_render_target *src,
|
||||
int x, int y, int width, int height,
|
||||
int offset_x, int offset_y);
|
||||
|
||||
void
|
||||
grub_video_i386_vbeblit_index_index (struct grub_video_render_target *dst,
|
||||
struct grub_video_render_target *src,
|
||||
int x, int y, int width, int height,
|
||||
int offset_x, int offset_y);
|
||||
|
||||
#endif /* ! GRUB_VBEBLIT_MACHINE_HEADER */
|
40
include/grub/i386/pc/vbefill.h
Normal file
40
include/grub/i386/pc/vbefill.h
Normal file
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2006 Free Software Foundation, Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#ifndef GRUB_VBEFILL_MACHINE_HEADER
|
||||
#define GRUB_VBEFILL_MACHINE_HEADER 1
|
||||
|
||||
#include <grub/video.h>
|
||||
|
||||
void
|
||||
grub_video_i386_vbefill_R8G8B8A8 (struct grub_video_render_target *dst,
|
||||
grub_video_color_t color, int x, int y,
|
||||
int width, int height);
|
||||
|
||||
void
|
||||
grub_video_i386_vbefill_R8G8B8 (struct grub_video_render_target *dst,
|
||||
grub_video_color_t color, int x, int y,
|
||||
int width, int height);
|
||||
|
||||
void
|
||||
grub_video_i386_vbefill_index (struct grub_video_render_target *dst,
|
||||
grub_video_color_t color, int x, int y,
|
||||
int width, int height);
|
||||
|
||||
#endif /* ! GRUB_VBEFILL_MACHINE_HEADER */
|
|
@ -46,6 +46,21 @@ struct grub_video_render_target;
|
|||
#define GRUB_VIDEO_RENDER_TARGET_FRONT_BUFFER ((struct grub_video_render_target *) 0)
|
||||
#define GRUB_VIDEO_RENDER_TARGET_BACK_BUFFER ((struct grub_video_render_target *) 1)
|
||||
|
||||
/* Defined blitting formats. */
|
||||
enum grub_video_blit_format
|
||||
{
|
||||
/* Follow exactly field & mask information. */
|
||||
GRUB_VIDEO_BLIT_FORMAT_RGBA,
|
||||
/* Make optimization assumption. */
|
||||
GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8,
|
||||
/* Follow exactly field & mask information. */
|
||||
GRUB_VIDEO_BLIT_FORMAT_RGB,
|
||||
/* Make optimization assumption. */
|
||||
GRUB_VIDEO_BLIT_FORMAT_R8G8B8,
|
||||
/* When needed, decode color or just use value as is. */
|
||||
GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR
|
||||
};
|
||||
|
||||
struct grub_video_mode_info
|
||||
{
|
||||
/* Width of the screen. */
|
||||
|
@ -70,6 +85,9 @@ struct grub_video_mode_info
|
|||
/* In index color mode, number of colors. In RGB mode this is 256. */
|
||||
unsigned int number_of_colors;
|
||||
|
||||
/* Optimization hint how binary data is coded. */
|
||||
enum grub_video_blit_format blit_format;
|
||||
|
||||
/* How many bits are reserved for red color. */
|
||||
unsigned int red_mask_size;
|
||||
|
||||
|
@ -235,6 +253,8 @@ grub_err_t EXPORT_FUNC(grub_video_restore) (void);
|
|||
|
||||
grub_err_t EXPORT_FUNC(grub_video_get_info) (struct grub_video_mode_info *mode_info);
|
||||
|
||||
enum grub_video_blit_format EXPORT_FUNC(grub_video_get_blit_format) (struct grub_video_mode_info *mode_info);
|
||||
|
||||
grub_err_t EXPORT_FUNC(grub_video_set_palette) (unsigned int start,
|
||||
unsigned int count,
|
||||
struct grub_video_palette_data *palette_data);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue