Split framebuffer from vbe
PATCH 1/2 Split framebuffer from vbe
Hello. Here is my first attempt on splitting video_fb.mod from vbe.mod. The idea was to make framebuffer code work with render_target without knowing what the real video mode is and let video-card specific code bother with things like double buffering and modesetting. Two loader: linux and xnu have to pass framebuffer address to their payload this is however problematic because in case of double buffering framebuffer address may change. The only idea of clean interface I see would be a function like grub_video_get_framebuffer_info_and_fini
which will terminate the video driver thus ensuring that video mode (including framebuffer address) won't change. Does anyone has a better idea?
Signature · 2 lines
Regards Vladimir 'phcoder' Serbinenko
Quoted 17 lines · Vladimir 'phcoder' Serbinenko
Hello. Here is my first attempt on splitting video_fb.mod from vbe.mod. The idea was to make framebuffer code work with
render_targetwithout knowing what the real video mode is and let video-card specific code bother with things like double buffering and modesetting. Two loader: linux and xnu have to pass framebuffer address to their payload this is however problematic because in case of double buffering framebuffer address may change. The only idea of clean interface I see would be a function likegrub_video_get_framebuffer_info_and_fini
which will terminate the video driver thus ensuring that video mode (including framebuffer address) won't change. Does anyone has a better idea?--
Regards
Vladimir 'phcoder' Serbinenko
Signature · 2 lines
Regards Vladimir 'phcoder' Serbinenko
conf/common.rmk +6 -1
@@ -521,13 +521,18 @@ lua_mod_LDFLAGS = $(COMMON_LDFLAGS) # Common Video Subsystem specific modules. pkglib_MODULES += video.mod videotest.mod bitmap.mod tga.mod jpeg.mod \ - png.mod font.mod gfxterm.mod + png.mod font.mod gfxterm.mod video_fb.mod # For video.mod. video_mod_SOURCES = video/video.c video_mod_CFLAGS = $(COMMON_CFLAGS) video_mod_LDFLAGS = $(COMMON_LDFLAGS) +video_fb_mod_SOURCES = video/fb/video_fb.c video/fb/fbblit.c \ + video/fb/fbfill.c video/fb/fbutil.c +video_fb_mod_CFLAGS = $(COMMON_CFLAGS) +video_fb_mod_LDFLAGS = $(COMMON_LDFLAGS) + # For videotest.mod. videotest_mod_SOURCES = commands/videotest.c videotest_mod_CFLAGS = $(COMMON_CFLAGS)
conf/i386-pc.rmk +1 -2
@@ -277,8 +277,7 @@ multiboot_mod_LDFLAGS = $(COMMON_LDFLAGS) multiboot_mod_ASFLAGS = $(COMMON_ASFLAGS) # For vbe.mod. -vbe_mod_SOURCES = video/i386/pc/vbe.c video/i386/pc/vbeblit.c \ - video/i386/pc/vbefill.c video/i386/pc/vbeutil.c +vbe_mod_SOURCES = video/i386/pc/vbe.c vbe_mod_CFLAGS = $(COMMON_CFLAGS) vbe_mod_LDFLAGS = $(COMMON_LDFLAGS)
include/grub/fbblit.h new file +134 -0
134 lines not on this page · raw message
include/grub/fbfill.h new file +52 -0
52 lines not on this page · raw message
include/grub/fbutil.h new file +43 -0
43 lines not on this page · raw message
include/grub/i386/pc/vbe.h +1 -53
65 lines not on this page · raw message
include/grub/i386/pc/vbeblit.h deleted +0 -134
134 lines not on this page · raw message
include/grub/i386/pc/vbefill.h deleted +0 -52
52 lines not on this page · raw message
include/grub/i386/pc/vbeutil.h deleted +0 -43
43 lines not on this page · raw message
include/grub/video_fb.h new file +136 -0
136 lines not on this page · raw message
loader/i386/linux.c +4 -5
@@ -31,9 +31,7 @@#include <grub/term.h> #include <grub/cpu/linux.h> #include <grub/video.h> -/* FIXME: the definition of `struct grub_video_render_target' is -VBE-specific. */ -#include <grub/i386/pc/vbe.h> +#include <grub/video_fb.h> #include <grub/command.h> #define GRUB_LINUX_CL_OFFSET 0x1000
@@ -403,14 +401,15 @@ static int grub_linux_setup_video (struct linux_kernel_params *params) {struct grub_video_mode_info mode_info; -struct grub_video_render_target *render_target; +struct grub_video_fbrender_target *render_target;int ret; ret =grub_video_get_info (&mode_info);if (ret)return 1 ; - ret =grub_video_get_active_render_target (&render_target); + ret =grub_video_get_active_render_target + ((struct grub_video_render_target **) &render_target);if (ret)return 1 ;
loader/i386/pc/xnu.c +4 -4
@@ -21,8 +21,7 @@#include <grub/xnu.h> #include <grub/mm.h> #include <grub/cpu/xnu.h> -#include <grub/machine/vbe.h> -#include <grub/machine/vga.h> +#include <grub/video_fb.h> #define min (a,b) (((a) < (b)) ? (a) : (b))#define max (a,b) (((a) > (b)) ? (a) : (b))
@@ -43,7 +42,7 @@ grub_err_t grub_xnu_set_video (struct grub_xnu_boot_params *params) {struct grub_video_mode_info mode_info; -struct grub_video_render_target *render_target; +struct grub_video_fbrender_target *render_target;int ret;int x,y;char *tmp, *modevar;
@@ -71,7 +70,8 @@ grub_xnu_set_video (struct grub_xnu_boot_params *params)if (ret)return grub_error (GRUB_ERR_IO ,"couldn't retrieve video parameters" ); - ret =grub_video_get_active_render_target (&render_target); + ret =grub_video_get_active_render_target + ((struct grub_video_render_target **) &render_target);if (ret)return grub_error (GRUB_ERR_IO ,"couldn't retrieve video parameters" );
video/fb/fbblit.c new file +828 -0
828 lines not on this page · raw message
video/fb/fbfill.c new file +177 -0
177 lines not on this page · raw message
video/fb/fbutil.c new file +177 -0
177 lines not on this page · raw message
video/fb/video_fb.c new file +1100 -0
1,078 lines not on this page · raw message
video/i386/pc/vbe.c +85 -1098
1,183 lines not on this page · raw message
video/i386/pc/vbeblit.c deleted +0 -828
828 lines not on this page · raw message
video/i386/pc/vbefill.c deleted +0 -177
177 lines not on this page · raw message
video/i386/pc/vbeutil.c deleted +0 -177
177 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Part of the diff is not shown here. View the raw message.