Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm: move DRM-related CONFIG options into DRM submenu

When you create a submenu using the 'menu' syntax, there is no
ambiguity about its end because the code between 'menu' and 'endmenu'
becomes the submenu.

In contrast, 'menuconfig' does not have the corresponding end marker.
Instead, the end of the submenu is inferred from symbol dependencies.

This is detailed in Documentation/kbuild/kconfig-language.rst, starting
line 348. It outlines two methods to place the code under the submenu:

(1) Open an if-block immediately after 'menuconfig', enclosing the
submenu content within it

(2) Add 'depends on' to every symbol intended for the submenu

Many subsystems opt for (1) because it reliably maintains the submenu
structure.

The DRM subsystem adopts (2). The submenu ends when the sequence of
'depends on DRM' breaks. It can be confirmed by running a GUI frontend
such as 'make menuconfig' and visiting the DRM menu:

< > Direct Rendering Manager (XFree86 4.1.0 and higher DRI support) ----

If you toggle this, you will notice most of the DRM-related options
appear below it, not in the submenu.

I highly recommend the approach (1). Obviously, (2) is not reliable,
as the submenu breaks whenever someone forgets to add 'depends on DRM'.

This commit encloses the entire DRM configuration with 'if DRM' and
'endif', except for DRM_PANEL_ORIENTATION_QUIRKS.

Note:
Now, 'depends on DRM' properties inside the if-block are all redundant.
I leave it as follow-up cleanups.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20240426135602.2500125-1-masahiroy@kernel.org
Signed-off-by: Maxime Ripard <mripard@kernel.org>

authored by

Masahiro Yamada and committed by
Maxime Ripard
08f44136 edc4e851

+8 -4
+8 -4
drivers/gpu/drm/Kconfig
··· 29 29 details. You should also select and configure AGP 30 30 (/dev/agpgart) support if it is available for your platform. 31 31 32 + if DRM 33 + 32 34 config DRM_MIPI_DBI 33 35 tristate 34 36 depends on DRM ··· 439 437 config DRM_EXPORT_FOR_TESTS 440 438 bool 441 439 442 - # Separate option because drm_panel_orientation_quirks.c is shared with fbdev 443 - config DRM_PANEL_ORIENTATION_QUIRKS 444 - tristate 445 - 446 440 config DRM_LIB_RANDOM 447 441 bool 448 442 default n ··· 459 461 this config option is disabled by default. 460 462 461 463 If in doubt, say N. 464 + 465 + endif 466 + 467 + # Separate option because drm_panel_orientation_quirks.c is shared with fbdev 468 + config DRM_PANEL_ORIENTATION_QUIRKS 469 + tristate