From patchwork Fri Mar 18 16:47:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 8621971 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E2B3EC0553 for ; Fri, 18 Mar 2016 16:58:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 16E7E201F5 for ; Fri, 18 Mar 2016 16:58:08 +0000 (UTC) Received: from bombadil.infradead.org (unknown [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 31A3B20155 for ; Fri, 18 Mar 2016 16:58:07 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1agxZo-0003O5-UU; Fri, 18 Mar 2016 16:48:40 +0000 Received: from mail-wm0-x236.google.com ([2a00:1450:400c:c09::236]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1agxZM-0002ty-EJ for linux-arm-kernel@lists.infradead.org; Fri, 18 Mar 2016 16:48:16 +0000 Received: by mail-wm0-x236.google.com with SMTP id p65so45471815wmp.0 for ; Fri, 18 Mar 2016 09:47:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=q+g6q9IMCd50xtKbRyToqeZ/lGTApRGwURZtDiFivyc=; b=IERA2LQ6ypi0ZPnDjK7JdtEGC/IS8c6/TAJmIbN/Y9sFtG+iyclCnUgmFFLpz8DHJj SKp0D6LX5Pl/B9MpC0z+DVbfsF4DUhgYS903D3Gz/3wAxVTpeu+u5A0ozABQ8CO/9aBF XxUUPoJOyYaCRS4T/J+39PEx2z4wzTUiFSXo8= 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=q+g6q9IMCd50xtKbRyToqeZ/lGTApRGwURZtDiFivyc=; b=ObNos/9umdI0MD+VPJDN0Zj1GEeG6RxgySFdxXQ2rOIhgZbsashgaHhtZFISkn5NJ9 GPEEl+K8gWNnL3jw5aicEWz5BV5+3bcb/S15SEPNwBhA7vbEn5B8I9OFKl0P6rkrZ93i +ixHMNXgNo2lpV5qyy1aDWswTZTjzNhi4r/wKPNmTKMtkIvVPL0vwyNltHPAh9h6r41b AgPTBUW+t56TClrjDnvh5OPNI+MimTqUptImCpyduAkK9AHsPhvO54FVMyokayZI0M6d X9tuTDhGgEnjJ0qrhaKyeOmsZ/E7xfz51bWZ+T1RPv319MR6qWktJvFAgNsg8yS1ANSj /wrA== X-Gm-Message-State: AD7BkJK3lQcNNHl1IzWtAeoMopFP/30pAZCM8ZPlxc6SmRKL0NQW5uMFIz+lFa1VwnrHPA8I X-Received: by 10.194.176.129 with SMTP id ci1mr2250073wjc.166.1458319675882; Fri, 18 Mar 2016 09:47:55 -0700 (PDT) Received: from localhost.localdomain ([195.55.142.58]) by smtp.gmail.com with ESMTPSA id c71sm118646wmd.4.2016.03.18.09.47.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 18 Mar 2016 09:47:55 -0700 (PDT) From: Ard Biesheuvel To: linux-kernel@vger.kernel.org, linux-efi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, matt@codeblueprint.co.uk, catalin.marinas@arm.com, will.deacon@arm.com, linux@arm.linux.org.uk, pjones@redhat.com, dh.herrmann@gmail.com Subject: [PATCH v2 3/9] efi/x86: efifb: move DMI based quirks handling out of generic code Date: Fri, 18 Mar 2016 17:47:35 +0100 Message-Id: <1458319661-19762-4-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1458319661-19762-1-git-send-email-ard.biesheuvel@linaro.org> References: <1458319661-19762-1-git-send-email-ard.biesheuvel@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160318_094812_895175_05D25D5D X-CRM114-Status: GOOD ( 15.94 ) X-Spam-Score: -2.7 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, x86@kernel.org, leif.lindholm@linaro.org, Ard Biesheuvel MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RDNS_NONE,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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(-) diff --git a/arch/x86/include/asm/efi.h b/arch/x86/include/asm/efi.h index 7d5187b66108..790adbc3a64a 100644 --- a/arch/x86/include/asm/efi.h +++ b/arch/x86/include/asm/efi.h @@ -154,6 +154,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