From patchwork Thu Mar 10 05:40:04 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 63731 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp244244lbc; Wed, 9 Mar 2016 21:43:39 -0800 (PST) X-Received: by 10.67.3.67 with SMTP id bu3mr877509pad.39.1457588614846; Wed, 09 Mar 2016 21:43:34 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id e83si3487197pfb.131.2016.03.09.21.43.34 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Mar 2016 21:43:34 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org; dkim=neutral (body hash did not verify) header.i=@linaro.org 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 1adtLl-0007d1-Gk; Thu, 10 Mar 2016 05:41:29 +0000 Received: from mail-pa0-x232.google.com ([2607:f8b0:400e:c03::232]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1adtL7-0007Pk-7u for linux-arm-kernel@lists.infradead.org; Thu, 10 Mar 2016 05:40:51 +0000 Received: by mail-pa0-x232.google.com with SMTP id td3so31932468pab.2 for ; Wed, 09 Mar 2016 21:40:31 -0800 (PST) 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=qQeDgJXV0YeCMHAFviHXb6NW9us6bJlczLYRiLRUNPk=; b=OZYK5nASN1JlhldsTNtWDNtaUoxlAoSH85W1A4gMkyYeLZymt3hGMgT6xH0hhXiEmg qvEwajtxkN+43KTTHNsgRUIp9db6EZ0d5WbVfqvNGWzM2oAV5YuSApnphVF+nEkRfyzz mqfv3vZArlaWqSgy/vvDU3lxYh5EUvvckiw7w= 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=qQeDgJXV0YeCMHAFviHXb6NW9us6bJlczLYRiLRUNPk=; b=gdj4y6ndXXHDwZrd2G0klBz8UFBtkAWH3SuGR1RbIlz1WQqkTLsHMOsKqVI14UFR+p qoHHLmIO5lRITnPvt0J3kSoww8X84rAfWE4f6XWYH107ljTKhi4fxim9W8W1712iEPFX CS+RxJ6dCwtz44GwycUV+xcLjMDI3M3gI5TNXN39ox9F94EcH2BMe9g0u3sQvoBQWe+g fdTJ1UO3PZeBXcf81wkp9VHCeWMAELnsH1ZtAAtie+n6jLaD4nKiy6xnWoMop6cHb9Do bNaBXqGLAIiwSAMYvY/EG7xrkurT9/MF+moSPVdC36yFXVQjiDr6ihc3gpdrA+gKdpsG PAWA== X-Gm-Message-State: AD7BkJKsIy3F1iw+9J2ritq8I0IwLE7CmR0KexFXVVwa6hsuc63Zg4HFIX2w6Ae8TmeEoZHi X-Received: by 10.66.145.68 with SMTP id ss4mr2323033pab.79.1457588431133; Wed, 09 Mar 2016 21:40:31 -0800 (PST) Received: from ards-macbook-pro.cgcwfunction (110-170-137-253.static.asianet.co.th. [110.170.137.253]) by smtp.gmail.com with ESMTPSA id r5sm2127864pap.7.2016.03.09.21.40.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 09 Mar 2016 21:40:30 -0800 (PST) From: Ard Biesheuvel To: linux-efi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, matt@codeblueprint.co.uk, linux@arm.linux.org.uk, catalin.marinas@arm.com, will.deacon@arm.com Subject: [PATCH 4/8] efi/x86: efifb: move DMI based quirks handling out of generic code Date: Thu, 10 Mar 2016 12:40:04 +0700 Message-Id: <1457588408-19309-5-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1457588408-19309-1-git-send-email-ard.biesheuvel@linaro.org> References: <1457588408-19309-1-git-send-email-ard.biesheuvel@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160309_214049_528846_C0583ED1 X-CRM114-Status: GOOD ( 15.50 ) X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2607:f8b0:400e:c03:0:0:0:232 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 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+patch=linaro.org@lists.infradead.org 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 --- 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(-) -- 1.9.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel 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