From patchwork Mon Apr 25 20:06:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Fleming X-Patchwork-Id: 66627 Delivered-To: patch@linaro.org Received: by 10.140.93.198 with SMTP id d64csp1235936qge; Mon, 25 Apr 2016 13:14:04 -0700 (PDT) X-Received: by 10.66.66.46 with SMTP id c14mr51604356pat.79.1461615244256; Mon, 25 Apr 2016 13:14:04 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y134si8343141pfb.59.2016.04.25.13.14.03; Mon, 25 Apr 2016 13:14:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@codeblueprint-co-uk.20150623.gappssmtp.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965161AbcDYUOA (ORCPT + 29 others); Mon, 25 Apr 2016 16:14:00 -0400 Received: from mail-wm0-f48.google.com ([74.125.82.48]:38544 "EHLO mail-wm0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964982AbcDYUHx (ORCPT ); Mon, 25 Apr 2016 16:07:53 -0400 Received: by mail-wm0-f48.google.com with SMTP id u206so145154220wme.1 for ; Mon, 25 Apr 2016 13:07:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codeblueprint-co-uk.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=4PKG3iD+f0PFKr0is/khjklo2TbvaCrzlo3W33slpXY=; b=TrCrG2HQo2VkzxH5p0xrhB4O/SCFbifmlahXWlSzP80phP3JOmi9Szmjdivk1N7brT osowrUQfAOK+vJtwGsfZx7Cj5Btr4olruaabpdN+yKMw6Z/+lwgP4plWu3Zt5CQUp9a2 be75wCR/V2PM+ZQfz8aVrSmbc78iFCQHPNOD1DMojaC+aTXvL2UdMnD/iBLRXWa9xUf9 qj35zOj/jSfS5FQu07cYgcb/M8Txee6pHmhZwLCnTqJCi4vORVPi8D7Ziu4UPYoV+hcB 9kStedcrBU9BIs67kZ9qSkmnyxGewmQ9wbxvg0RY5SRoJZznQKRh+jatOtJ388dM6ldf hAyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=4PKG3iD+f0PFKr0is/khjklo2TbvaCrzlo3W33slpXY=; b=EXreavNnycMQRF32fLfIlhpeci00Gv9Q+bXAGIAg6HHA9Yklv/PwgIUjNOtOCjywRd iPwmFzvc79VIYfNd3/jjM8bcts0DYqah1OMO+OC9ij4+UuigJPlx0coaSu7fx2CPAWvp hl1wA/bk26SYu0UpHhnoOkaNNDG/yv6LBAfVaSO/ir51IwItOrd3A5xxNizwDqGOvcby XkLr0LaCJ/3PuERbl8eUE1/P9f0kk7YrSTZsIYP1ny3xBZnsEwxFrmv3qdrcvrqbz4vj OXvsaCmrd0gyiCKW/1obk3/XhTsEtKlivYGYW6lo68d204GEAyL6YyOqe2VJhURDrFJb e9jw== X-Gm-Message-State: AOPr4FWOH6ouxrjJuk3kpbcZ/MGENKiwpM9lXnDgMR3BnJ1KSpDIN64NEXlVvdJTbmwHxA== X-Received: by 10.194.2.210 with SMTP id 18mr39537838wjw.55.1461614871793; Mon, 25 Apr 2016 13:07:51 -0700 (PDT) Received: from localhost (bcdc58e5.skybroadband.com. [188.220.88.229]) by smtp.gmail.com with ESMTPSA id f11sm14929608wmf.22.2016.04.25.13.07.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Apr 2016 13:07:51 -0700 (PDT) From: Matt Fleming To: Ingo Molnar , Thomas Gleixner , "H . Peter Anvin" Cc: Ard Biesheuvel , linux-kernel@vger.kernel.org, linux-efi@vger.kernel.org, Matt Fleming , David Herrmann , Mark Rutland , Peter Jones , Will Deacon Subject: [PATCH 18/40] x86/efi: efifb: Move DMI based quirks handling out of generic code Date: Mon, 25 Apr 2016 21:06:50 +0100 Message-Id: <1461614832-17633-19-git-send-email-matt@codeblueprint.co.uk> X-Mailer: git-send-email 2.7.3 In-Reply-To: <1461614832-17633-1-git-send-email-matt@codeblueprint.co.uk> References: <1461614832-17633-1-git-send-email-matt@codeblueprint.co.uk> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ard Biesheuvel The efifb quirks handling based on DMI identification of the platform is specific to x86, so move it to x86 arch code. Signed-off-by: Ard Biesheuvel Acked-by: David Herrmann Acked-by: Peter Jones Cc: Mark Rutland Cc: Will Deacon Signed-off-by: Matt Fleming --- arch/x86/include/asm/efi.h | 2 ++ arch/x86/kernel/sysfb_efi.c | 15 +++++++++++++++ drivers/video/fbdev/efifb.c | 15 ++++----------- 3 files changed, 21 insertions(+), 11 deletions(-) -- 2.7.3 diff --git a/arch/x86/include/asm/efi.h b/arch/x86/include/asm/efi.h index 10e440770371..8747abe8872f 100644 --- a/arch/x86/include/asm/efi.h +++ b/arch/x86/include/asm/efi.h @@ -180,6 +180,8 @@ static inline bool efi_runtime_supported(void) extern struct console early_efi_console; extern void parse_efi_setup(u64 phys_addr, u32 data_len); +extern void efifb_setup_from_dmi(struct screen_info *si, const char *opt); + #ifdef CONFIG_EFI_MIXED extern void efi_thunk_runtime_setup(void); extern efi_status_t efi_thunk_set_virtual_address_map( diff --git a/arch/x86/kernel/sysfb_efi.c b/arch/x86/kernel/sysfb_efi.c index b285d4e8c68e..e21a8a7ddcff 100644 --- a/arch/x86/kernel/sysfb_efi.c +++ b/arch/x86/kernel/sysfb_efi.c @@ -68,6 +68,21 @@ struct efifb_dmi_info efifb_dmi_list[] = { [M_UNKNOWN] = { NULL, 0, 0, 0, 0, OVERRIDE_NONE } }; +void efifb_setup_from_dmi(struct screen_info *si, const char *opt) +{ + int i; + + for (i = 0; i < M_UNKNOWN; i++) { + if (efifb_dmi_list[i].base != 0 && + !strcmp(opt, efifb_dmi_list[i].optname)) { + si->lfb_base = efifb_dmi_list[i].base; + si->lfb_linelength = efifb_dmi_list[i].stride; + si->lfb_width = efifb_dmi_list[i].width; + si->lfb_height = efifb_dmi_list[i].height; + } + } +} + #define choose_value(dmivalue, fwvalue, field, flags) ({ \ typeof(fwvalue) _ret_ = fwvalue; \ if ((flags) & (field)) \ diff --git a/drivers/video/fbdev/efifb.c b/drivers/video/fbdev/efifb.c index 95d293b7445a..dd594369b8a6 100644 --- a/drivers/video/fbdev/efifb.c +++ b/drivers/video/fbdev/efifb.c @@ -8,6 +8,7 @@ #include #include +#include #include #include #include @@ -15,7 +16,7 @@ #include #include #include