From patchwork Mon Sep 15 10:46:43 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 301 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1757933248; bh=Qite6YOki3f8ZX+dHFeCzW1Ar62vEfll/eXvqLyFPp8=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=I3nUGrFf9IihyADlqPFGJLa5EdzLYxHG5okgcAXLisafvp2HcTKiJPjh8FjerMu/g yg8R3x8S0UnueqtLAz4AqyJCDiFhKdPwGyGNJIK9FF4x4lCOPvQxS+kKfIwOqOOipJ Md6LzipPOt5NDxZF8NwG3/aXgOFJrJHNtUMxSgYUJ/l+JtIu2zpkzKYAX5B8G3rVy0 jmuoU1qtZuZxb0Ci+bXO9mfNyUEa1A7dYdYo68BEdrylFCVPpyqamcX5TSfu70NUUC 9kG0k4ZHPBfXMHLZxp9HSjJ2Mj/LhR+1Q+LjTCmWwHBuE1s6jV1dpdi05dFZzrrV7M 1DlyTZ72rgiKg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A15DC67B65 for ; Mon, 15 Sep 2025 04:47:28 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id vvEUfQOo9cjk for ; Mon, 15 Sep 2025 04:47:28 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1757933246; bh=Qite6YOki3f8ZX+dHFeCzW1Ar62vEfll/eXvqLyFPp8=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=RAoFnnue/aPJQxCk6l4i/5PJ2vsdNT3jccuxOQyrOMT6kkOcLOaSsxfiwwBYOcyxq Bm3Z0o4Ml/AO9vwDboopTb7VX/mF9tnbSTgsdE+atsfecJ6pE8CtRI0t+kiKDAJTm2 95DtM++7AHZoJHg0W1i39Vdb6Cg1NEW4r7MVbhT8nSRFqSADd7OYQfOHD4yjwbk/4I uLE906Dwkqyt7K/5Pzf26EazaW1ZyWv5fXFUS54Ouf9kVgO5sHjV9JXRfxmY4hS0Vv t4yYYW3/dsiGXkHjaPeSKSjsK31B5lokpdjUCSOi10jHBTwhRWu0nAON1NQo7Hucqo kDr0GBvWkHHeQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A780B67BB7 for ; Mon, 15 Sep 2025 04:47:26 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1757933243; bh=QK7StbXPbhH7ZCofaV77xXP4sx/0AzkE12vCxoAOGrE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HumhDzp8fLYipeZzZct/1wV101DzWab7cJoW/HO8Zoeej4cFih2hbCxZ4xHqqwuix TPGCjoeAJvfYtbc/Y5LbuJYyqPKKWC0W6cplBI+uLYuN7MHHyHVGgkhu9+hOLdm/lD kbO8a58jmGA5LEKdaz4qRD7j9z0QjmcOKxDMXQh+M1fYyLweA72KTbmNwf9Geux6CA tDrUkmDORFSY1ll71yWnZ2ny/r4nPLZvUCLOIpfX1fMhPZ2XksmNLqloxsEYVj0uRS dP61wzKqibUqyeTIpr+5CE/F8J/h1cxdYeHHPhQgt3UPF1OMZAcEXpfbHasaA1dGmh Y9rjWWlBIon+Q== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 267C65F92B; Mon, 15 Sep 2025 04:47:23 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id Oc6aTh5hLw2u; Mon, 15 Sep 2025 04:47:23 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1757933242; bh=hgqzAJyFZkNQk9QR1t2L7zyWDkGeZnWa7KbS0SjaXb4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SSmyiv0bD9f0mmwtIxteKX2FPHVEs0EmrIzvfuDyBe3uBFdtJN8o0oPbJt70rlrmz hR0b/aVRtpH+Sl+gH0xvg1kE35VIMjHC4qR5Ij/kXRnNNHPaQeYtZ3soUzmhAJliVP gO+euq8OgD7NZ1cJBHX2M+pAvYjI9fMuXx64Ep65S78O1unCZ9/iKj6EqPZHzNqWmW zy3H8ay8xa400m/xUfKEi8oN4wp/UmKpbInVinIU+Lp5BbsapDXeuHAqYiWbL7mdEw JWvFm7I/r4rRHyToMwJ/AjhPA9HH1aSyrcxrQubby2BBEtFND2NG1g1XUXOXtqNUKm mXB362AtMNNYQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 839B367A99; Mon, 15 Sep 2025 04:47:22 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Mon, 15 Sep 2025 04:46:43 -0600 Message-ID: <20250915104705.937780-3-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250915104705.937780-1-sjg@u-boot.org> References: <20250915104705.937780-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: NTPMIDYDOZC467DLAQNDZ3Z4FRQF3NCB X-Message-ID-Hash: NTPMIDYDOZC467DLAQNDZ3Z4FRQF3NCB X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 02/17] sandbox: Add a way to set the window title List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass 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 --- 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(-) diff --git a/arch/sandbox/cpu/sdl.c b/arch/sandbox/cpu/sdl.c index ed84646bdab..5a323a607f1 100644 --- a/arch/sandbox/cpu/sdl.c +++ b/arch/sandbox/cpu/sdl.c @@ -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) { diff --git a/arch/sandbox/cpu/start.c b/arch/sandbox/cpu/start.c index 556d1985ccc..43adc4cdb4f 100644 --- a/arch/sandbox/cpu/start.c +++ b/arch/sandbox/cpu/start.c @@ -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) { diff --git a/arch/sandbox/include/asm/state.h b/arch/sandbox/include/asm/state.h index 1c9f45d18eb..af92f4e6fcd 100644 --- a/arch/sandbox/include/asm/state.h +++ b/arch/sandbox/include/asm/state.h @@ -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 */