linux-riscv.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Zimmermann <tzimmermann@suse.de>
To: arnd@arndb.de, deller@gmx.de, daniel@ffwll.ch, airlied@gmail.com
Cc: linux-kernel@vger.kernel.org, linux-alpha@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, linux-efi@vger.kernel.org,
	linux-csky@vger.kernel.org, linux-hexagon@vger.kernel.org,
	linux-ia64@vger.kernel.org, loongarch@lists.linux.dev,
	linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
	linux-riscv@lists.infradead.org, linux-sh@vger.kernel.org,
	sparclinux@vger.kernel.org, dri-devel@lists.freedesktop.org,
	linux-hyperv@vger.kernel.org, linux-fbdev@vger.kernel.org,
	linux-staging@lists.linux.dev, linux-arch@vger.kernel.org,
	Thomas Zimmermann <tzimmermann@suse.de>
Subject: [PATCH 00/12] arch,fbdev: Move screen_info into arch/
Date: Thu, 29 Jun 2023 13:45:39 +0200	[thread overview]
Message-ID: <20230629121952.10559-1-tzimmermann@suse.de> (raw)

The variables screen_info and edid_info provide information about
the system's screen, and possibly EDID data of the connected display.
Both are defined and set by architecture code. But both variables are
declared in non-arch header files. Dependencies are at bease loosely
tracked. To resolve this, move the global state screen_info and its
companion edid_info into arch/. Only declare them on architectures
that define them. List dependencies on the variables in the Kconfig
files. Also clean up the callers.

Patch 1 to 4 resolve a number of unnecessary include statements of
<linux/screen_info.h>. The header should only be included in source
files that access struct screen_info.

Patches 5 to 7 move the declaration of screen_info and edid_info to
<asm-generic/screen_info.h>. Architectures that provide either set
a Kconfig token to enable them.

Patches 8 to 9 make users of screen_info depend on the architecture's
feature.

Finally, patches 10 to 12 rework fbdev's handling of firmware EDID
data to make use of existing helpers and the refactored edid_info.

Tested on x86-64. Built for a variety of platforms.

Future directions: with the patchset in place, it will become possible
to provide screen_info and edid_info only if there are users. Some
architectures do this by testing for CONFIG_VT, CONFIG_DUMMY_CONSOLE,
etc. A more uniform approach would be nice. We should also attempt
to minimize access to the global screen_info as much as possible. To
do so, some drivers, such as efifb and vesafb, would require an update.
The firmware's EDID data could possibly made available outside of fbdev.
For example, the simpledrm and ofdrm drivers could provide such data
to userspace compositors.

Thomas Zimmermann (12):
  efi: Do not include <linux/screen_info.h> from EFI header
  fbdev/sm712fb: Do not include <linux/screen_info.h>
  sysfb: Do not include <linux/screen_info.h> from sysfb header
  staging/sm750fb: Do not include <linux/screen_info.h>
  arch: Remove trailing whitespaces
  arch: Declare screen_info in <asm/screen_info.h>
  arch/x86: Declare edid_info in <asm/screen_info.h>
  drivers/firmware: Remove trailing whitespaces
  drivers: Add dependencies on CONFIG_ARCH_HAS_SCREEN_INFO
  fbdev/core: Use fb_is_primary_device() in fb_firmware_edid()
  fbdev/core: Protect edid_info with CONFIG_ARCH_HAS_EDID_INFO
  fbdev/core: Define empty fb_firmware_edid() in <linux/fb.h>

 arch/Kconfig                                  | 12 +++++++
 arch/alpha/Kconfig                            |  1 +
 arch/arm/Kconfig                              |  1 +
 arch/arm/kernel/efi.c                         |  2 ++
 arch/arm64/Kconfig                            |  1 +
 arch/arm64/kernel/efi.c                       |  1 +
 arch/csky/Kconfig                             |  1 +
 arch/hexagon/Kconfig                          |  1 +
 arch/ia64/Kconfig                             |  5 +--
 arch/loongarch/Kconfig                        |  1 +
 arch/mips/Kconfig                             |  1 +
 arch/nios2/Kconfig                            |  1 +
 arch/powerpc/Kconfig                          |  1 +
 arch/riscv/Kconfig                            |  1 +
 arch/sh/Kconfig                               |  7 ++--
 arch/sparc/Kconfig                            |  1 +
 arch/x86/Kconfig                              |  2 ++
 arch/xtensa/Kconfig                           |  1 +
 drivers/firmware/Kconfig                      |  3 +-
 drivers/firmware/efi/Kconfig                  |  1 +
 drivers/firmware/efi/libstub/efi-stub-entry.c |  2 ++
 drivers/firmware/efi/libstub/screen_info.c    |  2 ++
 drivers/gpu/drm/Kconfig                       |  1 +
 drivers/hv/Kconfig                            |  1 +
 drivers/staging/sm750fb/sm750.c               |  1 -
 drivers/staging/sm750fb/sm750_accel.c         |  1 -
 drivers/staging/sm750fb/sm750_cursor.c        |  1 -
 drivers/staging/sm750fb/sm750_hw.c            |  1 -
 drivers/video/console/Kconfig                 |  2 ++
 drivers/video/fbdev/Kconfig                   |  4 +++
 drivers/video/fbdev/core/fbmon.c              | 34 ++++++-------------
 drivers/video/fbdev/i810/i810-i2c.c           |  2 +-
 drivers/video/fbdev/intelfb/intelfbdrv.c      |  2 +-
 drivers/video/fbdev/nvidia/nv_i2c.c           |  2 +-
 drivers/video/fbdev/savage/savagefb-i2c.c     |  2 +-
 drivers/video/fbdev/sm712fb.c                 |  9 +++--
 include/asm-generic/Kbuild                    |  1 +
 include/asm-generic/screen_info.h             | 18 ++++++++++
 include/linux/efi.h                           |  3 +-
 include/linux/fb.h                            | 10 +++++-
 include/linux/screen_info.h                   |  2 +-
 include/linux/sysfb.h                         |  3 +-
 include/video/edid.h                          |  3 --
 43 files changed, 105 insertions(+), 47 deletions(-)
 create mode 100644 include/asm-generic/screen_info.h


base-commit: d2f0af8472494398a42153684b790b723a79f143
-- 
2.41.0


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

             reply	other threads:[~2023-06-29 12:20 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-29 11:45 Thomas Zimmermann [this message]
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
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=20230629121952.10559-1-tzimmermann@suse.de \
    --to=tzimmermann@suse.de \
    --cc=airlied@gmail.com \
    --cc=arnd@arndb.de \
    --cc=daniel@ffwll.ch \
    --cc=deller@gmx.de \
    --cc=dri-devel@lists.freedesktop.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=sparclinux@vger.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).