linux-riscv.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Zimmermann <tzimmermann@suse.de>
To: Arnd Bergmann <arnd@arndb.de>, Helge Deller <deller@gmx.de>,
	Daniel Vetter <daniel@ffwll.ch>, Dave Airlie <airlied@gmail.com>
Cc: linux-hyperv@vger.kernel.org, linux-efi@vger.kernel.org,
	linux-ia64@vger.kernel.org, linux-sh@vger.kernel.org,
	Peter Zijlstra <peterz@infradead.org>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org,
	linux-mips@vger.kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
	sparclinux@vger.kernel.org, linux-riscv@lists.infradead.org,
	Ard Biesheuvel <ardb@kernel.org>,
	Linux-Arch <linux-arch@vger.kernel.org>,
	linux-hexagon@vger.kernel.org, linux-staging@lists.linux.dev,
	"linux-csky@vger.kernel.org" <linux-csky@vger.kernel.org>,
	Ingo Molnar <mingo@redhat.com>,
	Sami Tolvanen <samitolvanen@google.com>,
	Kees Cook <keescook@chromium.org>,
	"Paul E. McKenney" <paulmck@kernel.org>,
	Frederic Weisbecker <frederic@kernel.org>,
	Nicholas Piggin <npiggin@gmail.com>,
	Borislav Petkov <bp@alien8.de>,
	loongarch@lists.linux.dev, Thomas Gleixner <tglx@linutronix.de>,
	linux-arm-kernel@lists.infradead.org, x86@kernel.org,
	linux-kernel@vger.kernel.org,
	Juerg Haefliger <juerg.haefliger@canonical.com>,
	linux-alpha@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>,
	linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH 07/12] arch/x86: Declare edid_info in <asm/screen_info.h>
Date: Wed, 5 Jul 2023 10:18:18 +0200	[thread overview]
Message-ID: <150c0fa2-bff2-0644-d6e5-c4dab7f79048@suse.de> (raw)
In-Reply-To: <dd5aa01e-afad-48d2-bf4c-4a58b74f1644@app.fastmail.com>


[-- Attachment #1.1.1: Type: text/plain, Size: 4223 bytes --]

Hi Arnd

Am 30.06.23 um 13:53 schrieb Arnd Bergmann:
> On Fri, Jun 30, 2023, at 09:46, Thomas Zimmermann wrote:
>> Am 29.06.23 um 15:21 schrieb Arnd Bergmann:
>>> On Thu, Jun 29, 2023, at 15:01, Thomas Zimmermann wrote:
>>>> Am 29.06.23 um 14:35 schrieb Arnd Bergmann:
>>>>> On Thu, Jun 29, 2023, at 13:45, Thomas Zimmermann wrote:
>>
>>>>
>>>> FIRMWARE_EDID is a user-selectable feature, while ARCH_HAS_EDID_INFO
>>>> announces an architecture feature. They do different things.
>>>
>>> I still have trouble seeing the difference.
>>
>> The idea here is that ARCH_HAS_ signals the architecture's support for
>> the feature.  Drivers set 'depends on' in their Kconfig.
>>
>> Another Kconfig token, VIDEO_SCREEN_INFO or FIRMWARE_EDID, would then
>> actually enable the feature.  Drivers select VIDEO_SCREEN_INFO or
>> FIRMWARE_EDID and the architectures contains code like
> 
> Fair enough. In that case, I guess FIRMWARE_EDID will just depend on
> ARCH_HAS_EDID_INFO, or possibly "depends on FIRMWARE_EDID || EFI"
> after it starts calling into an EFI specific function, right?
> 
>> #ifdef VIDEO_SCREEN_INFO
>> struct screen_info screen_info = {
>> 	/* set values here */
>> }
>> #endif
>>
>> This allows us to disable code that requires screen_info/edid_info, but
>> also disable screen_info/edid_info unless such code has been enabled in
>> the kernel config.
>>
>> Some architectures currently mimic this by guarding screen_info with
>> ifdef CONFIG_VT or similar. I'd like to make this more flexible. The
>> cost of a few more internal Kconfig tokens seems negligible.
> 
> I definitely get it for the screen_info, which needs the complexity.
> For ARCHARCH_HAS_EDID_INFO I would hope that it's never selected by
> anything other than x86, so I would still go with just a dependency
> on x86 for simplicity, but I don't mind having the extra symbol if that
> keeps it more consistent with how the screen_info is handled.

Well, I'd like to add edid_info to platforms with EFI. What would be 
arm/arm64 and loongarch, I guess. See below for the future plans.

> 
>>> I suppose you could use FIRMWARE_EDID on EFI or OF systems without
>>> the need for a global edid_info structure, but that would not
>>> share any code with the current fb_firmware_edid() function.
>>
>> The current code is build on top of screen_info and edid_info. I'd
>> preferably not replace that, if possible.
> 
> One way I could imagine this looking in the end would be
> something like
> 
> struct screen_info *fb_screen_info(struct device *dev)
> {
>        struct screen_info *si = NULL;
> 
>        if (IS_ENABLED(CONFIG_EFI))
>              si = efi_get_screen_info(dev);
> 
>        if (IS_ENABLED(CONFIG_ARCH_HAS_SCREEN_INFO) && !si)
>              si = screen_info;
> 
>        return si;
> }
> 
> corresponding to fb_firmware_edid(). With this, any driver
> that wants to access screen_info would call this function
> instead of using the global pointer, plus either NULL pointer
> check or a CONFIG_ARCH_HAS_SCREEN_INFO dependency.
> 
> This way we could completely eliminate the global screen_info
> on arm64, riscv, and loongarch but still use the efi and
> hyperv framebuffer/drm drivers.

If possible, I'd like to remove global screen_info and edid_info 
entirely from fbdev and the various consoles.

We currently use screen_info to set up the generic framebuffer device in 
drivers/firmware/sysfb.c. I'd like to use edid_info here as well, so 
that the generic graphics drivers can get EDID information.

For the few fbdev drivers and consoles that require the global 
screen_info/edid_info, I'd rather provide lookup functions in sysfb 
(e.g., sysfb_get_screen_info(), sysfb_get_edid_info()). The global 
screen_info/edid_info state would then become an internal artifact of 
the sysfb code.

Hopefully that explains some of the decisions made in this patchset.

Best regards
Thomas

> 
>      Arnd

-- 
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)

