Skip to content

Commit a38884f

Browse files
committed
videomode: simplify videomode Kconfig and Makefile
This patch simplifies videomode related Kconfig and Makefile. After this patch, there's only one non-user selectable Kconfig option left, VIDEOMODE_HELPERS. The reasons for the change: * Videomode helper functions are not something that should be shown in the kernel configuration options. The related code should just be included if it's needed, i.e. selected by drivers using videomode. * There's no need to have separate Kconfig options for videomode and display_timing. First of all, the amount of code for both is quite small. Second, videomode depends on display_timing, and display_timing in itself is not really useful, so both would be included in any case. * CONFIG_VIDEOMODE is a bit vague name, and CONFIG_VIDEOMODE_HELPERS describes better what's included. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Cc: Steffen Trumtrar <s.trumtrar@pengutronix.de> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
1 parent f6161aa commit a38884f

5 files changed

Lines changed: 15 additions & 34 deletions

File tree

‎drivers/gpu/drm/drm_modes.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ drm_gtf_mode(struct drm_device *dev, int hdisplay, int vdisplay, int vrefresh,
506506
}
507507
EXPORT_SYMBOL(drm_gtf_mode);
508508

509-
#if IS_ENABLED(CONFIG_VIDEOMODE)
509+
#ifdef CONFIG_VIDEOMODE_HELPERS
510510
int drm_display_mode_from_videomode(const struct videomode *vm,
511511
struct drm_display_mode *dmode)
512512
{
@@ -540,9 +540,8 @@ int drm_display_mode_from_videomode(const struct videomode *vm,
540540
return 0;
541541
}
542542
EXPORT_SYMBOL_GPL(drm_display_mode_from_videomode);
543-
#endif
544543

545-
#if IS_ENABLED(CONFIG_OF_VIDEOMODE)
544+
#ifdef CONFIG_OF
546545
/**
547546
* of_get_drm_display_mode - get a drm_display_mode from devicetree
548547
* @np: device_node with the timing specification
@@ -572,7 +571,8 @@ int of_get_drm_display_mode(struct device_node *np,
572571
return 0;
573572
}
574573
EXPORT_SYMBOL_GPL(of_get_drm_display_mode);
575-
#endif
574+
#endif /* CONFIG_OF */
575+
#endif /* CONFIG_VIDEOMODE_HELPERS */
576576

577577
/**
578578
* drm_mode_set_name - set the name on a mode

‎drivers/gpu/drm/tilcdc/Kconfig‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ config DRM_TILCDC
44
select DRM_KMS_HELPER
55
select DRM_KMS_CMA_HELPER
66
select DRM_GEM_CMA_HELPER
7-
select OF_VIDEOMODE
8-
select OF_DISPLAY_TIMING
7+
select VIDEOMODE_HELPERS
98
select BACKLIGHT_CLASS_DEVICE
109
help
1110
Choose this option if you have an TI SoC with LCDC display

‎drivers/video/Kconfig‎

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -31,26 +31,8 @@ config VIDEO_OUTPUT_CONTROL
3131
This framework adds support for low-level control of the video
3232
output switch.
3333

34-
config DISPLAY_TIMING
35-
bool
36-
37-
config VIDEOMODE
38-
bool
39-
40-
config OF_DISPLAY_TIMING
41-
bool "Enable device tree display timing support"
42-
depends on OF
43-
select DISPLAY_TIMING
44-
help
45-
helper to parse display timings from the devicetree
46-
47-
config OF_VIDEOMODE
48-
bool "Enable device tree videomode support"
49-
depends on OF
50-
select VIDEOMODE
51-
select OF_DISPLAY_TIMING
52-
help
53-
helper to get videomodes from the devicetree
34+
config VIDEOMODE_HELPERS
35+
bool
5436

5537
config HDMI
5638
bool

‎drivers/video/Makefile‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ obj-$(CONFIG_FB_VIRTUAL) += vfb.o
171171

172172
#video output switch sysfs driver
173173
obj-$(CONFIG_VIDEO_OUTPUT_CONTROL) += output.o
174-
obj-$(CONFIG_DISPLAY_TIMING) += display_timing.o
175-
obj-$(CONFIG_OF_DISPLAY_TIMING) += of_display_timing.o
176-
obj-$(CONFIG_VIDEOMODE) += videomode.o
177-
obj-$(CONFIG_OF_VIDEOMODE) += of_videomode.o
174+
obj-$(CONFIG_VIDEOMODE_HELPERS) += display_timing.o videomode.o
175+
ifeq ($(CONFIG_OF),y)
176+
obj-$(CONFIG_VIDEOMODE_HELPERS) += of_display_timing.o of_videomode.o
177+
endif

‎drivers/video/fbmon.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1376,7 +1376,7 @@ int fb_get_mode(int flags, u32 val, struct fb_var_screeninfo *var, struct fb_inf
13761376
return err;
13771377
}
13781378

1379-
#if IS_ENABLED(CONFIG_VIDEOMODE)
1379+
#ifdef CONFIG_VIDEOMODE_HELPERS
13801380
int fb_videomode_from_videomode(const struct videomode *vm,
13811381
struct fb_videomode *fbmode)
13821382
{
@@ -1424,9 +1424,8 @@ int fb_videomode_from_videomode(const struct videomode *vm,
14241424
return 0;
14251425
}
14261426
EXPORT_SYMBOL_GPL(fb_videomode_from_videomode);
1427-
#endif
14281427

1429-
#if IS_ENABLED(CONFIG_OF_VIDEOMODE)
1428+
#ifdef CONFIG_OF
14301429
static inline void dump_fb_videomode(const struct fb_videomode *m)
14311430
{
14321431
pr_debug("fb_videomode = %ux%u@%uHz (%ukHz) %u %u %u %u %u %u %u %u %u\n",
@@ -1465,7 +1464,8 @@ int of_get_fb_videomode(struct device_node *np, struct fb_videomode *fb,
14651464
return 0;
14661465
}
14671466
EXPORT_SYMBOL_GPL(of_get_fb_videomode);
1468-
#endif
1467+
#endif /* CONFIG_OF */
1468+
#endif /* CONFIG_VIDEOMODE_HELPERS */
14691469

14701470
#else
14711471
int fb_parse_edid(unsigned char *edid, struct fb_var_screeninfo *var)

0 commit comments

Comments
 (0)