From nobody Thu Mar 16 08:20:07 2023 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PcgDg6bj1z3yY46 for ; Thu, 16 Mar 2023 08:20:19 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mx.blih.net (mx.blih.net [212.83.155.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mx.blih.net", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PcgDg061dz3wqj; Thu, 16 Mar 2023 08:20:18 +0000 (UTC) (envelope-from manu@bidouilliste.com) Authentication-Results: mx1.freebsd.org; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bidouilliste.com; s=mx; t=1678954810; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=J9pWK5IQyNFNShE81Gq4ebBLEJ1rMb3lIFNrfDlDAlU=; b=qyZkF4xV0jLJbwdCyXdhB5V9MuWEeG47m/6n6+qqo6gTDVUzTa+LzUhSuWLRfDNtLrW0uH wpi+g9lQIeAStA8DhSbSYeDQntrDiQS4KJ+KA3GjEXhO5BOQJ9KhlQCrUsnqw0TDpIhNOp g5o65XCNubejyLHWo7KmKYIfxiY/zgk= Received: from skull.home.blih.net (lfbn-lyo-1-2174-135.w90-66.abo.wanadoo.fr [90.66.97.135]) by mx.blih.net (OpenSMTPD) with ESMTPSA id 7c9ce258 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Thu, 16 Mar 2023 08:20:10 +0000 (UTC) Date: Thu, 16 Mar 2023 09:20:07 +0100 From: Emmanuel Vadot To: Gleb Popov Cc: Ed Maste , freebsd-hackers Subject: Re: splash(4) support in vt Message-Id: <20230316092007.6a2695e995f5e4c589140886@bidouilliste.com> In-Reply-To: References: X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; amd64-portbld-freebsd14.0) List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4PcgDg061dz3wqj X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:12876, ipnet:212.83.128.0/19, country:FR] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On Thu, 16 Mar 2023 09:26:30 +0300 Gleb Popov wrote: > On Wed, Mar 15, 2023 at 10:57?PM Ed Maste wrote: > > > > > > There are many individual tasks to be taken on; we need at least to > > get the image displayed earlier in the boot process, support more than > > just a 2-colour image, and support a user-provided (rather than > > compiled-in) image. We probably also need some animation support (e.g. > > a spinner). These tasks are all related but are mostly independent, so > > could be taken on in any order. What is your priority on these? >=20 > I think we'd need to start from getting more colors work. Our final > goal is a GIF-animated splash. >=20 > > > > The Wiki page linked from the mailing list posting is > > https://wiki.freebsd.org/MateuszPiotrowski/ImproveVtSplashScreenSupport, > > and it has a basic introduction. Looking at the source, the current > > logo is stored in sys/dev/vt/logo/logo_freebsd.c as a C array holding > > a 257x219 bitmap. If you look at vt_fb_bitblt_bitmap (and similar > > functions in other drivers) you can see that it loops over each pixel > > where the image will be drawn, and sets it to either the foreground or > > background color. >=20 > Which is the reason it only supports 2-color images, I presume? >=20 > Thanks for the links, I'll take a look! >=20 Hi Gleb, Thanks for being interested in this, a few notes on how I think it should be done below. First step is to handle more colors for the embeded logo, we only support a depth of 1 currently, see https://cgit.freebsd.org/src/tree/sys/dev/vt/vt_core.c#n1483 Second step should be to switch from a compiled-in logo to a file loaded from loader. The old sc(4) console support this (see splash_bmp_load/splash_pcx_load in loader.conf(5)). I don't think that the kernel should be aware of image format, instead loader(8) should be able to load an image and convert in to a blob of pixel to draw based on the framebuffer information (with EFI it's simple to know this). So I suggest adding a new type of module named 'splash_logo' of something like that that will hold the data, size and depth of the image. You can have a look at how this worked with sc(4) here : https://cgit.freebsd.org/src/tree/sys/dev/fb/splashreg.h Maybe this should also hold a screen position (probably in percentage). For animated logo adding a splash_spinner type is probably the best way. The problem will be to animate this, not sure that handling this in the kernel is the best way. I think that in Linux it's handled by plymouth and since it's start early in initrd it's easier for them to do it that way. But I think that you have enough work for now :) Cheers, --=20 Emmanuel Vadot