[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

[-- Attachment #2: Type: text/plain, Size: 161 bytes --]

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

  reply	other threads:[~2023-07-05  8:18 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-29 11:45 [PATCH 00/12] arch,fbdev: Move screen_info into arch/ Thomas Zimmermann
2023-06-29 11:45 ` [PATCH 01/12] efi: Do not include <linux/screen_info.h> from EFI header Thomas Zimmermann
2023-07-04 16:23   ` Javier Martinez Canillas
2023-07-05  1:40   ` [01/12] " Sui Jingfeng
2023-07-05  8:00     ` Thomas Zimmermann
2023-06-29 11:45 ` [PATCH 02/12] fbdev/sm712fb: Do not include <linux/screen_info.h> Thomas Zimmermann
2023-07-04 16:25   ` Javier Martinez Canillas
2023-06-29 11:45 ` [PATCH 03/12] sysfb: Do not include <linux/screen_info.h> from sysfb header Thomas Zimmermann
2023-07-04 16:26   ` Javier Martinez Canillas
2023-07-05  1:41   ` [03/12] " Sui Jingfeng
2023-06-29 11:45 ` [PATCH 04/12] staging/sm750fb: Do not include <linux/screen_info.h> Thomas Zimmermann
2023-07-04 16:27   ` Javier Martinez Canillas
2023-06-29 11:45 ` [PATCH 05/12] arch: Remove trailing whitespaces Thomas Zimmermann
2023-07-04 16:27   ` Javier Martinez Canillas
2023-07-05  1:25   ` [05/12] " Sui Jingfeng
2023-06-29 11:45 ` [PATCH 06/12] arch: Declare screen_info in <asm/screen_info.h> Thomas Zimmermann
2023-06-29 12:55   ` WANG Xuerui
2023-06-29 13:03   ` Arnd Bergmann
2023-06-29 13:18     ` Thomas Zimmermann
2023-07-05  1:21   ` [06/12] " Sui Jingfeng
2023-07-05  8:02     ` Thomas Zimmermann
2023-08-18 14:04   ` suijingfeng
2023-08-18 14:18     ` suijingfeng
2023-06-29 11:45 ` [PATCH 07/12] arch/x86: Declare edid_info " Thomas Zimmermann
2023-06-29 12:35   ` Arnd Bergmann
2023-06-29 13:01     ` Thomas Zimmermann
2023-06-29 13:21       ` Arnd Bergmann
2023-06-30  7:46         ` Thomas Zimmermann
2023-06-30 11:53           ` Arnd Bergmann
2023-07-05  8:18             ` Thomas Zimmermann [this message]
2023-07-18 14:47               ` Arnd Bergmann
2023-06-29 11:45 ` [PATCH 08/12] drivers/firmware: Remove trailing whitespaces Thomas Zimmermann
2023-07-05  1:26   ` [08/12] " Sui Jingfeng
2023-07-05  7:46   ` [PATCH 08/12] " Javier Martinez Canillas
2023-06-29 11:45 ` [PATCH 09/12] drivers: Add dependencies on CONFIG_ARCH_HAS_SCREEN_INFO Thomas Zimmermann
2023-06-29 11:45 ` [PATCH 10/12] fbdev/core: Use fb_is_primary_device() in fb_firmware_edid() Thomas Zimmermann
2023-07-05  8:02   ` Javier Martinez Canillas
2023-06-29 11:45 ` [PATCH 11/12] fbdev/core: Protect edid_info with CONFIG_ARCH_HAS_EDID_INFO Thomas Zimmermann
2023-07-05  1:43   ` [11/12] " Sui Jingfeng
2023-06-29 11:45 ` [PATCH 12/12] fbdev/core: Define empty fb_firmware_edid() in <linux/fb.h> Thomas Zimmermann
2023-06-29 13:31 ` [PATCH 00/12] arch,fbdev: Move screen_info into arch/ Arnd Bergmann
2023-06-29 14:15   ` Thomas Zimmermann
2023-06-29 14:42     ` Arnd Bergmann
2023-06-29 14:29   ` Arnd Bergmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=150c0fa2-bff2-0644-d6e5-c4dab7f79048@suse.de \
    --to=tzimmermann@suse.de \
    --cc=airlied@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=ardb@kernel.org \
    --cc=arnd@arndb.de \
    --cc=bp@alien8.de \
    --cc=daniel@ffwll.ch \
    --cc=dave.hansen@linux.intel.com \
    --cc=deller@gmx.de \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=frederic@kernel.org \
    --cc=hpa@zytor.com \
    --cc=juerg.haefliger@canonical.com \
    --cc=keescook@chromium.org \
    --cc=linux-alpha@vger.kernel.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-csky@vger.kernel.org \
    --cc=linux-efi@vger.kernel.org \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-hexagon@vger.kernel.org \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-ia64@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=loongarch@lists.linux.dev \
    --cc=mingo@redhat.com \
    --cc=npiggin@gmail.com \
    --cc=paulmck@kernel.org \
    --cc=peterz@infradead.org \
    --cc=samitolvanen@google.com \
    --cc=sparclinux@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).