Thread (44 messages) flat view 44 messages, 5 authors, 2023-08-18

Re: [PATCH 07/12] arch/x86: Declare edid_info in <asm/screen_info.h>

From: Thomas Zimmermann <tzimmermann@suse.de>
Date: 2023-06-30 07:46:42
Also in: dri-devel, linux-alpha, linux-arch, linux-arm-kernel, linux-efi, linux-hyperv, linux-mips, linux-riscv, linux-sh, linux-staging, linuxppc-dev, lkml, loongarch, sparclinux

Hi

Am 29.06.23 um 15:21 schrieb Arnd Bergmann:
On Thu, Jun 29, 2023, at 15:01, Thomas Zimmermann wrote:
quoted
Am 29.06.23 um 14:35 schrieb Arnd Bergmann:
quoted
On Thu, Jun 29, 2023, at 13:45, Thomas Zimmermann wrote:
quoted
The global variable edid_info contains the firmware's EDID information
as an extension to the regular screen_info on x86. Therefore move it to
<asm/screen_info.h>.

Add the Kconfig token ARCH_HAS_EDID_INFO to guard against access on
architectures that don't provide edid_info. Select it on x86.
I'm not sure we need another symbol in addition to
CONFIG_FIRMWARE_EDID. Since all the code behind that
existing symbol is also x86 specific, would it be enough
to just add either 'depends on X86' or 'depends on X86 ||
COMPILE_TEST' there?
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

#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.
quoted
Right now, ARCH_HAS_EDID_INFO only works on the old BIOS-based VESA
systems. In the future, I want to add support for EDID data from EFI and
OF as well. It would be stored in edid_info. I assume that the new
symbol will become useful then.
I don't see why an OF based system would have the same limitation
as legacy BIOS with supporting only a single monitor, if we need
to have a generic representation of EDID data in DT, that would
probably be in a per device property anyway.
Sorry that was my mistake. OF has nothing to do with this.
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.

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)

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help