From patchwork Tue Jan 29 18:51:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Jones X-Patchwork-Id: 10786997 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A7AAF13B4 for ; Tue, 29 Jan 2019 18:52:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 979B22D8AA for ; Tue, 29 Jan 2019 18:52:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 94BA72D9BB; Tue, 29 Jan 2019 18:52:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2F1332D6CF for ; Tue, 29 Jan 2019 18:52:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727269AbfA2SwF (ORCPT ); Tue, 29 Jan 2019 13:52:05 -0500 Received: from mx1.redhat.com ([209.132.183.28]:34642 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726988AbfA2SwF (ORCPT ); Tue, 29 Jan 2019 13:52:05 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E2E3D8764F; Tue, 29 Jan 2019 18:52:04 +0000 (UTC) Received: from trillian.uncooperative.org.com (dhcp-10-20-1-13.bss.redhat.com [10.20.1.13]) by smtp.corp.redhat.com (Postfix) with ESMTP id 54550176C2; Tue, 29 Jan 2019 18:52:04 +0000 (UTC) From: Peter Jones To: Ard Biesheuvel Cc: linux-efi@vger.kernel.org, linux-acpi@vger.kernel.org, Peter Jones Subject: [PATCH 1/2] acpi: bgrt: Fix the way the BGRT status field is used. Date: Tue, 29 Jan 2019 13:51:54 -0500 Message-Id: <20190129185155.32386-1-pjones@redhat.com> In-Reply-To: <20190129160052.2058-1-ard.biesheuvel@linaro.org> References: <20190129160052.2058-1-ard.biesheuvel@linaro.org> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 29 Jan 2019 18:52:05 +0000 (UTC) Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The BGRT table's "status" field doesn't indicate "validity", but rather if and how the image is being displayed. As such, we shouldn't decide the table is invalid if status bits we don't understand are in use, and it's better to expose the values we do understand directly. This patch removes the validation of the status flag, and adds the files "orientation" and "displayed" in sysfs. The "status" file in sysfs is kept for compatibility with existing software. Signed-off-by: Peter Jones --- drivers/acpi/bgrt.c | 15 +++++++++++++++ drivers/firmware/efi/efi-bgrt.c | 5 ----- Documentation/ABI/testing/sysfs-firmware-acpi | 7 ++++++- 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/drivers/acpi/bgrt.c b/drivers/acpi/bgrt.c index 048413e0689..63d17fac2cc 100644 --- a/drivers/acpi/bgrt.c +++ b/drivers/acpi/bgrt.c @@ -32,6 +32,21 @@ static ssize_t show_status(struct device *dev, } static DEVICE_ATTR(status, S_IRUGO, show_status, NULL); +static ssize_t show_orientation(struct device *dev, + struct device_attribute *attr, char *buf) +{ + return snprintf(buf, PAGE_SIZE, "%d\n", + ((bgrt_tab.status >> 1) & 0x3) * 90); +} +static DEVICE_ATTR(orientation, S_IRUGO, show_orientation, NULL); + +static ssize_t show_displayed(struct device *dev, + struct device_attribute *attr, char *buf) +{ + return snprintf(buf, PAGE_SIZE, "%d\n", bgrt_tab.status & 0x1); +} +static DEVICE_ATTR(displayed, S_IRUGO, show_displayed, NULL); + static ssize_t show_type(struct device *dev, struct device_attribute *attr, char *buf) { diff --git a/drivers/firmware/efi/efi-bgrt.c b/drivers/firmware/efi/efi-bgrt.c index b2d98e16c7b..3a8797364b8 100644 --- a/drivers/firmware/efi/efi-bgrt.c +++ b/drivers/firmware/efi/efi-bgrt.c @@ -120,11 +120,6 @@ void __init efi_bgrt_init(unsigned long rsdp_phys) bgrt->version); goto out; } - if (bgrt->status & 0xfe) { - pr_notice("Ignoring BGRT: reserved status bits are non-zero %u\n", - bgrt->status); - goto out; - } if (bgrt->image_type != 0) { pr_notice("Ignoring BGRT: invalid image type %u (expected 0)\n", bgrt->image_type); diff --git a/Documentation/ABI/testing/sysfs-firmware-acpi b/Documentation/ABI/testing/sysfs-firmware-acpi index 613f42a9d5c..e4d3a1b5878 100644 --- a/Documentation/ABI/testing/sysfs-firmware-acpi +++ b/Documentation/ABI/testing/sysfs-firmware-acpi @@ -10,13 +10,18 @@ Description: transitions. image: The image bitmap. Currently a 32-bit BMP. - status: 1 if the image is valid, 0 if firmware invalidated it. type: 0 indicates image is in BMP format. version: The version of the BGRT. Currently 1. xoffset: The number of pixels between the left of the screen and the left edge of the image. yoffset: The number of pixels between the top of the screen and the top edge of the image. + status: The raw status flag of the image. The values are + presented individually in the following files: + displayed: 1 indicates the image was displayed, 0 indicates it + wasn't. + orientation: The orientation of the image in relation to its + natural layout, in degrees rotated clockwise. What: /sys/firmware/acpi/hotplug/ Date: February 2013 From patchwork Tue Jan 29 18:51:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Jones X-Patchwork-Id: 10786999 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B302313B4 for ; Tue, 29 Jan 2019 18:52:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A35192D6CF for ; Tue, 29 Jan 2019 18:52:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 981AA2D8B6; Tue, 29 Jan 2019 18:52:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3AD3B2D6CF for ; Tue, 29 Jan 2019 18:52:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727492AbfA2SwG (ORCPT ); Tue, 29 Jan 2019 13:52:06 -0500 Received: from mx1.redhat.com ([209.132.183.28]:45124 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726988AbfA2SwG (ORCPT ); Tue, 29 Jan 2019 13:52:06 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8FEDBAAA84; Tue, 29 Jan 2019 18:52:06 +0000 (UTC) Received: from trillian.uncooperative.org.com (dhcp-10-20-1-13.bss.redhat.com [10.20.1.13]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0737B5D6A6; Tue, 29 Jan 2019 18:52:05 +0000 (UTC) From: Peter Jones To: Ard Biesheuvel Cc: linux-efi@vger.kernel.org, linux-acpi@vger.kernel.org, Peter Jones Subject: [PATCH 2/2] efi: Add efifb sysfs information to the sysfs documentation Date: Tue, 29 Jan 2019 13:51:55 -0500 Message-Id: <20190129185155.32386-2-pjones@redhat.com> In-Reply-To: <20190129185155.32386-1-pjones@redhat.com> References: <20190129160052.2058-1-ard.biesheuvel@linaro.org> <20190129185155.32386-1-pjones@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 29 Jan 2019 18:52:06 +0000 (UTC) Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This adds the various files in /sys/bus/platform/drivers/efi-framebuffer/efi-framebuffer.N/ to the sysfs documentation. Signed-off-by: Peter Jones --- Documentation/ABI/testing/sysfs-firmware-efi | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Documentation/ABI/testing/sysfs-firmware-efi b/Documentation/ABI/testing/sysfs-firmware-efi index e794eac32a9..46cecd4cffe 100644 --- a/Documentation/ABI/testing/sysfs-firmware-efi +++ b/Documentation/ABI/testing/sysfs-firmware-efi @@ -28,3 +28,18 @@ Description: Displays the physical addresses of all EFI Configuration versions are always printed first, i.e. ACPI20 comes before ACPI. Users: dmidecode + +What: /sys/bus/platform/drivers/efi-framebuffer/efi-framebuffer.N/ +Date: October 2016 +Contact: linux-efi@vger.kernel.org +Description: The characteristics of the EFI GOP framebuffer device. + + base: The physical address of the framebuffer memory. + depth: The color depth of the framebuffer, in bits. + height: The height of the displayed frame in pixels. + linelength: The size of one line (i.e. the stride) of the + framebuffer memory, in bytes. + width: The width of the displayed frame in pixels. + mode: The index into the EFI GOP mode table for the mode in use + during boot-up. +Users: fwupd