From: Simon Glass <sjg@chromium.org>
Add a new option to set the window title for U-Boot sandbox. This is
helpful when different sandbox instances are used for different purposes
at the same time.
Signed-off-by: Simon Glass <sjg@chromium.org>
---
arch/sandbox/cpu/sdl.c | 3 ++-
arch/sandbox/cpu/start.c | 9 +++++++++
arch/sandbox/include/asm/state.h | 2 ++
3 files changed, 13 insertions(+), 1 deletion(-)
@@ -157,7 +157,8 @@ int sandbox_sdl_init_display(int width, int height, int log2_bpp,
log2_bpp = 5;
sdl.depth = 1 << log2_bpp;
sdl.pitch = sdl.width * sdl.depth / 8;
- sdl.screen = SDL_CreateWindow("U-Boot", SDL_WINDOWPOS_UNDEFINED,
+ sdl.screen = SDL_CreateWindow(state->window_title ? : "U-Boot",
+ SDL_WINDOWPOS_UNDEFINED,
SDL_WINDOWPOS_UNDEFINED, sdl.vis_width,
sdl.vis_height, SDL_WINDOW_RESIZABLE);
if (!sdl.screen) {
@@ -187,6 +187,15 @@ static int sandbox_cmdline_cb_fdt(struct sandbox_state *state, const char *arg)
}
SANDBOX_CMDLINE_OPT_SHORT(fdt, 'd', 1, "Specify U-Boot's control FDT");
+static int sandbox_cmdline_cb_title(struct sandbox_state *state,
+ const char *arg)
+{
+ state->window_title = arg;
+
+ return 0;
+}
+SANDBOX_CMDLINE_OPT_SHORT(title, 'W', 1, "Set the window title to display");
+
static int sandbox_cmdline_cb_default_fdt(struct sandbox_state *state,
const char *arg)
{
@@ -189,6 +189,8 @@ struct sandbox_state {
struct list_head mapmem_head; /* struct sandbox_mapmem_entry */
bool hwspinlock; /* Hardware Spinlock status */
bool allow_memio; /* Allow readl() etc. to work */
+ /* Title to use for LCD window, NULL for default */
+ const char *window_title;
void *other_fdt_buf; /* 'other' FDT blob used by tests */
int other_size; /* size of other FDT blob */