[PATCH 2/5] video console: refactoring and optimization

Simon Glass sjg at chromium.org
Wed Jan 4 21:01:53 CET 2023


Hi Dzmitry,

On Wed, 4 Jan 2023 at 04:17, Dzmitry Sankouski <dsankouski at gmail.com> wrote:
>
> Regarding code-size there's a gain with CONFIG_CONSOLE_ROTATION
> enabled, and penalty with disabled:
>
> New:
> CONFIG_VIDEO_CONSOLE=y
> CONFIG_CONSOLE_ROTATION=y
> dzmitry at debian:~/side/u-boot$ du --bytes drivers/video/console_simple.o
> 108208  drivers/video/console_simple.o
>
> CONFIG_VIDEO_CONSOLE=y
> # CONFIG_CONSOLE_ROTATION is not set
> dzmitry at debian:~/side/u-boot$ du --bytes drivers/video/console_simple.o
> 53848   drivers/video/console_simple.o
>
> Old:
> dzmitry at debian:~/side/u-boot$ du --bytes drivers/video/console_normal.o
> 44728   drivers/video/console_normal.o
> dzmitry at debian:~/side/u-boot$ du --bytes drivers/video/console_rotate.o
> 85424   drivers/video/console_rotate.o
>
> In theory, there should be a small performance penalty for the `if
> (direction)` statement -
> for every row, and for each pixel. For an 8x16 font, it'll be 144 if statements.
>
> I'll comment on functions in the next patch versions.

To check this, use:

buildman -b <branch> <board>

to build each commit, then

buildman -b <branch> <board> -sS

You can add -B for function bloat and --step 0 to diff just the first
and last commits.


- Simon

>
> пт, 30 дек. 2022 г. в 01:41, Simon Glass <sjg at chromium.org>:
> >
> > Hi Dzmitry,
> >
> > On Mon, 26 Dec 2022 at 13:50, Dzmitry Sankouski <dsankouski at gmail.com> wrote:
> > >
> > > - get rid of code duplications in switch across bpp values
> > > - extract common pixel fill logic in two functions one per
> > > horizontal and vertical filling
> > > - rearrange statements in put_xy* methods in unified way
> > > - replace types - uint*_t to u*
> > >
> > > Signed-off-by: Dzmitry Sankouski <dsankouski at gmail.com>
> > > ---
> > >  drivers/video/console_simple.c | 508 ++++++++++++---------------------
> > >  1 file changed, 184 insertions(+), 324 deletions(-)
> >
> > This looks like a nice tidy up.
> >
> > Is there a code-size or performance penalty with this? E.g. with
> > CONFIG_CONSOLE_ROTATION disabled
> >
> > Please can you comment the functions property so we know what they do?
> >
> > Regards,
> > Simon


More information about the U-Boot mailing list