Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753402AbcD1Kjy (ORCPT ); Thu, 28 Apr 2016 06:39:54 -0400 Received: from terminus.zytor.com ([198.137.202.10]:47894 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752808AbcD1Kjv (ORCPT ); Thu, 28 Apr 2016 06:39:51 -0400 Date: Thu, 28 Apr 2016 03:38:48 -0700 From: tip-bot for Ard Biesheuvel Message-ID: Cc: pjones@redhat.com, hpa@zytor.com, mingo@kernel.org, tglx@linutronix.de, will.deacon@arm.com, bp@alien8.de, mark.rutland@arm.com, dh.herrmann@gmail.com, peterz@infradead.org, linux-kernel@vger.kernel.org, ard.biesheuvel@linaro.org, matt@codeblueprint.co.uk Reply-To: will.deacon@arm.com, mark.rutland@arm.com, bp@alien8.de, tglx@linutronix.de, mingo@kernel.org, hpa@zytor.com, pjones@redhat.com, ard.biesheuvel@linaro.org, matt@codeblueprint.co.uk, linux-kernel@vger.kernel.org, peterz@infradead.org, dh.herrmann@gmail.com In-Reply-To: <1461614832-17633-23-git-send-email-matt@codeblueprint.co.uk> References: <1461614832-17633-23-git-send-email-matt@codeblueprint.co.uk> To: linux-tip-commits@vger.kernel.org Subject: [tip:efi/core] efi/arm*/libstub: Wire up GOP protocol to 'struct screen_info' Git-Commit-ID: f0827e18a7a1da574ba8201a8b18f63778451aae X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3067 Lines: 84 Commit-ID: f0827e18a7a1da574ba8201a8b18f63778451aae Gitweb: http://git.kernel.org/tip/f0827e18a7a1da574ba8201a8b18f63778451aae Author: Ard Biesheuvel AuthorDate: Mon, 25 Apr 2016 21:06:54 +0100 Committer: Ingo Molnar CommitDate: Thu, 28 Apr 2016 11:34:00 +0200 efi/arm*/libstub: Wire up GOP protocol to 'struct screen_info' This adds the code to the ARM and arm64 versions of the UEFI stub to populate struct screen_info based on the information received from the firmware via the GOP protocol. Signed-off-by: Ard Biesheuvel Signed-off-by: Matt Fleming Cc: Borislav Petkov Cc: David Herrmann Cc: Mark Rutland Cc: Peter Jones Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Will Deacon Cc: linux-efi@vger.kernel.org Link: http://lkml.kernel.org/r/1461614832-17633-23-git-send-email-matt@codeblueprint.co.uk Signed-off-by: Ingo Molnar --- drivers/firmware/efi/libstub/arm-stub.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/drivers/firmware/efi/libstub/arm-stub.c b/drivers/firmware/efi/libstub/arm-stub.c index 1286325..993aa56 100644 --- a/drivers/firmware/efi/libstub/arm-stub.c +++ b/drivers/firmware/efi/libstub/arm-stub.c @@ -169,6 +169,25 @@ void efi_char16_printk(efi_system_table_t *sys_table_arg, out->output_string(out, str); } +static struct screen_info *setup_graphics(efi_system_table_t *sys_table_arg) +{ + efi_guid_t gop_proto = EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID; + efi_status_t status; + unsigned long size; + void **gop_handle = NULL; + struct screen_info *si = NULL; + + size = 0; + status = efi_call_early(locate_handle, EFI_LOCATE_BY_PROTOCOL, + &gop_proto, NULL, &size, gop_handle); + if (status == EFI_BUFFER_TOO_SMALL) { + si = alloc_screen_info(sys_table_arg); + if (!si) + return NULL; + efi_setup_gop(sys_table_arg, si, &gop_proto, size); + } + return si; +} /* * This function handles the architcture specific differences between arm and @@ -208,6 +227,7 @@ unsigned long efi_entry(void *handle, efi_system_table_t *sys_table, unsigned long reserve_addr = 0; unsigned long reserve_size = 0; int secure_boot = 0; + struct screen_info *si; /* Check if we were booted by the EFI firmware */ if (sys_table->hdr.signature != EFI_SYSTEM_TABLE_SIGNATURE) @@ -260,6 +280,8 @@ unsigned long efi_entry(void *handle, efi_system_table_t *sys_table, __nokaslr = true; } + si = setup_graphics(sys_table); + status = handle_kernel_image(sys_table, image_addr, &image_size, &reserve_addr, &reserve_size, @@ -341,6 +363,7 @@ fail_free_image: efi_free(sys_table, image_size, *image_addr); efi_free(sys_table, reserve_size, reserve_addr); fail_free_cmdline: + free_screen_info(sys_table, si); efi_free(sys_table, cmdline_size, (unsigned long)cmdline_ptr); fail: return EFI_ERROR;