Skip to content

Commit 08f4413

Browse files
masahir0ymripard
authored andcommitted
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 <[email protected]> Acked-by: Arnd Bergmann <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Maxime Ripard <[email protected]>
1 parent edc4e85 commit 08f4413

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

drivers/gpu/drm/Kconfig

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ menuconfig DRM
2929
details. You should also select and configure AGP
3030
(/dev/agpgart) support if it is available for your platform.
3131

32+
if DRM
33+
3234
config DRM_MIPI_DBI
3335
tristate
3436
depends on DRM
@@ -437,10 +439,6 @@ config DRM_HYPERV
437439
config DRM_EXPORT_FOR_TESTS
438440
bool
439441

440-
# Separate option because drm_panel_orientation_quirks.c is shared with fbdev
441-
config DRM_PANEL_ORIENTATION_QUIRKS
442-
tristate
443-
444442
config DRM_LIB_RANDOM
445443
bool
446444
default n
@@ -461,3 +459,9 @@ config DRM_WERROR
461459
this config option is disabled by default.
462460

463461
If in doubt, say N.
462+
463+
endif
464+
465+
# Separate option because drm_panel_orientation_quirks.c is shared with fbdev
466+
config DRM_PANEL_ORIENTATION_QUIRKS
467+
tristate

0 commit comments

Comments
 (0)