From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c09::242; helo=mail-wm0-x242.google.com; envelope-from=leif.lindholm@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wm0-x242.google.com (mail-wm0-x242.google.com [IPv6:2a00:1450:400c:c09::242]) (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 9A5BF202E5CDA for ; Thu, 19 Oct 2017 13:51:30 -0700 (PDT) Received: by mail-wm0-x242.google.com with SMTP id t69so18353499wmt.2 for ; Thu, 19 Oct 2017 13:55:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=HjEAWBa2HN5WrqeSS7LGVBoXRQwQbhcBopbVqjRtHAQ=; b=hbsj2f7TRzjuJHbQpBdKlpW4fiIs0xX1OXo33zJN8xXPjGcUkvIGJziLRxfV9f0VF5 2y1V5orJVyGV1x7EtO25l/HQmzBatkXYU1tXfgnyWiZRu2/k1tILFne2Y/X6s9IgqwFV Mn4Isb9opJpelabv2iON+SVdalW0F7oZdsV6w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=HjEAWBa2HN5WrqeSS7LGVBoXRQwQbhcBopbVqjRtHAQ=; b=b4ZtmvWGAMrKkXg5a9wREYP8UIEvYyQY/J66lJzDmhV9Saz3tKRUb4ivJVGjtx7rZ4 Xas9bsxR8B9Y5sQWM0/zAJp+bFA+WLbnokB0JxOu3Ig08Pwi/rwk2SmNv4QT8llFfE9b IE0Yvy9xmry+LR+ba0Ww0EhQuK1vLFzMchLH+HJ8ykCPe/yPO8J3c/3EJZgSgjFjYx8e x+2fXosiVYusn2rIVx2ppbkwcgNNfiSJygvTMny/OIB9zDpMB3c6iekLSIam9v5eTRg+ 0ch/CxeSE6rZuGr1AH+vFClqJJg/ahR8TXwxs0VKJ6Xr1fi2gcadjRMLdrPH5ihAIm+1 mCeA== X-Gm-Message-State: AMCzsaVnwcfqXnplSMTcljyTW6SzTNeOFbqhCfRxb6xM7H5UJoxynx85 sN7Kzfjh8vlkZXPV53Z3Svl8aQ== X-Google-Smtp-Source: ABhQp+RQVuYUcU4aHsPuuOj7qzbSTAacbZ5kxLbXju97WZeIs2Jqlmo2d/Ha3t/Cy810E4Iup5/9ZQ== X-Received: by 10.28.105.76 with SMTP id e73mr2870773wmc.116.1508446507425; Thu, 19 Oct 2017 13:55:07 -0700 (PDT) Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id l96sm29103821wrc.21.2017.10.19.13.55.05 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Oct 2017 13:55:06 -0700 (PDT) Date: Thu, 19 Oct 2017 21:55:04 +0100 From: Leif Lindholm To: Ard Biesheuvel Cc: edk2-devel@lists.01.org Message-ID: <20171019205504.uoiofih7quhjtiq4@bivouac.eciton.net> References: <20171019192141.4782-1-ard.biesheuvel@linaro.org> MIME-Version: 1.0 In-Reply-To: <20171019192141.4782-1-ard.biesheuvel@linaro.org> User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [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: , X-List-Received-Date: Thu, 19 Oct 2017 20:51:31 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Oct 19, 2017 at 08:21:41PM +0100, Ard Biesheuvel wrote: > 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. This may be the sensible thing to do, but something just doesn't feel right. Also, whatever we do here, we should try to mirror in ACPI with SPCR. Are we guaranteed to always want to disable serial console if there is a graphics adapter? I still dream of a world in which I can run consplitter up to the point where an OS takes over, and an OS installer will listen to input from both sources and register its selection from there. But if we can't have that, can we have a menu setting to select preference? The default can be a platform-specific Pcd. / Leif > 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/EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.c > index 1014be2281d4..4f9ac8090fac 100644 > --- a/EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.c > +++ b/EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.c > @@ -12,6 +12,7 @@ > * > **/ > > +#include > #include > #include > #include > @@ -54,6 +55,9 @@ STATIC HII_VENDOR_DEVICE_PATH mDtPlatformDxeVendorDevicePath = { > } > }; > > +STATIC EFI_EVENT mRegisterGopEvent; > +STATIC VOID *mGopRegistration; > + > STATIC > EFI_STATUS > InstallHiiPages ( > @@ -89,6 +93,32 @@ InstallHiiPages ( > return EFI_SUCCESS; > } > > +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 = fdt_path_offset (Dtb, "/chosen"); > + if (Node < 0) { > + return; > + } > + > + Error = 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. > > @@ -181,6 +211,17 @@ DtPlatformDxeEntryPoint ( > __FUNCTION__)); > goto FreeDtb; > } > + > + Status = 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 = gBS->RegisterProtocolNotify (&gEfiGraphicsOutputProtocolGuid, > + mRegisterGopEvent, &mGopRegistration); > + ASSERT_EFI_ERROR (Status); > } else { > ASSERT (FALSE); > } > diff --git a/EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.inf b/EmbeddedPkg/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 > > +[Protocols] > + gEfiGraphicsOutputProtocolGuid > + > [Depex] > gEfiVariableArchProtocolGuid AND > gEfiVariableWriteArchProtocolGuid > -- > 2.11.0 >