X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=common%2Flcd.c;h=f8bc1ceba74a62ce154d5acc213f29db856faa12;hb=e551ee2deac2f63bc5f84ea0dc3ad3a3b74a107f;hp=51705adeaf79918bce59a374a3319c6cb98a3cce;hpb=9e4de7fd4acc8f99b6d383c711d21c0159849629;p=oweals%2Fu-boot.git diff --git a/common/lcd.c b/common/lcd.c index 51705adeaf..f8bc1ceba7 100644 --- a/common/lcd.c +++ b/common/lcd.c @@ -1,16 +1,16 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * Common LCD routines * * (C) Copyright 2001-2002 * Wolfgang Denk, DENX Software Engineering -- wd@denx.de - * - * SPDX-License-Identifier: GPL-2.0+ */ /* #define DEBUG */ #include #include #include +#include #include #include #include @@ -62,12 +62,12 @@ void lcd_sync(void) * architectures do not actually implement it. Is there a way to find * out whether it exists? For now, ARM is safe. */ -#if defined(CONFIG_ARM) && !defined(CONFIG_SYS_DCACHE_OFF) +#if defined(CONFIG_ARM) && !CONFIG_IS_ENABLED(SYS_DCACHE_OFF) int line_length; if (lcd_flush_dcache) - flush_dcache_range((u32)lcd_base, - (u32)(lcd_base + lcd_get_size(&line_length))); + flush_dcache_range((ulong)lcd_base, + (ulong)(lcd_base + lcd_get_size(&line_length))); #endif } @@ -172,8 +172,7 @@ int drv_lcd_init(void) void lcd_clear(void) { int bg_color; - char *s; - ulong addr; + __maybe_unused ulong addr; static int do_splash = 1; #if LCD_BPP == LCD_COLOR8 /* Setting the palette */ @@ -223,14 +222,10 @@ void lcd_clear(void) /* Paint the logo and retrieve LCD base address */ debug("[LCD] Drawing the logo...\n"); if (do_splash) { - s = getenv("splashimage"); - if (s) { + if (splash_display() == 0) { do_splash = 0; - addr = simple_strtoul(s, NULL, 16); - if (lcd_splash(addr) == 0) { - lcd_sync(); - return; - } + lcd_sync(); + return; } } @@ -243,14 +238,6 @@ void lcd_clear(void) lcd_sync(); } -static int do_lcd_clear(cmd_tbl_t *cmdtp, int flag, int argc, - char *const argv[]) -{ - lcd_clear(); - return 0; -} -U_BOOT_CMD(cls, 1, 1, do_lcd_clear, "clear screen", ""); - static int lcd_init(void *lcdbase) { debug("[LCD] Initializing LCD frambuffer at %p\n", lcdbase); @@ -390,7 +377,6 @@ static inline void lcd_logo_plot(int x, int y) {} #if defined(CONFIG_CMD_BMP) || defined(CONFIG_SPLASH_SCREEN) #ifdef CONFIG_SPLASH_SCREEN_ALIGN -#define BMP_ALIGN_CENTER 0x7FFF static void splash_align_axis(int *axis, unsigned long panel_size, unsigned long picture_size) @@ -562,11 +548,7 @@ __weak void lcd_set_cmap(struct bmp_image *bmp, unsigned colors) *cmap = (((cte.red) << 8) & 0xf800) | (((cte.green) << 3) & 0x07e0) | (((cte.blue) >> 3) & 0x001f); -#if defined(CONFIG_MPC823) - cmap--; -#else cmap++; -#endif } } @@ -582,7 +564,7 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y) unsigned long pwidth = panel_info.vl_col; unsigned colors, bpix, bmp_bpix; int hdr_size; - struct bmp_color_table_entry *palette = bmp->color_table; + struct bmp_color_table_entry *palette; if (!bmp || !(bmp->header.signature[0] == 'B' && bmp->header.signature[1] == 'M')) { @@ -591,6 +573,7 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y) return 1; } + palette = bmp->color_table; width = get_unaligned_le32(&bmp->header.width); height = get_unaligned_le32(&bmp->header.height); bmp_bpix = get_unaligned_le16(&bmp->header.bit_count); @@ -704,7 +687,7 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y) } break; #endif /* CONFIG_BMP_16BPP */ -#if defined(CONFIG_BMP_24BMP) +#if defined(CONFIG_BMP_24BPP) case 24: for (i = 0; i < height; ++i) { for (j = 0; j < width; j++) { @@ -716,7 +699,7 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y) fb -= lcd_line_length + width * (bpix / 8); } break; -#endif /* CONFIG_BMP_24BMP */ +#endif /* CONFIG_BMP_24BPP */ #if defined(CONFIG_BMP_32BPP) case 32: for (i = 0; i < height; ++i) {