Received: from list by lists.gnu.org with archive (Exim 4.71) id 1fdaBA-00005i-Em for mharc-grub-devel@gnu.org; Thu, 12 Jul 2018 07:54:36 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58151) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fdaB7-0008VN-3p for grub-devel@gnu.org; Thu, 12 Jul 2018 07:54:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fdaB3-0001L3-2L for grub-devel@gnu.org; Thu, 12 Jul 2018 07:54:33 -0400 Received: from boksu.net-space.pl ([185.15.1.105]:54846) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_3DES_EDE_CBC_SHA1:24) (Exim 4.71) (envelope-from ) id 1fdaB2-0001In-Mx for grub-devel@gnu.org; Thu, 12 Jul 2018 07:54:29 -0400 Received: (from localhost user: 'dkiper' uid#4000 fake: STDIN (dkiper@boksu.net-space.pl)) by router-fw-old.local.net-space.pl id S1851094AbeGLLyT (ORCPT ); Thu, 12 Jul 2018 13:54:19 +0200 Date: Thu, 12 Jul 2018 13:54:19 +0200 From: Daniel Kiper To: Arindam Nath Cc: grub-devel@gnu.org, Daniel Kiper , Arindam Nath Subject: Re: [PATCH] i386/linux: add support for ext_lfb_base (v2) Message-ID: <20180712115419.GA6526@router-fw-old.local.net-space.pl> References: <20180706181210.GD14342@router-fw-old.local.net-space.pl> <20180712093912.78685-1-arindam.nath@amd.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180712093912.78685-1-arindam.nath@amd.com> User-Agent: Mutt/1.3.28i X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 185.15.1.105 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jul 2018 11:54:35 -0000 On Thu, Jul 12, 2018 at 03:09:12PM +0530, Arindam Nath wrote: > From: Arindam Nath > > v2: changes suggested by Daniel > > - added #if defined (GRUB_MACHINE_EFI) && defined (__x86_64__) > - moved constant definitions to the beginning of header file > > v1: This should go... > The EFI Graphics Output Protocol can return a 64-bit > linear frame buffer address in some firmware/BIOS > implementations. We currently only store the lower > 32-bits in the lfb_base. This will eventually be > passed to Linux kernel and the efifb driver will > incorrectly interpret the framebuffer address as > 32-bit address. > > The Linux kernel has already added support to handle > 64-bit linear framebuffer address in the efifb driver > since quite some time now. > > This patch adds the support for 64-bit linear frame > buffer address in GRUB to address the above mentioned > scenario. > > Signed-off-by: Arindam Nath > --- ...here. You should add "---" after SOB and put info about the versions after it. You can find good examples on the list. > grub-core/loader/i386/linux.c | 4 ++++ > include/grub/i386/linux.h | 12 +++++++++++- > 2 files changed, 15 insertions(+), 1 deletion(-) > > diff --git a/grub-core/loader/i386/linux.c b/grub-core/loader/i386/linux.c > index 083f9417c..246945abe 100644 > --- a/grub-core/loader/i386/linux.c > +++ b/grub-core/loader/i386/linux.c > @@ -306,6 +306,10 @@ grub_linux_setup_video (struct linux_kernel_params *params) > params->lfb_line_len = mode_info.pitch; > > params->lfb_base = (grub_size_t) framebuffer; > +#if defined (GRUB_MACHINE_EFI) && defined (__x86_64__) Please add one empty line before "#if ...". > + params->ext_lfb_base = (grub_size_t) (((grub_uint64_t)(grub_size_t) framebuffer) >> 32); > + params->capabilities |= VIDEO_CAPABILITY_64BIT_BASE; > +#endif Please add one empty line after "#endif". > params->lfb_size = ALIGN_UP (params->lfb_line_len * params->lfb_height, 65536); > > params->red_mask_size = mode_info.red_mask_size; > diff --git a/include/grub/i386/linux.h b/include/grub/i386/linux.h > index da0ca3b83..04d277b4e 100644 > --- a/include/grub/i386/linux.h > +++ b/include/grub/i386/linux.h > @@ -43,6 +43,13 @@ > > #define GRUB_LINUX_CL_MAGIC 0xA33F > > +#if defined (GRUB_MACHINE_EFI) && defined (__x86_64__) > + > +#define VIDEO_CAPABILITY_SKIP_QUIRKS (1 << 0) > +#define VIDEO_CAPABILITY_64BIT_BASE (1 << 1) /* Frame buffer base is 64-bit */ > + > +#endif Please drop this #if/#endif. It is not needed here. > + > #ifdef __x86_64__ > > #define GRUB_LINUX_EFI_SIGNATURE \ > @@ -188,8 +195,11 @@ struct linux_kernel_params > grub_uint16_t lfb_pages; /* 32 */ > grub_uint16_t vesa_attrib; /* 34 */ > grub_uint32_t capabilities; /* 36 */ > +#if defined (GRUB_MACHINE_EFI) && defined (__x86_64__) > + grub_uint32_t ext_lfb_base; /* 3a */ > +#endif Ditto. > > - grub_uint8_t padding3[0x40 - 0x3a]; > + grub_uint8_t padding3[0x40 - 0x3e]; And this will be wrong if you do not drop #if/#endif above. Daniel