2009-08-14 Vladimir Serbinenko <phcoder@gmail.com>
Framebuffer split. * commands/i386/pc/vbetest.c (grub_cmd_vbetest): Restore video subsystem at the end. * conf/common.rmk (pkglib_MODULES): Add video_fb.mod. (video_fb_mod_SOURCES): New variable. (video_fb_mod_CFLAGS): Likewise. (video_fb_mod_LDFLAGS): Likewise. * conf/i386-pc.rmk (vbe_mod_SOURCES): Remove video/i386/pc/vbeblit.c, video/i386/pc/vbefill.c and video/i386/pc/vbeutil.c. * video/i386/pc/vbeblit.c: Moved from here ... * video/fb/fbblit.c: ..here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbefill.c: Moved from here ... * video/fb/fbfill.c: ..here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbeutil.c: Moved from here ... * video/fb/fbutil.c: ..here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbeblit.h: Moved from here ... * include/grub/fbblit.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbefill.h: Moved from here ... * include/grub/fbfill.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbeutil.h: Moved from here ... * include/grub/fbutil.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbe.h: Moved framebuffer part ... * include/grub/video_fb.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/video.h (GRUB_VIDEO_RENDER_TARGET_FRONT_BUFFER): Removed. (GRUB_VIDEO_RENDER_TARGET_BACK_BUFFER): Likewise. (grub_video_adapter): Added 'get_info_and_fini'. (grub_video_get_info_and_fini): New prototype. (grub_video_set_mode): make modestring const char *. * loader/i386/linux.c (grub_linux_setup_video): Use grub_video_get_info_and_fini. (grub_linux_boot): Move modesetting just before booting. * loader/i386/pc/xnu.c (grub_xnu_set_video): Use grub_video_get_info_and_fini. * video/i386/pc/vbe.c: Moved framebuffer part ... * video/fb/video_fb.c: ... here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbe.c (grub_vbe_set_video_mode): Use grub_video_fbstd_colors and grub_video_fb_set_palette. (grub_video_vbe_init): Clear 'framebuffer' variable and use grub_video_fb_init. (grub_video_vbe_fini): Use grub_video_fb_fini. (grub_video_vbe_setup): Use framebuffer.render_target instead of render_target and use grub_video_fb_set_active_render_target and grub_video_fb_set_palette. (grub_video_vbe_set_palette): Use grub_video_fb_set_palette. (grub_video_vbe_set_viewport): Use grub_video_fb_set_viewport. (grub_video_vbe_adapter): Use framebuffer. * video/video.c (grub_video_get_info_and_fini): New function. (grub_video_set_mode): Make modestring const char *. (GRUB_MOD_INIT(video_video)): Don't set variables to 0 since these values are already initialised.
This commit is contained in:
parent
d404ee5646
commit
d3539132cd
20 changed files with 1840 additions and 1558 deletions
|
@ -27,19 +27,19 @@
|
|||
- Every function in this code assumes that bounds checking has been done in
|
||||
previous phase and they are opted out in here. */
|
||||
|
||||
#include <grub/machine/vbe.h>
|
||||
#include <grub/machine/vbeblit.h>
|
||||
#include <grub/machine/vbeutil.h>
|
||||
#include <grub/video_fb.h>
|
||||
#include <grub/fbblit.h>
|
||||
#include <grub/fbutil.h>
|
||||
#include <grub/misc.h>
|
||||
#include <grub/types.h>
|
||||
#include <grub/video.h>
|
||||
|
||||
/* Generic replacing blitter (slow). Works for every supported format. */
|
||||
void
|
||||
grub_video_i386_vbeblit_replace (struct grub_video_i386_vbeblit_info *dst,
|
||||
struct grub_video_i386_vbeblit_info *src,
|
||||
int x, int y, int width, int height,
|
||||
int offset_x, int offset_y)
|
||||
grub_video_fbblit_replace (struct grub_video_fbblit_info *dst,
|
||||
struct grub_video_fbblit_info *src,
|
||||
int x, int y, int width, int height,
|
||||
int offset_x, int offset_y)
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
|
@ -56,11 +56,11 @@ grub_video_i386_vbeblit_replace (struct grub_video_i386_vbeblit_info *dst,
|
|||
{
|
||||
src_color = get_pixel (src, i + offset_x, j + offset_y);
|
||||
|
||||
grub_video_vbe_unmap_color_int (src, src_color, &src_red, &src_green,
|
||||
&src_blue, &src_alpha);
|
||||
grub_video_fb_unmap_color_int (src, src_color, &src_red, &src_green,
|
||||
&src_blue, &src_alpha);
|
||||
|
||||
dst_color = grub_video_vbe_map_rgba (src_red, src_green,
|
||||
src_blue, src_alpha);
|
||||
dst_color = grub_video_fb_map_rgba (src_red, src_green,
|
||||
src_blue, src_alpha);
|
||||
|
||||
set_pixel (dst, x + i, y + j, dst_color);
|
||||
}
|
||||
|
@ -69,10 +69,10 @@ grub_video_i386_vbeblit_replace (struct grub_video_i386_vbeblit_info *dst,
|
|||
|
||||
/* Block copy replacing blitter. Works with modes multiple of 8 bits. */
|
||||
void
|
||||
grub_video_i386_vbeblit_replace_directN (struct grub_video_i386_vbeblit_info *dst,
|
||||
struct grub_video_i386_vbeblit_info *src,
|
||||
int x, int y, int width, int height,
|
||||
int offset_x, int offset_y)
|
||||
grub_video_fbblit_replace_directN (struct grub_video_fbblit_info *dst,
|
||||
struct grub_video_fbblit_info *src,
|
||||
int x, int y, int width, int height,
|
||||
int offset_x, int offset_y)
|
||||
{
|
||||
int j;
|
||||
grub_uint32_t *srcptr;
|
||||
|
@ -92,11 +92,11 @@ grub_video_i386_vbeblit_replace_directN (struct grub_video_i386_vbeblit_info *ds
|
|||
|
||||
/* Optimized replacing blitter for RGBX8888 to BGRX8888. */
|
||||
void
|
||||
grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888 (struct grub_video_i386_vbeblit_info *dst,
|
||||
struct grub_video_i386_vbeblit_info *src,
|
||||
int x, int y,
|
||||
int width, int height,
|
||||
int offset_x, int offset_y)
|
||||
grub_video_fbblit_replace_BGRX8888_RGBX8888 (struct grub_video_fbblit_info *dst,
|
||||
struct grub_video_fbblit_info *src,
|
||||
int x, int y,
|
||||
int width, int height,
|
||||
int offset_x, int offset_y)
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
|
@ -135,11 +135,11 @@ grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888 (struct grub_video_i386_vbebli
|
|||
|
||||
/* Optimized replacing blitter for RGB888 to BGRX8888. */
|
||||
void
|
||||
grub_video_i386_vbeblit_replace_BGRX8888_RGB888 (struct grub_video_i386_vbeblit_info *dst,
|
||||
struct grub_video_i386_vbeblit_info *src,
|
||||
int x, int y,
|
||||
int width, int height,
|
||||
int offset_x, int offset_y)
|
||||
grub_video_fbblit_replace_BGRX8888_RGB888 (struct grub_video_fbblit_info *dst,
|
||||
struct grub_video_fbblit_info *src,
|
||||
int x, int y,
|
||||
int width, int height,
|
||||
int offset_x, int offset_y)
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
|
@ -179,11 +179,11 @@ grub_video_i386_vbeblit_replace_BGRX8888_RGB888 (struct grub_video_i386_vbeblit_
|
|||
|
||||
/* Optimized replacing blitter for RGBX8888 to BGR888. */
|
||||
void
|
||||
grub_video_i386_vbeblit_replace_BGR888_RGBX8888 (struct grub_video_i386_vbeblit_info *dst,
|
||||
struct grub_video_i386_vbeblit_info *src,
|
||||
int x, int y,
|
||||
int width, int height,
|
||||
int offset_x, int offset_y)
|
||||
grub_video_fbblit_replace_BGR888_RGBX8888 (struct grub_video_fbblit_info *dst,
|
||||
struct grub_video_fbblit_info *src,
|
||||
int x, int y,
|
||||
int width, int height,
|
||||
int offset_x, int offset_y)
|
||||
{
|
||||
grub_uint32_t *srcptr;
|
||||
grub_uint8_t *dstptr;
|
||||
|
@ -227,11 +227,11 @@ grub_video_i386_vbeblit_replace_BGR888_RGBX8888 (struct grub_video_i386_vbeblit_
|
|||
|
||||
/* Optimized replacing blitter for RGB888 to BGR888. */
|
||||
void
|
||||
grub_video_i386_vbeblit_replace_BGR888_RGB888 (struct grub_video_i386_vbeblit_info *dst,
|
||||
struct grub_video_i386_vbeblit_info *src,
|
||||
int x, int y,
|
||||
int width, int height,
|
||||
int offset_x, int offset_y)
|
||||
grub_video_fbblit_replace_BGR888_RGB888 (struct grub_video_fbblit_info *dst,
|
||||
struct grub_video_fbblit_info *src,
|
||||
int x, int y,
|
||||
int width, int height,
|
||||
int offset_x, int offset_y)
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
|
@ -268,11 +268,11 @@ grub_video_i386_vbeblit_replace_BGR888_RGB888 (struct grub_video_i386_vbeblit_in
|
|||
|
||||
/* Optimized replacing blitter for RGB888 to RGBX8888. */
|
||||
void
|
||||
grub_video_i386_vbeblit_replace_RGBX8888_RGB888 (struct grub_video_i386_vbeblit_info *dst,
|
||||
struct grub_video_i386_vbeblit_info *src,
|
||||
int x, int y,
|
||||
int width, int height,
|
||||
int offset_x, int offset_y)
|
||||
grub_video_fbblit_replace_RGBX8888_RGB888 (struct grub_video_fbblit_info *dst,
|
||||
struct grub_video_fbblit_info *src,
|
||||
int x, int y,
|
||||
int width, int height,
|
||||
int offset_x, int offset_y)
|
||||
{
|
||||
grub_uint32_t color;
|
||||
int i;
|
||||
|
@ -304,11 +304,11 @@ grub_video_i386_vbeblit_replace_RGBX8888_RGB888 (struct grub_video_i386_vbeblit_
|
|||
|
||||
/* Optimized replacing blitter for RGBX8888 to RGB888. */
|
||||
void
|
||||
grub_video_i386_vbeblit_replace_RGB888_RGBX8888 (struct grub_video_i386_vbeblit_info *dst,
|
||||
struct grub_video_i386_vbeblit_info *src,
|
||||
int x, int y,
|
||||
int width, int height,
|
||||
int offset_x, int offset_y)
|
||||
grub_video_fbblit_replace_RGB888_RGBX8888 (struct grub_video_fbblit_info *dst,
|
||||
struct grub_video_fbblit_info *src,
|
||||
int x, int y,
|
||||
int width, int height,
|
||||
int offset_x, int offset_y)
|
||||
{
|
||||
grub_uint32_t color;
|
||||
int i;
|
||||
|
@ -341,11 +341,11 @@ grub_video_i386_vbeblit_replace_RGB888_RGBX8888 (struct grub_video_i386_vbeblit_
|
|||
|
||||
/* Optimized replacing blitter for RGBX8888 to indexed color. */
|
||||
void
|
||||
grub_video_i386_vbeblit_replace_index_RGBX8888 (struct grub_video_i386_vbeblit_info *dst,
|
||||
struct grub_video_i386_vbeblit_info *src,
|
||||
int x, int y,
|
||||
int width, int height,
|
||||
int offset_x, int offset_y)
|
||||
grub_video_fbblit_replace_index_RGBX8888 (struct grub_video_fbblit_info *dst,
|
||||
struct grub_video_fbblit_info *src,
|
||||
int x, int y,
|
||||
int width, int height,
|
||||
int offset_x, int offset_y)
|
||||
{
|
||||
grub_uint32_t color;
|
||||
int i;
|
||||
|
@ -369,7 +369,7 @@ grub_video_i386_vbeblit_replace_index_RGBX8888 (struct grub_video_i386_vbeblit_i
|
|||
sg = (color >> 8) & 0xFF;
|
||||
sb = (color >> 16) & 0xFF;
|
||||
|
||||
color = grub_video_vbe_map_rgb(sr, sg, sb);
|
||||
color = grub_video_fb_map_rgb(sr, sg, sb);
|
||||
*dstptr++ = color & 0xFF;
|
||||
}
|
||||
}
|
||||
|
@ -377,11 +377,11 @@ grub_video_i386_vbeblit_replace_index_RGBX8888 (struct grub_video_i386_vbeblit_i
|
|||
|
||||
/* Optimized replacing blitter for RGB888 to indexed color. */
|
||||
void
|
||||
grub_video_i386_vbeblit_replace_index_RGB888 (struct grub_video_i386_vbeblit_info *dst,
|
||||
struct grub_video_i386_vbeblit_info *src,
|
||||
int x, int y,
|
||||
int width, int height,
|
||||
int offset_x, int offset_y)
|
||||
grub_video_fbblit_replace_index_RGB888 (struct grub_video_fbblit_info *dst,
|
||||
struct grub_video_fbblit_info *src,
|
||||
int x, int y,
|
||||
int width, int height,
|
||||
int offset_x, int offset_y)
|
||||
{
|
||||
grub_uint32_t color;
|
||||
int i;
|
||||
|
@ -403,7 +403,7 @@ grub_video_i386_vbeblit_replace_index_RGB888 (struct grub_video_i386_vbeblit_inf
|
|||
sg = *srcptr++;
|
||||
sb = *srcptr++;
|
||||
|
||||
color = grub_video_vbe_map_rgb(sr, sg, sb);
|
||||
color = grub_video_fb_map_rgb(sr, sg, sb);
|
||||
|
||||
*dstptr++ = color & 0xFF;
|
||||
}
|
||||
|
@ -412,10 +412,10 @@ grub_video_i386_vbeblit_replace_index_RGB888 (struct grub_video_i386_vbeblit_inf
|
|||
|
||||
/* Generic blending blitter. Works for every supported format. */
|
||||
void
|
||||
grub_video_i386_vbeblit_blend (struct grub_video_i386_vbeblit_info *dst,
|
||||
struct grub_video_i386_vbeblit_info *src,
|
||||
int x, int y, int width, int height,
|
||||
int offset_x, int offset_y)
|
||||
grub_video_fbblit_blend (struct grub_video_fbblit_info *dst,
|
||||
struct grub_video_fbblit_info *src,
|
||||
int x, int y, int width, int height,
|
||||
int offset_x, int offset_y)
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
|
@ -436,24 +436,24 @@ grub_video_i386_vbeblit_blend (struct grub_video_i386_vbeblit_info *dst,
|
|||
grub_video_color_t dst_color;
|
||||
|
||||
src_color = get_pixel (src, i + offset_x, j + offset_y);
|
||||
grub_video_vbe_unmap_color_int (src, src_color, &src_red, &src_green,
|
||||
&src_blue, &src_alpha);
|
||||
grub_video_fb_unmap_color_int (src, src_color, &src_red, &src_green,
|
||||
&src_blue, &src_alpha);
|
||||
|
||||
if (src_alpha == 0)
|
||||
continue;
|
||||
|
||||
if (src_alpha == 255)
|
||||
{
|
||||
dst_color = grub_video_vbe_map_rgba (src_red, src_green,
|
||||
src_blue, src_alpha);
|
||||
dst_color = grub_video_fb_map_rgba (src_red, src_green,
|
||||
src_blue, src_alpha);
|
||||
set_pixel (dst, x + i, y + j, dst_color);
|
||||
continue;
|
||||
}
|
||||
|
||||
dst_color = get_pixel (dst, x + i, y + j);
|
||||
|
||||
grub_video_vbe_unmap_color_int (dst, dst_color, &dst_red,
|
||||
&dst_green, &dst_blue, &dst_alpha);
|
||||
grub_video_fb_unmap_color_int (dst, dst_color, &dst_red,
|
||||
&dst_green, &dst_blue, &dst_alpha);
|
||||
|
||||
dst_red = (((src_red * src_alpha)
|
||||
+ (dst_red * (255 - src_alpha))) / 255);
|
||||
|
@ -463,8 +463,8 @@ grub_video_i386_vbeblit_blend (struct grub_video_i386_vbeblit_info *dst,
|
|||
+ (dst_blue * (255 - src_alpha))) / 255);
|
||||
|
||||
dst_alpha = src_alpha;
|
||||
dst_color = grub_video_vbe_map_rgba (dst_red, dst_green, dst_blue,
|
||||
dst_alpha);
|
||||
dst_color = grub_video_fb_map_rgba (dst_red, dst_green, dst_blue,
|
||||
dst_alpha);
|
||||
|
||||
set_pixel (dst, x + i, y + j, dst_color);
|
||||
}
|
||||
|
@ -473,11 +473,11 @@ grub_video_i386_vbeblit_blend (struct grub_video_i386_vbeblit_info *dst,
|
|||
|
||||
/* Optimized blending blitter for RGBA8888 to BGRA8888. */
|
||||
void
|
||||
grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888 (struct grub_video_i386_vbeblit_info *dst,
|
||||
struct grub_video_i386_vbeblit_info *src,
|
||||
int x, int y,
|
||||
int width, int height,
|
||||
int offset_x, int offset_y)
|
||||
grub_video_fbblit_blend_BGRA8888_RGBA8888 (struct grub_video_fbblit_info *dst,
|
||||
struct grub_video_fbblit_info *src,
|
||||
int x, int y,
|
||||
int width, int height,
|
||||
int offset_x, int offset_y)
|
||||
{
|
||||
grub_uint32_t *srcptr;
|
||||
grub_uint32_t *dstptr;
|
||||
|
@ -554,11 +554,11 @@ grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888 (struct grub_video_i386_vbeblit_
|
|||
|
||||
/* Optimized blending blitter for RGBA8888 to BGR888. */
|
||||
void
|
||||
grub_video_i386_vbeblit_blend_BGR888_RGBA8888 (struct grub_video_i386_vbeblit_info *dst,
|
||||
struct grub_video_i386_vbeblit_info *src,
|
||||
int x, int y,
|
||||
int width, int height,
|
||||
int offset_x, int offset_y)
|
||||
grub_video_fbblit_blend_BGR888_RGBA8888 (struct grub_video_fbblit_info *dst,
|
||||
struct grub_video_fbblit_info *src,
|
||||
int x, int y,
|
||||
int width, int height,
|
||||
int offset_x, int offset_y)
|
||||
{
|
||||
grub_uint32_t *srcptr;
|
||||
grub_uint8_t *dstptr;
|
||||
|
@ -635,11 +635,11 @@ grub_video_i386_vbeblit_blend_BGR888_RGBA8888 (struct grub_video_i386_vbeblit_in
|
|||
|
||||
/* Optimized blending blitter for RGBA888 to RGBA8888. */
|
||||
void
|
||||
grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888 (struct grub_video_i386_vbeblit_info *dst,
|
||||
struct grub_video_i386_vbeblit_info *src,
|
||||
int x, int y,
|
||||
int width, int height,
|
||||
int offset_x, int offset_y)
|
||||
grub_video_fbblit_blend_RGBA8888_RGBA8888 (struct grub_video_fbblit_info *dst,
|
||||
struct grub_video_fbblit_info *src,
|
||||
int x, int y,
|
||||
int width, int height,
|
||||
int offset_x, int offset_y)
|
||||
{
|
||||
grub_uint32_t color;
|
||||
int i;
|
||||
|
@ -700,11 +700,11 @@ grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888 (struct grub_video_i386_vbeblit_
|
|||
|
||||
/* Optimized blending blitter for RGBA8888 to RGB888. */
|
||||
void
|
||||
grub_video_i386_vbeblit_blend_RGB888_RGBA8888 (struct grub_video_i386_vbeblit_info *dst,
|
||||
struct grub_video_i386_vbeblit_info *src,
|
||||
int x, int y,
|
||||
int width, int height,
|
||||
int offset_x, int offset_y)
|
||||
grub_video_fbblit_blend_RGB888_RGBA8888 (struct grub_video_fbblit_info *dst,
|
||||
struct grub_video_fbblit_info *src,
|
||||
int x, int y,
|
||||
int width, int height,
|
||||
int offset_x, int offset_y)
|
||||
{
|
||||
grub_uint32_t color;
|
||||
int i;
|
||||
|
@ -766,11 +766,11 @@ grub_video_i386_vbeblit_blend_RGB888_RGBA8888 (struct grub_video_i386_vbeblit_in
|
|||
|
||||
/* Optimized blending blitter for RGBA8888 to indexed color. */
|
||||
void
|
||||
grub_video_i386_vbeblit_blend_index_RGBA8888 (struct grub_video_i386_vbeblit_info *dst,
|
||||
struct grub_video_i386_vbeblit_info *src,
|
||||
int x, int y,
|
||||
int width, int height,
|
||||
int offset_x, int offset_y)
|
||||
grub_video_fbblit_blend_index_RGBA8888 (struct grub_video_fbblit_info *dst,
|
||||
struct grub_video_fbblit_info *src,
|
||||
int x, int y,
|
||||
int width, int height,
|
||||
int offset_x, int offset_y)
|
||||
{
|
||||
grub_uint32_t color;
|
||||
int i;
|
||||
|
@ -809,18 +809,18 @@ grub_video_i386_vbeblit_blend_index_RGBA8888 (struct grub_video_i386_vbeblit_inf
|
|||
|
||||
if (a == 255)
|
||||
{
|
||||
color = grub_video_vbe_map_rgb(sr, sg, sb);
|
||||
color = grub_video_fb_map_rgb(sr, sg, sb);
|
||||
*dstptr++ = color & 0xFF;
|
||||
continue;
|
||||
}
|
||||
|
||||
grub_video_vbe_unmap_color_int (dst, *dstptr, &dr, &dg, &db, &da);
|
||||
grub_video_fb_unmap_color_int (dst, *dstptr, &dr, &dg, &db, &da);
|
||||
|
||||
dr = (dr * (255 - a) + sr * a) / 255;
|
||||
dg = (dg * (255 - a) + sg * a) / 255;
|
||||
db = (db * (255 - a) + sb * a) / 255;
|
||||
|
||||
color = grub_video_vbe_map_rgb(dr, dg, db);
|
||||
color = grub_video_fb_map_rgb(dr, dg, db);
|
||||
|
||||
*dstptr++ = color & 0xFF;
|
||||
}
|
|
@ -27,32 +27,32 @@
|
|||
- Every function in this code assumes that bounds checking has been done in
|
||||
previous phase and they are opted out in here. */
|
||||
|
||||
#include <grub/machine/vbe.h>
|
||||
#include <grub/machine/vbefill.h>
|
||||
#include <grub/machine/vbeutil.h>
|
||||
#include <grub/video_fb.h>
|
||||
#include <grub/fbfill.h>
|
||||
#include <grub/fbutil.h>
|
||||
#include <grub/types.h>
|
||||
#include <grub/video.h>
|
||||
|
||||
/* Generic filler that works for every supported mode. */
|
||||
void
|
||||
grub_video_i386_vbefill (struct grub_video_i386_vbeblit_info *dst,
|
||||
grub_video_color_t color, int x, int y,
|
||||
int width, int height)
|
||||
grub_video_fbfill (struct grub_video_fbblit_info *dst,
|
||||
grub_video_color_t color, int x, int y,
|
||||
int width, int height)
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
|
||||
for (j = 0; j < height; j++)
|
||||
for (i = 0; i < width; i++)
|
||||
set_pixel (dst, x+i, y+j, color);
|
||||
set_pixel (dst, x + i, y + j, color);
|
||||
}
|
||||
|
||||
/* Optimized filler for direct color 32 bit modes. It is assumed that color
|
||||
is already mapped to destination format. */
|
||||
void
|
||||
grub_video_i386_vbefill_direct32 (struct grub_video_i386_vbeblit_info *dst,
|
||||
grub_video_color_t color, int x, int y,
|
||||
int width, int height)
|
||||
grub_video_fbfill_direct32 (struct grub_video_fbblit_info *dst,
|
||||
grub_video_color_t color, int x, int y,
|
||||
int width, int height)
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
|
@ -64,7 +64,7 @@ grub_video_i386_vbefill_direct32 (struct grub_video_i386_vbeblit_info *dst,
|
|||
rowskip = dst->mode_info->pitch - dst->mode_info->bytes_per_pixel * width;
|
||||
|
||||
/* Get the start address. */
|
||||
dstptr = (grub_uint32_t *) grub_video_vbe_get_video_ptr (dst, x, y);
|
||||
dstptr = (grub_uint32_t *) grub_video_fb_get_video_ptr (dst, x, y);
|
||||
|
||||
for (j = 0; j < height; j++)
|
||||
{
|
||||
|
@ -79,9 +79,9 @@ grub_video_i386_vbefill_direct32 (struct grub_video_i386_vbeblit_info *dst,
|
|||
/* Optimized filler for direct color 24 bit modes. It is assumed that color
|
||||
is already mapped to destination format. */
|
||||
void
|
||||
grub_video_i386_vbefill_direct24 (struct grub_video_i386_vbeblit_info *dst,
|
||||
grub_video_color_t color, int x, int y,
|
||||
int width, int height)
|
||||
grub_video_fbfill_direct24 (struct grub_video_fbblit_info *dst,
|
||||
grub_video_color_t color, int x, int y,
|
||||
int width, int height)
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
|
@ -96,7 +96,7 @@ grub_video_i386_vbefill_direct24 (struct grub_video_i386_vbeblit_info *dst,
|
|||
rowskip = dst->mode_info->pitch - dst->mode_info->bytes_per_pixel * width;
|
||||
|
||||
/* Get the start address. */
|
||||
dstptr = (grub_uint8_t *) grub_video_vbe_get_video_ptr (dst, x, y);
|
||||
dstptr = (grub_uint8_t *) grub_video_fb_get_video_ptr (dst, x, y);
|
||||
|
||||
for (j = 0; j < height; j++)
|
||||
{
|
||||
|
@ -115,9 +115,9 @@ grub_video_i386_vbefill_direct24 (struct grub_video_i386_vbeblit_info *dst,
|
|||
/* Optimized filler for direct color 16 bit modes. It is assumed that color
|
||||
is already mapped to destination format. */
|
||||
void
|
||||
grub_video_i386_vbefill_direct16 (struct grub_video_i386_vbeblit_info *dst,
|
||||
grub_video_color_t color, int x, int y,
|
||||
int width, int height)
|
||||
grub_video_fbfill_direct16 (struct grub_video_fbblit_info *dst,
|
||||
grub_video_color_t color, int x, int y,
|
||||
int width, int height)
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
|
@ -131,7 +131,7 @@ grub_video_i386_vbefill_direct16 (struct grub_video_i386_vbeblit_info *dst,
|
|||
rowskip = dst->mode_info->pitch - dst->mode_info->bytes_per_pixel * width;
|
||||
|
||||
/* Get the start address. */
|
||||
dstptr = (grub_uint8_t *) grub_video_vbe_get_video_ptr (dst, x, y);
|
||||
dstptr = (grub_uint8_t *) grub_video_fb_get_video_ptr (dst, x, y);
|
||||
|
||||
for (j = 0; j < height; j++)
|
||||
{
|
||||
|
@ -149,9 +149,9 @@ grub_video_i386_vbefill_direct16 (struct grub_video_i386_vbeblit_info *dst,
|
|||
/* Optimized filler for index color. It is assumed that color
|
||||
is already mapped to destination format. */
|
||||
void
|
||||
grub_video_i386_vbefill_direct8 (struct grub_video_i386_vbeblit_info *dst,
|
||||
grub_video_color_t color, int x, int y,
|
||||
int width, int height)
|
||||
grub_video_fbfill_direct8 (struct grub_video_fbblit_info *dst,
|
||||
grub_video_color_t color, int x, int y,
|
||||
int width, int height)
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
|
@ -164,7 +164,7 @@ grub_video_i386_vbefill_direct8 (struct grub_video_i386_vbeblit_info *dst,
|
|||
rowskip = dst->mode_info->pitch - dst->mode_info->bytes_per_pixel * width;
|
||||
|
||||
/* Get the start address. */
|
||||
dstptr = (grub_uint8_t *) grub_video_vbe_get_video_ptr (dst, x, y);
|
||||
dstptr = (grub_uint8_t *) grub_video_fb_get_video_ptr (dst, x, y);
|
||||
|
||||
for (j = 0; j < height; j++)
|
||||
{
|
|
@ -16,12 +16,12 @@
|
|||
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <grub/machine/vbeutil.h>
|
||||
#include <grub/fbutil.h>
|
||||
#include <grub/types.h>
|
||||
#include <grub/video.h>
|
||||
|
||||
grub_uint8_t *
|
||||
get_data_ptr (struct grub_video_i386_vbeblit_info *source,
|
||||
get_data_ptr (struct grub_video_fbblit_info *source,
|
||||
unsigned int x, unsigned int y)
|
||||
{
|
||||
grub_uint8_t *ptr = 0;
|
||||
|
@ -64,7 +64,7 @@ get_data_ptr (struct grub_video_i386_vbeblit_info *source,
|
|||
}
|
||||
|
||||
grub_video_color_t
|
||||
get_pixel (struct grub_video_i386_vbeblit_info *source,
|
||||
get_pixel (struct grub_video_fbblit_info *source,
|
||||
unsigned int x, unsigned int y)
|
||||
{
|
||||
grub_video_color_t color = 0;
|
||||
|
@ -111,7 +111,7 @@ get_pixel (struct grub_video_i386_vbeblit_info *source,
|
|||
}
|
||||
|
||||
void
|
||||
set_pixel (struct grub_video_i386_vbeblit_info *source,
|
||||
set_pixel (struct grub_video_fbblit_info *source,
|
||||
unsigned int x, unsigned int y, grub_video_color_t color)
|
||||
{
|
||||
switch (source->mode_info->bpp)
|
1156
video/fb/video_fb.c
Normal file
1156
video/fb/video_fb.c
Normal file
File diff suppressed because it is too large
Load diff
1213
video/i386/pc/vbe.c
1213
video/i386/pc/vbe.c
File diff suppressed because it is too large
Load diff
|
@ -93,6 +93,24 @@ grub_video_get_info (struct grub_video_mode_info *mode_info)
|
|||
return grub_video_adapter_active->get_info (mode_info);
|
||||
}
|
||||
|
||||
/* Get information about active video mode. */
|
||||
grub_err_t
|
||||
grub_video_get_info_and_fini (struct grub_video_mode_info *mode_info,
|
||||
void **framebuffer)
|
||||
{
|
||||
grub_err_t err;
|
||||
|
||||
if (! grub_video_adapter_active)
|
||||
return grub_error (GRUB_ERR_BAD_DEVICE, "No video mode activated");
|
||||
|
||||
err = grub_video_adapter_active->get_info_and_fini (mode_info, framebuffer);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
grub_video_adapter_active = 0;
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
|
||||
/* Determine optimized blitting formation for specified video mode info. */
|
||||
enum grub_video_blit_format
|
||||
grub_video_get_blit_format (struct grub_video_mode_info *mode_info)
|
||||
|
@ -380,7 +398,7 @@ grub_video_get_active_render_target (struct grub_video_render_target **target)
|
|||
}
|
||||
|
||||
grub_err_t
|
||||
grub_video_set_mode (char *modestring,
|
||||
grub_video_set_mode (const char *modestring,
|
||||
int NESTED_FUNC_ATTR (*hook) (grub_video_adapter_t p,
|
||||
struct grub_video_mode_info *mode_info))
|
||||
{
|
||||
|
@ -695,8 +713,6 @@ grub_video_set_mode (char *modestring,
|
|||
/* Initialize Video API module. */
|
||||
GRUB_MOD_INIT(video_video)
|
||||
{
|
||||
grub_video_adapter_active = 0;
|
||||
grub_video_adapter_list = 0;
|
||||
}
|
||||
|
||||
/* Finalize Video API module. */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue