Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 Mar 2023 09:20:07 +0100
From:      Emmanuel Vadot <manu@bidouilliste.com>
To:        Gleb Popov <arrowd@freebsd.org>
Cc:        Ed Maste <emaste@freebsd.org>, freebsd-hackers <freebsd-hackers@freebsd.org>
Subject:   Re: splash(4) support in vt
Message-ID:  <20230316092007.6a2695e995f5e4c589140886@bidouilliste.com>
In-Reply-To: <CALH631=Vxx_Huc9Jf7iktzN5JxOksp75Z07SZvHndbwvan6Ocw@mail.gmail.com>
References:  <CALH631=cz2SSdux6NaiHu3zRe=tEzKeG2=Fsy6j5xVUY0UsRkg@mail.gmail.com> <CAPyFy2BBH65SVOMxp09U1MSLJrHrQo4U_ymNznjFZSEKYmvX6g@mail.gmail.com> <CALH631=Vxx_Huc9Jf7iktzN5JxOksp75Z07SZvHndbwvan6Ocw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 16 Mar 2023 09:26:30 +0300
Gleb Popov <arrowd@freebsd.org> wrote:

> On Wed, Mar 15, 2023 at 10:57?PM Ed Maste <emaste@freebsd.org> 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 <manu@bidouilliste.com> <manu@freebsd.org>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20230316092007.6a2695e995f5e4c589140886>