From nobody Fri May 3 04:17:11 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1508440950076783.0383628660948; Thu, 19 Oct 2017 12:22:30 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id E90772034C0B7; Thu, 19 Oct 2017 12:18:49 -0700 (PDT) Received: from mail-wr0-x243.google.com (mail-wr0-x243.google.com [IPv6:2a00:1450:400c:c0c::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id CE01D2034C085 for ; Thu, 19 Oct 2017 12:18:47 -0700 (PDT) Received: by mail-wr0-x243.google.com with SMTP id w105so56720wrc.0 for ; Thu, 19 Oct 2017 12:22:26 -0700 (PDT) Received: from localhost.localdomain ([154.145.244.244]) by smtp.gmail.com with ESMTPSA id m8sm11718524wrg.55.2017.10.19.12.22.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Oct 2017 12:22:23 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c0c::243; helo=mail-wr0-x243.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=00cISmFpUxauso3yZl1YH0kTdmWj7DAy172LbMNIjvI=; b=U66A7QMUiDnkhE0CPlTP5Ht2BzdihZ23qv5QDpcrYZjjysNGIrrMuq7cMDxJaHl9lm ijImwERd4rLXx4Ix2tF5HgeU1Ks6NtEhiFYNS8PZ3zMVpCFvdZaoD4zKmy/eQ/5ToLrS Njts7FailZSDAbiWBn1RWOUFLShPpXTKfqAqs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=00cISmFpUxauso3yZl1YH0kTdmWj7DAy172LbMNIjvI=; b=LFTpA05iuSa4SyqEN9rTL0h6Xjeg4YeAYOP2Wq50W1Y0pASNC0t9BO6nDSunmsI8Zx rUldo6UXalH+acy9rIvNrH18VYgqf1nnLXcrHvNkel3DR6nTz++A5YSLet6DAD2u0sO9 mKW5QllohUHLdDjPj6KBaJ4Ax0MUry1fBjFZiB5r6tB+vI2eW5FtVySZczAvqUewC/Nn pzu+6QETJLn2Yt7Q9JcsU6R6v7cQAW9x8XfaYZAEaNYzk+m5MqrDsx/0SbAtzZKdvVPP 0sS92zvtxi+NACCtERO8CDvUpmsacGs4769oTEfdRNFS+dWDl+bLxkW43sIl9E3BrKQg QlxA== X-Gm-Message-State: AMCzsaXyf9IsrMO3ZPUvKIujnxDZ5udMJdY0Ej0evzmLMxQJT8R+5RYY X0es8o0owHBorHJnrqv3CkeLIrPsQrw= X-Google-Smtp-Source: ABhQp+QhiQ9IpJB0juYB6DIGxbSVC5OjLSr7RdOe3jJUKUoi5NII81jYYmL7MC3JB3siSosqQxYoZA== X-Received: by 10.223.163.141 with SMTP id l13mr2558539wrb.54.1508440943975; Thu, 19 Oct 2017 12:22:23 -0700 (PDT) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Thu, 19 Oct 2017 20:21:41 +0100 Message-Id: <20171019192141.4782-1-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.11.0 Subject: [edk2] [PATCH] EmbeddedPkg/DtPlatformDxe: remove /chosen/stdout-path on GOP registration X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: leif.lindholm@linaro.org, Ard Biesheuvel MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The presence of a /chosen/stdout-path property will force Linux to use the serial port as the primary console, even if a graphical console is available as well. But the presence of the Graphics Output Protocol (GOP) is a strong indication that the user may prefer to use his keyboard and mouse rather than his terminal emulator to interact with the system, so let's remove /chosen/stdout-path as soon as a GOP instance is registered. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel --- EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.c | 41 +++++++++++++++++= +++ EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.inf | 4 ++ 2 files changed, 45 insertions(+) diff --git a/EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.c b/EmbeddedPk= g/Drivers/DtPlatformDxe/DtPlatformDxe.c index 1014be2281d4..4f9ac8090fac 100644 --- a/EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.c +++ b/EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.c @@ -12,6 +12,7 @@ * **/ =20 +#include #include #include #include @@ -54,6 +55,9 @@ STATIC HII_VENDOR_DEVICE_PATH mDtPlatformDxeVendorDev= icePath =3D { } }; =20 +STATIC EFI_EVENT mRegisterGopEvent; +STATIC VOID *mGopRegistration; + STATIC EFI_STATUS InstallHiiPages ( @@ -89,6 +93,32 @@ InstallHiiPages ( return EFI_SUCCESS; } =20 +STATIC +VOID +OnRegisterGop ( + IN EFI_EVENT Event, + IN VOID *Dtb + ) +{ + INT32 Node; + INT32 Error; + + DEBUG ((DEBUG_INFO, + "%a: a GOP has been registered, removing /chosen/stdout-path from DT\n= ", + __FUNCTION__)); + + Node =3D fdt_path_offset (Dtb, "/chosen"); + if (Node < 0) { + return; + } + + Error =3D fdt_delprop (Dtb, Node, "stdout-path"); + if (Error) { + DEBUG ((DEBUG_INFO, "%a: Failed to delete 'stdout-path' property: %a\n= ", + __FUNCTION__, fdt_strerror (Error))); + } +} + /** The entry point for DtPlatformDxe driver. =20 @@ -181,6 +211,17 @@ DtPlatformDxeEntryPoint ( __FUNCTION__)); goto FreeDtb; } + + Status =3D gBS->CreateEvent (EVT_NOTIFY_SIGNAL, TPL_CALLBACK, + OnRegisterGop, Dtb, &mRegisterGopEvent); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "%a: failed to create event - %r\n", + __FUNCTION__, Status)); + } + + Status =3D gBS->RegisterProtocolNotify (&gEfiGraphicsOutputProtocolGui= d, + mRegisterGopEvent, &mGopRegistration); + ASSERT_EFI_ERROR (Status); } else { ASSERT (FALSE); } diff --git a/EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.inf b/Embedded= Pkg/Drivers/DtPlatformDxe/DtPlatformDxe.inf index 45dfd9088bf0..6b331294df8a 100644 --- a/EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.inf +++ b/EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.inf @@ -41,6 +41,7 @@ [LibraryClasses] BaseLib DebugLib DtPlatformDtbLoaderLib + FdtLib HiiLib MemoryAllocationLib UefiBootServicesTableLib @@ -53,6 +54,9 @@ [Guids] gEdkiiPlatformHasAcpiGuid gFdtTableGuid =20 +[Protocols] + gEfiGraphicsOutputProtocolGuid + [Depex] gEfiVariableArchProtocolGuid AND gEfiVariableWriteArchProtocolGuid --=20 2.11.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel