Skip to content

Commit 53c515b

Browse files
committed
lk2nd: display: simplefb: Actually allow options to work when cont-splash is enabled
When initially guarded for non-cont-splash uses, the WITH_ macro was used but cont-splash is hard include and not a module so it just disabled options for everyone. Fix this by explicitly defining a flag to detect cont-splash.
1 parent 27bde43 commit 53c515b

File tree

2 files changed

+19
-19
lines changed

2 files changed

+19
-19
lines changed

lk2nd/display/rules.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ OBJS += \
66

77
ifeq ($(LK2ND_DISPLAY), cont-splash)
88
include $(LOCAL_DIR)/cont-splash/rules.mk
9+
DEFINES += LK2ND_DISPLAY_CONT_SPLASH=1
910
else ifneq ($(LK2ND_DISPLAY),)
1011
DEFINES += LK2ND_DISPLAY=$(LK2ND_DISPLAY)
1112
include $(LOCAL_DIR)/panel/rules.mk

lk2nd/display/simplefb.c

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// SPDX-License-Identifier: BSD-3-Clause
22
/* Copyright (c) 2023, Nikita Travkin <[email protected]> */
33

4+
#include <config.h>
45
#include <stdlib.h>
56
#include <string.h>
67
#include <dev/fbcon.h>
@@ -28,9 +29,7 @@ static int lk2nd_simplefb_dt_update(void *dtb, const char *cmdline,
2829
int ret, resmem_offset, chosen_offset, offset;
2930
uint32_t mem_ph, fb_size;
3031
char tmp[32], args[16];
31-
#if WITH_LK2ND_DISPLAY_CONT_SPLASH
3232
void *rel_base;
33-
#endif
3433

3534
if (!fb)
3635
return 0;
@@ -41,26 +40,26 @@ static int lk2nd_simplefb_dt_update(void *dtb, const char *cmdline,
4140
if (!lk2nd_cmdline_scan_arg(cmdline, "lk2nd.pass-simplefb", args, sizeof(args)))
4241
return 0;
4342

44-
#if WITH_LK2ND_DISPLAY_CONT_SPLASH
45-
if (!strcmp(args, "autorefresh")) {
46-
dprintf(INFO, "simplefb: Enabling autorefresh\n");
47-
mdp_enable_autorefresh(fb);
48-
}
43+
if (IS_ENABLED(LK2ND_DISPLAY_CONT_SPLASH)) {
44+
if (!strcmp(args, "autorefresh")) {
45+
dprintf(INFO, "simplefb: Enabling autorefresh\n");
46+
mdp_enable_autorefresh(fb);
47+
}
4948

50-
if (strstr(args, "relocate")) {
51-
rel_base = target_get_scratch_address()
52-
+ target_get_max_flash_size()
53-
- (10 * 1024 * 1024); /* 8MiB~=fhd 32bpp, +512k ramoops at the end. */
49+
if (strstr(args, "relocate")) {
50+
rel_base = target_get_scratch_address()
51+
+ target_get_max_flash_size()
52+
- (10 * 1024 * 1024); /* 8MiB~=fhd 32bpp, +512k ramoops at the end. */
5453

55-
dprintf(INFO, "simplefb: Framebuffer will be relocated to 0x%x\n", (uint32_t)rel_base);
56-
mdp_relocate(fb, rel_base);
57-
}
54+
dprintf(INFO, "simplefb: Framebuffer will be relocated to 0x%x\n", (uint32_t)rel_base);
55+
mdp_relocate(fb, rel_base);
56+
}
5857

59-
if (strstr(args, "rgb565"))
60-
mdp_set_rgb565(fb);
61-
else if (strstr(args, "xrgb8888"))
62-
mdp_set_xrgb8888(fb);
63-
#endif
58+
if (strstr(args, "rgb565"))
59+
mdp_set_rgb565(fb);
60+
else if (strstr(args, "xrgb8888"))
61+
mdp_set_xrgb8888(fb);
62+
}
6463

6564
fb_size = fb->stride * fb->bpp/8 * fb->height;
6665

0 commit comments

Comments
 (0)