From nobody Tue Jul 09 13:28:44 2024 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 4WJMKQ0p2Rz5QPNq for ; Tue, 09 Jul 2024 13:29:30 +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 did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4WJMKL5Llgz4Hv5; Tue, 9 Jul 2024 13:29:26 +0000 (UTC) (envelope-from manu@bidouilliste.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bidouilliste.com header.s=mx header.b=GxySl2z1; dmarc=pass (policy=none) header.from=bidouilliste.com; spf=pass (mx1.freebsd.org: domain of manu@bidouilliste.com designates 212.83.155.74 as permitted sender) smtp.mailfrom=manu@bidouilliste.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bidouilliste.com; s=mx; t=1720531758; 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=8pAh5rRebeXtLmpQN/xhuMtKQUjhYCL7RIKipqGDtSM=; b=GxySl2z1Vh66yAyyKdpWOmkmQgiuZFl1gLTCr0XO4gvODLLDLylVn3q0tjkqyp6IdIA2TY LVwWG+A+bvepW6O7InBnHGoNAc2OFqDtLRckQdQmRwEbjT2xPjdxxHV19XVRB0WtH+caNI S+i5LB4dOHyP6dSG9cs/BvekAm9JBeo= 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 617405f2 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Tue, 9 Jul 2024 13:29:18 +0000 (UTC) Date: Tue, 9 Jul 2024 15:28:44 +0200 From: Emmanuel Vadot To: Emmanuel Vadot Cc: Gleb Popov , Ed Maste , freebsd-hackers Subject: Re: splash(4) support in vt Message-Id: <20240709152844.ce25223e0dc507322622cb93@bidouilliste.com> In-Reply-To: <20230316092007.6a2695e995f5e4c589140886@bidouilliste.com> References: <20230316092007.6a2695e995f5e4c589140886@bidouilliste.com> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; amd64-portbld-freebsd15.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=US-ASCII Content-Transfer-Encoding: 7bit X-Spamd-Bar: --- X-Spamd-Result: default: False [-3.40 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; DMARC_POLICY_ALLOW(-0.50)[bidouilliste.com,none]; MV_CASE(0.50)[]; R_DKIM_ALLOW(-0.20)[bidouilliste.com:s=mx]; R_SPF_ALLOW(-0.20)[+ip4:212.83.155.74/32]; ONCE_RECEIVED(0.10)[]; MIME_GOOD(-0.10)[text/plain]; ASN(0.00)[asn:12876, ipnet:212.83.128.0/19, country:FR]; FREEFALL_USER(0.00)[manu]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_ONE(0.00)[1]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MLMMJ_DEST(0.00)[freebsd-hackers@freebsd.org]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[bidouilliste.com:+] X-Rspamd-Queue-Id: 4WJMKL5Llgz4Hv5 Hello, Yes I'm replying to myself and to an old thread. On Thu, 16 Mar 2023 09:20:07 +0100 Emmanuel Vadot wrote: > 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? > > > > I think we'd need to start from getting more colors work. Our final > > goal is a GIF-animated splash. > > > > > > > > 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. > > > > Which is the reason it only supports 2-color images, I presume? > > > > Thanks for the links, I'll take a look! > > > > 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. All of the above is now done, you can have a look at https://reviews.freebsd.org/D45929 and child reviews. This will only work with EFI and .png file, and I don't plan to work on adding support for bios/vbe (even if vbe support shouldn't be hard to do) or any other image format (loader only knows on how to deal with png and I think that this is enough). Cheers, > 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, -- Emmanuel Vadot