From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1B292C48BE5 for ; Wed, 16 Jun 2021 14:18:59 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 648C761076 for ; Wed, 16 Jun 2021 14:18:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 648C761076 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 57F8B82958; Wed, 16 Jun 2021 16:18:55 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Fpbo9DR8"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B66AD8295B; Wed, 16 Jun 2021 16:18:53 +0200 (CEST) Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com [IPv6:2a00:1450:4864:20::534]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 1C55E80296 for ; Wed, 16 Jun 2021 16:18:50 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=pbrobinson@gmail.com Received: by mail-ed1-x534.google.com with SMTP id w21so2949827edv.3 for ; Wed, 16 Jun 2021 07:18:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=XNXQloZSGmNq3eaI4kXwX4QOT39qCL8SHDmXd2CZWcE=; b=Fpbo9DR8bruvsMHeejdIRlgnOg1itW0Hr1b6Gsrh8B9zO2IDsL4a8xdw/eopM2BhC2 N1lCR88W8oDdHtGjC5oKIZVVL6r00vJcknmbd3t3tSClpOPL3rWqgT29LkoedkT96Npb NUNt5eq+FM/jMMLqFjgKoV2i+cnu/nOFa3lRNIMuwcCJlJsn8TbnLV2x4erj6An/1UM7 m/Vubzxoi55VJ3byLsEwEtvTsSLaAGD3e9xTV17rwRspKmWlpV4Lyeu9BQhqGuzQykH1 hs6vnpBYny14OlvL4DunQxDmPcQjhqfZbf+w+gCQzQa5YnYRlEqNBsrXOTVVWKCuK8xe QEZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=XNXQloZSGmNq3eaI4kXwX4QOT39qCL8SHDmXd2CZWcE=; b=uJpU2Ez6xRpJLqMA5+fNiFI0EDDYSgLdeqDBD4gq0qBwsGcCnNlzmPmcTC1eVAfJkU W347jZi2j02VzyM/fbWLn58N1l5a0eJQboM88f3ITgCTVDwIyRYhgn5Yotd4LA6hB7py BBneP3jJ6kxYCMHLusf7arkU+odWzV0jiBWvYyA5auS/JTPdY01x8tkRN7b/yOo2aAcT 3QDJGKYsJhJgV0kqnhG0dQ/c5h8r4/oMwhfg32b2XNXAHdRL1xMvi8KYgActMBKqkRwJ aj6pL5uwetqdRFQUzogV/DkqGUaFb+upFQLphpCfwP5dcV38E9rf0lYEnlwyITwKezyW Mxnw== X-Gm-Message-State: AOAM533+Njpa9cRX3nhsiJngN3ry97024GUHCDO9zdUWgd4WKxWPqXkJ kduhULua+dqexRwwjHpv2g1b+IuYI6WQ6adysFE= X-Google-Smtp-Source: ABdhPJwClhPtl7/MdSTmH9mEjuUv/hZawPHODgGBvOxWzUGm+YsTkuBsV5gvSQGYMMaCvtcS6PXPQVE3C0kW8svmT6M= X-Received: by 2002:a50:8dc6:: with SMTP id s6mr4524297edh.50.1623853129775; Wed, 16 Jun 2021 07:18:49 -0700 (PDT) MIME-Version: 1.0 References: <20210615211028.287546-1-icenowy@aosc.io> <65D3D4A3-8E27-4CCE-BDE9-01D5FE7F32EC@gmx.de> <0402a529e381bd8dff81db7afd6bf7b5e4dfc95d.camel@aosc.io> In-Reply-To: From: Peter Robinson Date: Wed, 16 Jun 2021 15:18:35 +0100 Message-ID: Subject: Re: [PATCH] efi_loader: allow to disable GOP support To: Icenowy Zheng Cc: Heinrich Schuchardt , Alexander Graf , u-boot@lists.denx.de Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean On Wed, Jun 16, 2021 at 3:11 PM Icenowy Zheng wrote: > > =E5=9C=A8 2021-06-16=E6=98=9F=E6=9C=9F=E4=B8=89=E7=9A=84 15:06 +0100=EF= =BC=8CPeter Robinson=E5=86=99=E9=81=93=EF=BC=9A > > On Wed, Jun 16, 2021 at 1:20 PM Icenowy Zheng > > wrote: > > > > > > =E5=9C=A8 2021-06-16=E6=98=9F=E6=9C=9F=E4=B8=89=E7=9A=84 06:59 +0200= =EF=BC=8CHeinrich Schuchardt=E5=86=99=E9=81=93=EF=BC=9A > > > > Am 15. Juni 2021 23:10:28 MESZ schrieb Icenowy Zheng > > > > : > > > > > Sometimes EFI GOP support may be not wanted (e.g. because the > > > > > operating > > > > > system cannot operate well with it) even if video support in U- > > > > > Boot > > > > > is > > > > > needed. > > > > > > > > Which OS has which problem? > > > > Why don't you fix the OS? > > > > > > I'm trying RK3399 with Linux. EFIFB never works as intended (maybe > > > it's > > > because IOMMU is reconfigured), and rockchipdrmfb will be fb1 > > > (leave > > > non-working EFIFB as fb0), makes fbcon unusable. > > > > It's due to bugs in Linux, it will be fixed in 5.14 with these > > patches > > from our Fedora testing: > > https://lists.freedesktop.org/archives/dri-devel/2021-May/306803.html > > I think this patch should get backported. I have no problems with that so feel free to propose it to the stable kerne= ls. > BTW a point of using EFI boot is to support existing distros, which > won't have this patch. Sure, but UEFI doesn't guarantee there aren't bugs in kernels or firmware though, it certainly makes things more straight forward but it's no silver bullet. > > > > There's also this enhancement, also should land in 5.14, which is > > dependent on the feature that's in the second link: > > > > https://lists.freedesktop.org/archives/dri-devel/2021-May/306803.html > > https://lists.freedesktop.org/archives/dri-devel/2021-April/303291.html > > > > With that first patch it mostly works for me, the second two series > > improves on that some more. > > > > Peter > > > > > The second problem has a proposed fix, but the first problem is > > > mystery. > > > > > > > > > > > Best regards > > > > > > > > Heinrich > > > > > > > > > > > > > > > > > > Allow to disable EFI GOP support with a Kconfig option. > > > > > > > > > > Signed-off-by: Icenowy Zheng > > > > > --- > > > > > lib/efi_loader/Kconfig | 8 ++++++++ > > > > > lib/efi_loader/Makefile | 3 +-- > > > > > lib/efi_loader/efi_setup.c | 11 ++++++----- > > > > > 3 files changed, 15 insertions(+), 7 deletions(-) > > > > > > > > > > diff --git a/lib/efi_loader/Kconfig b/lib/efi_loader/Kconfig > > > > > index 6242caceb7..5ba0ce6a44 100644 > > > > > --- a/lib/efi_loader/Kconfig > > > > > +++ b/lib/efi_loader/Kconfig > > > > > @@ -282,6 +282,14 @@ config EFI_HAVE_RUNTIME_RESET > > > > > depends on ARCH_BCM283X || FSL_LAYERSCAPE || PSCI_RESET > > > > > || > > > > > \ > > > > > SANDBOX || SYSRESET_X86 > > > > > > > > > > +config EFI_GOP_PROTOCOL > > > > > + bool "EFI_GOP_PROTOCOL support" > > > > > + default y > > > > > + depends on DM_VIDEO || LCD > > > > > + help > > > > > + Provide a EFI_GOP_PROTOCOL implementation using the > > > > > graphics > > > > > + hardware initialized by U-Boot. > > > > > + > > > > > config EFI_GRUB_ARM32_WORKAROUND > > > > > bool "Workaround for GRUB on 32bit ARM" > > > > > default n if ARCH_BCM283X || ARCH_SUNXI || ARCH_QEMU > > > > > diff --git a/lib/efi_loader/Makefile b/lib/efi_loader/Makefile > > > > > index fd344cea29..826563d9a7 100644 > > > > > --- a/lib/efi_loader/Makefile > > > > > +++ b/lib/efi_loader/Makefile > > > > > @@ -54,8 +54,7 @@ obj-$(CONFIG_EFI_VARIABLES_PRESEED) +=3D > > > > > efi_var_seed.o > > > > > endif > > > > > obj-y +=3D efi_watchdog.o > > > > > obj-$(CONFIG_EFI_ESRT) +=3D efi_esrt.o > > > > > -obj-$(CONFIG_LCD) +=3D efi_gop.o > > > > > -obj-$(CONFIG_DM_VIDEO) +=3D efi_gop.o > > > > > +obj-$(CONFIG_EFI_GOP_PROTOCOL) +=3D efi_gop.o > > > > > obj-$(CONFIG_PARTITIONS) +=3D efi_disk.o > > > > > obj-$(CONFIG_NET) +=3D efi_net.o > > > > > obj-$(CONFIG_GENERATE_ACPI_TABLE) +=3D efi_acpi.o > > > > > diff --git a/lib/efi_loader/efi_setup.c > > > > > b/lib/efi_loader/efi_setup.c > > > > > index 3c5cf9a435..98deb63777 100644 > > > > > --- a/lib/efi_loader/efi_setup.c > > > > > +++ b/lib/efi_loader/efi_setup.c > > > > > @@ -254,11 +254,12 @@ efi_status_t efi_init_obj_list(void) > > > > > if (ret !=3D EFI_SUCCESS) > > > > > goto out; > > > > > > > > > > -#if defined(CONFIG_LCD) || defined(CONFIG_DM_VIDEO) > > > > > - ret =3D efi_gop_register(); > > > > > - if (ret !=3D EFI_SUCCESS) > > > > > - goto out; > > > > > -#endif > > > > > + if (IS_ENABLED(CONFIG_EFI_GOP_PROTOCOL)) { > > > > > + ret =3D efi_gop_register(); > > > > > + if (ret !=3D EFI_SUCCESS) > > > > > + goto out; > > > > > + } > > > > > + > > > > > #ifdef CONFIG_NET > > > > > ret =3D efi_net_register(); > > > > > if (ret !=3D EFI_SUCCESS) > > > >