From patchwork Mon May 25 19:47:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anatolij Gustschin X-Patchwork-Id: 246518 List-Id: U-Boot discussion From: agust at denx.de (Anatolij Gustschin) Date: Mon, 25 May 2020 21:47:19 +0200 Subject: [PATCH] video: make vidconsole commands optional Message-ID: <20200525194719.926-1-agust@denx.de> Converting some boards to DM_VIDEO results in build breakage due to increased code size. Make video console specific commands optional to recude binary size. Signed-off-by: Anatolij Gustschin Reviewed-by: Simon Glass --- drivers/video/Kconfig | 8 ++++++++ drivers/video/vidconsole-uclass.c | 2 ++ 2 files changed, 10 insertions(+) diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig index 28c22fe525..eb5e26644a 100644 --- a/drivers/video/Kconfig +++ b/drivers/video/Kconfig @@ -35,6 +35,14 @@ config BACKLIGHT_GPIO it understands the standard device tree (leds/backlight/gpio-backlight.txt) +config CMD_VIDCONSOLE + bool "Enable vidconsole commands lcdputs and setcurs" + depends on DM_VIDEO + default y + help + Enabling this will provide 'setcurs' and 'lcdputs' commands which + support cursor positioning and drawing strings on video framebuffer. + config VIDEO_BPP8 bool "Support 8-bit-per-pixel displays" depends on DM_VIDEO diff --git a/drivers/video/vidconsole-uclass.c b/drivers/video/vidconsole-uclass.c index d30e6db6f6..901347c467 100644 --- a/drivers/video/vidconsole-uclass.c +++ b/drivers/video/vidconsole-uclass.c @@ -613,6 +613,7 @@ UCLASS_DRIVER(vidconsole) = { .per_device_auto_alloc_size = sizeof(struct vidconsole_priv), }; +#if CONFIG_IS_ENABLED(CMD_VIDCONSOLE) void vidconsole_position_cursor(struct udevice *dev, unsigned col, unsigned row) { struct vidconsole_priv *priv = dev_get_uclass_priv(dev); @@ -673,3 +674,4 @@ U_BOOT_CMD( "print string on video framebuffer", " " ); +#endif /* CONFIG_IS_ENABLED(CMD_VIDCONSOLE) */