From 24bf5498ad95192f5271f978a527ff5f71bdb845 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Fri, 25 Mar 2011 10:53:35 +0000 Subject: [PATCH] Switch back to framebuffer page zero before loading the kernel (thanks, Felix Kuehling). --- debian/changelog | 2 ++ debian/patches/series | 1 + debian/patches/video_fb_pageflip.patch | 32 ++++++++++++++++++++++++++ 3 files changed, 35 insertions(+) create mode 100644 debian/patches/video_fb_pageflip.patch diff --git a/debian/changelog b/debian/changelog index d61860e36..37b95a955 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,8 @@ grub2 (1.99~rc1-6) UNRELEASED; urgency=low - Fix crash when extending menu entry line beyond 79 characters (closes: #615893). - Account for FreeBSD module headers when calculating allocation size. + - Switch back to framebuffer page zero before loading the kernel + (thanks, Felix Kuehling). * Merge from Ubuntu: - If we're upgrading and /boot/grub/core.img doesn't exist, then don't ask where to install GRUB, since it probably means we're in some kind diff --git a/debian/patches/series b/debian/patches/series index ef58807cd..2bf8ad65e 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -21,3 +21,4 @@ btrfs_rootflags.patch lnxboot_grub.patch normal_menu_line_alloc.patch freebsd_module_header_alloc.patch +video_fb_pageflip.patch diff --git a/debian/patches/video_fb_pageflip.patch b/debian/patches/video_fb_pageflip.patch new file mode 100644 index 000000000..423e8a64c --- /dev/null +++ b/debian/patches/video_fb_pageflip.patch @@ -0,0 +1,32 @@ +Description: Switch back to framebuffer page zero before loading kernel + Thanks to Felix Kuehling. +Author: Colin Watson +Forwarded: http://lists.gnu.org/archive/html/grub-devel/2011-03/msg00057.html +Applied-Upstream: http://bazaar.launchpad.net/~vcs-imports/grub/grub2-bzr/revision/3116 +Last-Update: 2011-03-25 + +Index: b/grub-core/video/fb/video_fb.c +=================================================================== +--- a/grub-core/video/fb/video_fb.c ++++ b/grub-core/video/fb/video_fb.c +@@ -1505,6 +1505,20 @@ + { + grub_memcpy (mode_info, &(framebuffer.front_target->mode_info), + sizeof (*mode_info)); ++ ++ /* We are about to load a kernel. Switch back to page zero, since some ++ kernel drivers expect that. */ ++ if ((mode_info->mode_type & GRUB_VIDEO_MODE_TYPE_DOUBLE_BUFFERED) ++ && framebuffer.set_page && framebuffer.displayed_page != 0) ++ { ++ /* Ensure both pages are exactly in sync. */ ++ grub_memcpy (framebuffer.back_target->data, ++ framebuffer.front_target->data, ++ framebuffer.back_target->mode_info.pitch ++ * framebuffer.back_target->mode_info.height); ++ grub_video_swap_buffers (); ++ } ++ + *framebuf = framebuffer.front_target->data; + + grub_video_fb_fini ();