From owner-freebsd-hackers@freebsd.org Fri Dec 18 23:09:28 2015 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 221F6A4C14D for ; Fri, 18 Dec 2015 23:09:28 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0296D1502; Fri, 18 Dec 2015 23:09:28 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 619B0B9A3; Fri, 18 Dec 2015 18:09:26 -0500 (EST) From: John Baldwin To: freebsd-hackers@freebsd.org Cc: Emmanuel Vadot , 'Ed Maste' , Rui Paulo Subject: Re: boot1.efi and ConsoleControl on HP 840G1/G2 Date: Fri, 18 Dec 2015 14:44:56 -0800 Message-ID: <2690526.ic7VAp0tDr@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <20151119141026.c1c859703fc5fcc09d18d9b5@bidouilliste.com> References: <20151119120945.71d0cb068006398d3a556559@bidouilliste.com> <20151119141026.c1c859703fc5fcc09d18d9b5@bidouilliste.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 18 Dec 2015 18:09:26 -0500 (EST) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Dec 2015 23:09:28 -0000 On Thursday, November 19, 2015 02:10:26 PM Emmanuel Vadot wrote: > On Thu, 19 Nov 2015 12:09:45 +0100 > Emmanuel Vadot wrote: > > > > > Hello Hackers, > > > > After hours I've found why I couldn't use properly FreeBSD on my HP 840G1/G2 laptop. > > > > What is happening right now with -current is that the kernel framebuffer is garbage (https://www.bidouilliste.com/images/efi/IMG_2650.JPG). > > The problem is that boot1.efi calls ConsoleControl which, from my findings, is not in the UEFI specs but was only in the EDK implementation. > > This should not be a problem as LocateProtocol should return != EFI_SUCCESS but on my laptops (and probably others) this is not the case. > > > > After removing the ConsoleControl related lines and recompiling boot1.efi I can now boot FreeBSD. > > > > I'm pretty sure that this would not be a problem on other machine (with the patch I can still boot correctly FreeBSD on my Samsung 870Z laptop) but I would prefer that other people test it. > > > > I've opened a bug on bugzilla (https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=204674) if some people want to try the patch. > > > > Cheers, > > > > Replying to myself cause I've found other stuff. > > I looked at GRUB sources and it do what boot1.efi do (use ConsoleControl to set the Console to text mode, grub_efi_set_text_mode in grub-core/kern/efi/efi.c). > The only difference that I can see between how GRUB handle the EFI console and boot1 is that grub never Reset the Console nor change the current text mode (grub-core/term/efi/console.c). > So I patched again boot1.efi leaving the ConsoleControl stuff on but commented the Reset and the SetMode stuff, and this worked. > > This is the screen when the console is Reset : https://www.bidouilliste.com/images/efi/IMG_2649.JPG > This is the screen when the console is not reseted : https://www.bidouilliste.com/images/efi/IMG_2651.JPG > > From loader(8) with the current boot1.efi, if I type gop list I got 4 modes but all of them are 1920x1280. > If I gop set X and gop set 0 (1920x1280) (Or via loader.rc), when the kernel start the framebuffer data is correct. > > From loader(8) with the patched boot1.efi, if I type gop list I got the 4 correct modes. Hmm, Rui added the console reset in r281059. It sounds like you need to revert the changes made there? Does it work if you leave the reset and disable the SetMode() bits? -- John Baldwin