kexec.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Dave Young <dyoung@redhat.com>
To: Simon Horman <horms@verge.net.au>
Cc: kexec@lists.infradead.org
Subject: Re: [PATCH kexec-tools] x86: use old screen_info if needed
Date: Mon, 29 Jan 2018 15:59:54 +0800	[thread overview]
Message-ID: <20180129075954.GA6020@dhcp-128-65.nay.redhat.com> (raw)
In-Reply-To: <20180129072135.pyzaawl7i6ny3piv@verge.net.au>

On 01/29/18 at 08:21am, Simon Horman wrote:
> On Sun, Jan 28, 2018 at 01:52:31PM +0800, Dave Young wrote:
> > With modern drm/kms graphic driver kexec-tools does not setup screen_info
> > correctly so one will only see screen output after those drm drivers
> > reinitializing after rebooting. Copying the old screen info from original
> > boot_params will help during my test, although it could not work for some
> > potential cases, but it is not worse than before.  This has been used in
> > the kernel kexec_file_load.
> > 
> > Signed-off-by: Dave Young <dyoung@redhat.com>
> 
> Thanks, applied.

Hi Simon,

Thanks for taking it.  I tested the original version on my laptop with
efi boot.  either of below two changes work for me:

a) use the setup_linux_vesafb() detected values and change the orig_video_isVGA
to 0x70 (copy from boot params)

b) copy all screen_info from boot params.

I actually was hesitating which one is better and finally I sent the b).
But maybe a) + b) will be better, since my case is a framebuffer, I'm
not sure non-framebuffer case though it will be not worse with the
patch.  Could you consider an appending patch below?

---
In current kexec-tools we have already vesafb detecting code,
but in case unsupported vesa fb types it just return and do nothing
During my test copying the old boot time screen info works for me with
efi booted machine. And the vesa fb detected values also work even if the
fb fix.id is "inteldrmfb", thus change the code to use those values
detected with fb ioctl first for framebuffer systems.

Signed-off-by: Dave Young <dyoung@redhat.com>
---
 kexec/arch/i386/x86-linux-setup.c |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

--- kexec-tools.orig/kexec/arch/i386/x86-linux-setup.c
+++ kexec-tools/kexec/arch/i386/x86-linux-setup.c
@@ -123,6 +123,7 @@ void setup_linux_bootloader_parameters_h
 	cmdline_ptr[cmdline_len - 1] = '\0';
 }
 
+static int get_bootparam(void *buf, off_t offset, size_t size);
 static int setup_linux_vesafb(struct x86_linux_param_header *real_mode)
 {
 	struct fb_fix_screeninfo fix;
@@ -144,8 +145,13 @@ static int setup_linux_vesafb(struct x86
 		/* VIDEO_TYPE_EFI */
 		real_mode->orig_video_isVGA = 0x70;
 	} else {
-		/* cannot handle and other types */
-		goto out;
+		int err;
+		off_t offset = offsetof(typeof(*real_mode), orig_video_isVGA);
+
+		/* blindly try old boot time video type */
+		err = get_bootparam(&real_mode->orig_video_isVGA, offset, 1);
+		if (err)
+			goto out;
 	}
 	close(fd);
 


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

  reply	other threads:[~2018-01-29  8:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-28  5:52 [PATCH kexec-tools] x86: use old screen_info if needed Dave Young
2018-01-29  7:21 ` Simon Horman
2018-01-29  7:59   ` Dave Young [this message]
2018-01-29  9:04     ` Simon Horman
2018-01-29  9:16       ` Dave Young

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180129075954.GA6020@dhcp-128-65.nay.redhat.com \
    --to=dyoung@redhat.com \
    --cc=horms@verge.net.au \
    --cc=kexec@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).