Re: [PATCH v8 04/10] video console: implement multiple fonts configuration

Anatolij Gustschin
2023-03-07T15:22:29Z

On Tue, 7 Mar 2023 13:21:14 +0300
Dzmitry Sankouski dsankouski@gmail.com wrote:
...
> @@ -138,13 +139,15 @@ void splash_display_banner(void)
> if (ret)
> return;
>
> -#ifdef CONFIG_VIDEO_LOGO
> - col = BMP_LOGO_WIDTH / VIDEO_FONT_WIDTH + 1;
> - row = BMP_LOGO_HEIGHT / VIDEO_FONT_HEIGHT + 1;
> -#else
> - col = 0;
> - row = 0;
> -#endif
> + if (IS_ENABLED(CONFIG_VIDEO_LOGO)) {
> + struct video_fontdata *fontdata = fonts;
> +
> + col = BMP_LOGO_WIDTH / fontdata->width + 1;
> + row = BMP_LOGO_HEIGHT / fontdata->height + 1;
> + } else {
> + col = 0;
> + row = 0;
> + }

there was another build error for boards with CONFIG_VIDEO_LOGO
disabled:

https://source.denx.de/u-boot/custodians/u-boot-video/-/jobs/589501#L1430

I changed this to

void splash_display_banner(void)
{
+ struct video_fontdata __maybe_unused *fontdata = fonts;
struct udevice *dev;
char buf[DISPLAY_OPTIONS_BANNER_LENGTH];
int col, row, ret;
@@ -138,9 +140,9 @@ void splash_display_banner(void)
if (ret)
return;

-#ifdef CONFIG_VIDEO_LOGO
- col = BMP_LOGO_WIDTH / VIDEO_FONT_WIDTH + 1;
- row = BMP_LOGO_HEIGHT / VIDEO_FONT_HEIGHT + 1;
+#if IS_ENABLED(CONFIG_VIDEO_LOGO)
+ col = BMP_LOGO_WIDTH / fontdata->width + 1;
+ row = BMP_LOGO_HEIGHT / fontdata->height + 1;
#else
col = 0;
row = 0;

--
Anatolij