Compare commits

..

76 Commits
schd ... scha

Author SHA1 Message Date
Simon Glass
22cbcd5676 expo: Drop the special theme code for bootflow_menu
The expo now has all that is needed to apply a suitable theme, so drop
this unnecessary code. Any further tweaks can be added to the generic
expo code.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-19 12:25:19 +01:00
Simon Glass
7f97b1f72c expo: Set up menu fully in bootflow_menu_start()
Apply the theme, calculate dimensions, highlight the menu and arrange
the scene correctly, so that everything is ready to go when the expo
is rendered.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-19 12:25:19 +01:00
Simon Glass
51f0db8676 expo: Split setting up the menu from adding items
Some callers may wish to add items later as they are discovered. Split
the setup code into its own function, to permit this.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-19 12:25:19 +01:00
Simon Glass
8c739f5330 expo: Update bootflow_menu_poll() to return a sequence ID
Rather than returning a bootflow, return the index of the bootflow. This
will allow callers to do their own translation to bootflows or some
other data structure.

Also return a special code when the user tries to move the pointer, so
that the caller can cancel the boot-menu timeout, if this is in use.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-19 12:25:19 +01:00
Simon Glass
1e26fa60ed expo: Improve the visual appearance of the menu
The menu is currently quite basic. Make use of some recently added
features in expo, to:

- Show proper prompts
- Highlight the current item
- Centre text
- Use multi-line text instead of two independent lines
- Put a box around the items

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-19 12:25:19 +01:00
Simon Glass
b665ceac44 expo: Provide a way to position things relative to display
It is often necessary to centre objects within the display area. Add a
special position value to indicate this.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-19 12:25:19 +01:00
Simon Glass
f2a852aad2 expo: Drop the render from expo_poll()
Within tests it is useful to be able to control rendering of the expo.
Drop the automatic call to expo_render() within expo_poll() and adjust
its callers to handle this instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-19 12:25:19 +01:00
Simon Glass
c6734018e1 expo: Adjust expo_poll() to avoid looping forever
If the user does not quickly provide some input, exit so that other
things can be done, such as searching for the next OS.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-19 12:25:19 +01:00
Simon Glass
959b9b5e91 expo: Support highlighting menu items
Expo normally uses a pointer to show the current item. Add support for
highlighting as well, since this makes it easier for the user to see the
current item.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-19 12:25:19 +01:00
Simon Glass
d7a6114006 expo: Add forward declarations to scene_internal.h
Provide some forward declarations for types used in this file, to keep
the LSP happy and avoid errors if the caller happens not to include the
required header.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-19 12:25:19 +01:00
Simon Glass
a4f6498d7f expo: Drop the gap between groups of menu items
The gap is intended to separate options which are on different bootdevs,
but most of the time there is only one. So drop this gap.

Keep the code around in case it becomes useful to have it in the style,
or based on some other mechanism.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-19 12:25:19 +01:00
Simon Glass
e6f19dc4bb expo: Use a simpler name for USB media
For USB devices we use the string 'usb_mass_storage' which is a bit
verbose. Use 'USB' instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-19 12:25:19 +01:00
Simon Glass
15d6a92b18 expo: Begin implementation of a text editor
It is useful to be able to edit text, e.g. to allow the user to edit the
environment or the command-line arguments for the OS.

Add the beginnings of an implementation. Future work is needed to finish
this: keypress handling and scrolling. For now it just displays the
text.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-19 12:25:19 +01:00
Simon Glass
b2b5a46259 expo: Support object alignment
Add support for left, right and centred alignment for text, in the
horizontal dimension.

Also support top, bottom and centred in the vertical dimension, for the
text object as a whole.

Alignment is not yet implemented for images. It has no meaning for
menus. A textline object uses a text object internally, so alignment
is supported there.

Provide some documentation to explain how objects are positioned.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-19 12:25:19 +01:00
Simon Glass
e4aee677f5 expo: Implement a box
It is useful to be able to draw a box around elements in the menu. Add
support for an unfilled box with a selectable thickness.

Note that there is no support for selecting the colour for any expo
objects yet.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-19 12:25:19 +01:00
Simon Glass
9f20f2dd9a expo: Support white-on-black in the theme
Allow this setting to be controlled from the theme.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-19 12:25:19 +01:00
Simon Glass
3be30bbd18 expo: Support rendering multiple lines of text
Use the measurement info to write each line of text separately, thus
respecting word-wrapping and newlines.

Fix up the comment for scene_obj_render() while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-19 12:25:19 +01:00
Simon Glass
c4617ec033 expo: Check the screen contents after rendering
Make sure that the screen contents are as expected when a scene has been
rendered.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-19 12:25:19 +01:00
Simon Glass
4e35de94e1 expo: Allow strings to be editable
In some cases dynamic text is needed, e.g. for a menu countdown. Add a
function which handles this, allowing the caller to take control of the
text that is shown on each render.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-19 12:25:18 +01:00
Simon Glass
79650e6910 expo: Tidy up scene_txt_render()
Add an early return if there is no string. Move all declarations to the
top of the function.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-19 12:25:18 +01:00
Simon Glass
384712fdab expo: Move text-rendering into its own function
The code to render text is quite long, so put it in its own function.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-19 12:25:18 +01:00
Simon Glass
aa7f9a6482 expo: Create a struct for generic text attributes
In preparation for adding more text types, refactor the common fields
into a new structure. This will allow common code to be used.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-19 12:25:18 +01:00
Simon Glass
765d9be802 expo: Line up all menu objects
At present labels are lined up vertically. Do the same with keys and
descriptions, since it looks nicer.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-19 12:25:18 +01:00
Simon Glass
2906151df8 expo: Support setting the size and bounds of an object
Add a function to allow the size of an object to be set independently
of its position.

Also add a function to permit the object's bounding box to be set
independently of its dimensions.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-19 12:25:18 +01:00
Simon Glass
0cf6bb94b9 expo: Make bounding-box calculation more flexible
In some cases it is useful to obtain more than just two bounding boxes
from a menu, e.g. to line up all descriptions vertically.

Use an array to obtain bounding-box information and calculate it
separately for each item.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-19 12:25:18 +01:00
Simon Glass
e1352bf5df expo: Separate dimensions from the bounding box
At present each object has a width and height and the bounding box is
implicit in that.

This is not flexible enough to handle objects which are larger than
their contents might need. For example, when centring a text object we
might want to have it stretch across the whole width of the display even
if the text itself does not need that much space.

Create a new 'dimensions' field and convert the existing width/height
into x1/y1 coordinates.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-19 12:25:18 +01:00
Simon Glass
e81537728d expo: Use an abuf to hold strings
It is more convenient to put strings in an abuf so they can easily be
resized. Adjust the struct accordingly.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-19 12:25:18 +01:00
Simon Glass
616aa8fe3a expo: Rename x and y in struct scene_obj_bbox
These coordinates are the top left values, so rename them to x0 and y0
in preparation for changing the width and height to x1 and y1

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-19 12:25:18 +01:00
Simon Glass
bb9e0f14d4 expo: Rename scene_dim to scene_obj_bbox
At present we assume that each object is a simple box and that it fills
the whole box.

This is quite limiting for text objects, which we may want to centre
within the box. We need a position within the box where drawing starts.

Rename the scene_dim struct to indicate that it is a bounding box.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-19 12:25:18 +01:00
Simon Glass
8fa8e3ae65 expo: Allow adding a single bootflow to a menu
Refactor bootflow_menu_add_all() to call a new bootflow_menu_add() to
add each of its bootflows.

Move the last_bootdev value into struct menu_priv to make this work.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-19 12:25:18 +01:00
Simon Glass
505aec32dc expo: Split bootflow_menu_new() into two pieces
Split the iteration piece of this function into bootflow_menu_add_all()
so that it is possible for the caller to be in control of adding items
to the menu.

Move the expo_destroy() call into the caller.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-19 12:25:18 +01:00
Simon Glass
ef09a8afff expo: Split bootflow_menu_run() into two pieces
Split the starting piece of this function into bootflow_menu_start()
and the polling part into bootflow_menu_poll() so that it is possible
for the caller to be in control of the event loop.

Move the expo_destroy() call into the caller.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-19 12:25:18 +01:00
Simon Glass
0aa593c6da expo: Adjust how menu items are highlighted
At present when the user moves to a new menu item, the menu code
handles this immediately. This means it is not possible to use an expo
action to effect the same change.

Update this so that EXPOACT_POINT_ITEM is handled in cedit_do_action().

Expand the test to cover this.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-19 12:25:18 +01:00
Simon Glass
3964d538b4 expo: Provide access to the current menu item
Add functions to allow a caller to find out the current menu item and to
select a different one.

Update the event handling so that an attempt to change the current item
(e.g. by pressing the up-arrow key) is reported to the caller, since
this may be used to cancel an autoboot timeout.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-19 12:25:18 +01:00
Simon Glass
fb88896f99 expo: Test some cedit actions
Refactor the action-processing code into a new cedit_do_action()
function so we can call it from a test. Check moving to a new field and
opening the menu, to ensure that rendering is correct.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-19 12:25:18 +01:00
Simon Glass
8407f033c9 expo: Move cedit-state fields into expo
Move the boolean flags into struct expo so that the state can be
maintained over function calls.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-19 12:25:18 +01:00
Simon Glass
3353c8af10 expo: Create a rendering test for cedit
Add a test to check that the cedit renders as expected.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-19 12:25:18 +01:00
Simon Glass
9896f4b533 expo: Destroy the cedit expo when done
Once 'cedit run' is completed, destroy the expo so that a fresh one is
used for any future editing.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-19 12:25:18 +01:00
Simon Glass
a6393b442a expo: Add a function to poll for input
Both bootflow_menu and cedit use similar logic to poll an expo. Move
this into the expo library so the code can be shared.

Update bootflow_menu_run() to return -EPIPE when the user quits without
choosing anything, since -EAGAIN is ambiguous and elsewhere means that
there is no input yet.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-19 12:25:18 +01:00
Simon Glass
0d83cbe895 expo: Add CLI context to the expo
An expo generally needs to keep track of the keyboard state while it is
running, so move the context into struct expo

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-19 12:25:18 +01:00
Simon Glass
41e4fd18df bootstd: Mention FS state in bootmeth_read_bootflow()
Add a comment to help implementers deal with the need for calling
fs_set_blk_dev_with_part()

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-19 12:25:18 +01:00
Simon Glass
c3bd77a0bc bootstd: Expand debugging in bootdev_find_in_blk()
Add more info in this function so that the partition number and the call
to bootmeth_read_bootflow() are logged.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-19 12:25:18 +01:00
Simon Glass
69e81a8c6a bootstd: Correct the comment for bootmeth_set_order()
The function is used to handle the boot_targets variable so must support
space-separated items. Update the comment to show this.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-19 12:25:18 +01:00
Simon Glass
fccfc35501 bootstd: Provide a command to select the bootdev order
It is sometimes useful to select or override the default bootdev order.
Add a command for this.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-19 12:25:18 +01:00
Simon Glass
b5c505d3e5 bootstd: Tidy up a nested CONFIG_IS_ENABLED(BOOTSTD)
Fix a nested check for BOOTSTD in the bootdev.h header file.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-19 12:25:18 +01:00
Simon Glass
d2290d205a bootstd: Tweak scanning with labels
The current implementation of labels uses the ordering of the media
devices to start its scan but then uses the ordering of the (child)
bootdev devices to iterate from then on. This is inconsistent and can
miss some bootdevs.

Update bootdev_next_label() so that it uses the ordering of the bootdev
devices to perform its scan. Check for running out of labels as well.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-19 12:25:18 +01:00
Simon Glass
c303f9960e sandbox: Use a unique name for each USB controller
Add a number after the node name so that it is clear which controller is
being used.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-19 12:25:18 +01:00
Simon Glass
b95f85c3be usb: Use more useful names for block devices
The driver name is typically not unique so using that as a basis for the
block and bootdev devices makes them hard to distinguish. This happens
when there are multiple USB controllers using the same driver.

Make use of the parent-device name and the hub port number. This gives a
reasonable chance that the name is unique.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-19 12:25:18 +01:00
Simon Glass
6e7eb02b48 lib: Provide a signed version of simple_itoa()
In some cases we want to show a signed value to the user without needing
to use the full printf() implementation. Add a new version of the
simple_itoa() function to handle this.

Update the existing function to use ulong instead of long, to avoid
confusion about which it actually uses.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-19 12:25:18 +01:00
Simon Glass
99da417e8d sandbox: Enable PHYS_64BIT for 64-bit builds
Sandbox is special in that we use the bitness of the host. This should
extend to PHYS_64BIT as well, so enable this option when building on a
64-bit host.

Update the conditions in io.h so that 64-bit access is available.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-19 12:25:18 +01:00
Simon Glass
750623d994 membuf: Add an easy way to set up a buffer with data
In some cases it is useful to set up a buffer with some data to read,
e.g. when reading lines from a text file. Add a helper for this.

Tidy up the comment for membuf_init() while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-19 12:25:18 +01:00
Simon Glass
4e5e29d178 fs: boot: Update bootmeth_alloc_other() to use abuf
Using an abuf for this function simplifies returning the size and also
makes it easier to free memory afterwards. Update the API and callers.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-19 12:25:18 +01:00
Simon Glass
0144e7c7ad fs: boot: Update fs_load_alloc() to use abuf
Using an abuf for this function simplifies returning the size and also
makes it easier to free memory afterwards. Update the API and callers.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-19 12:25:18 +01:00
Simon Glass
306dba0861 fs: boot: Update fs_read_alloc() to use abuf
Using an abuf for this functions simplifies returning the size and also
makes it easier to free memory afterwards. Update the API and callers.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-19 12:25:18 +01:00
Simon Glass
e365452917 test: Add a test for strim()
This function trims whitespace from the start and end of a string. Add a
test for it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-19 12:25:18 +01:00
Simon Glass
49251e2bd7 sandbox: Select white-on-black
Use white on black for the expo menu as it is easier on the eyes.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-19 12:25:18 +01:00
Simon Glass
f08847c777 video: Add a function to draw a rectangle
Provide a way to draw an unfilled box of a certain width. This is useful
for grouping menu items together.

Add a comment showing how to see the copy-framebuffer, for testing.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-19 12:25:18 +01:00
Simon Glass
d2715bde1f video: Allow console output to be silenced
When using expo we want to be able to control the information on the
display and avoid other messages (such as USB scanning) appearing.

Add a 'quiet' flag for the console, to help with this.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-19 12:25:17 +01:00
Simon Glass
4f06137e07 test: video: Export the video-checking functions
We want to check the display contents in expo tests, so move the two
needed functions to a new header file.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-19 12:25:17 +01:00
Simon Glass
da50d9786b console: Support a format string for stderr output
Add a console_printf_select_stderr() function so that it is not
necessary for the caller to process the format string.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-19 12:25:17 +01:00
Simon Glass
5d0d2745a2 video: Add a way to write a partial string to the console
When writing multiple lines of text we need to be able to control which
text goes on each line. Add a new vidconsole_put_stringn() function to
help with this.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-19 12:25:17 +01:00
Simon Glass
9f33d79b56 video: truetype: Support a limit on the width of a line
Expo needs to be able to word-wrap lines so that they are displayed as
the user expects. Add a limit on the width of each line and support this
in the measurement algorithm.

Add a log category to truetype while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-19 12:25:17 +01:00
Simon Glass
d3d430e153 video: truetype: Support newlines in the measured string
It is useful to be able to embed newline characters in the string and
have the text measured into multiple lines. Add support for this.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-19 12:25:17 +01:00
Simon Glass
a3096a6e2a video: truetype: Fill in the measured line
Create a measured line for the (single) line of text.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-19 12:25:17 +01:00
Simon Glass
beb63b725a video: Begin support for measuring multiple lines of text
Update the vidconsole API so that measure() can measure multiple lines
of text. This will make it easier to implement multi-line fields in
expo.

Tidy up the function comments while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-19 12:25:17 +01:00
Simon Glass
f9ce97550b video: Add a test for font measurement
Add a simple test which measures a line of text using a Truetype font.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-19 12:25:17 +01:00
Simon Glass
66be7ccc73 video: Make white-on-black a video-device property
The CONFIG_WHITE_ON_BLACK setting is hard-coded at build-time. It is
useful to be able to control this when showing menus.

Create a property to hold this information, using the CONFIG as the
initial value.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-19 12:25:17 +01:00
Simon Glass
9c92240b70 abuf: Add a way to printf() into a buffer
It is useful to format a string into a buffer, with the sizing handled
automatically. Add a function for this.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-19 12:25:17 +01:00
Simon Glass
f34a8849c9 abuf: Add a function to copy a buffer
It is useful to be able to copy an abuf, to allow changes while
preserving the original. Add a function for this.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-19 12:25:17 +01:00
Simon Glass
700caed743 log: Add helpers for calling log_msg_ret() et al
Logging of function return-values is used very frequently in U-Boot now.
Add a few helper macros to make it less verbose to use.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-19 12:25:17 +01:00
Simon Glass
9d0e26a638 test/py: Add a test image for Ubuntu
Add an extlinux image that contains a few Ubuntu entries.

Increase the number of sandbox-USB-hub ports to permit this.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-19 12:25:17 +01:00
Simon Glass
9ba10ecaca test/py: Split out core of Fedora image into a new function
To permit easier adding of other images, move the Fedora-specific
portions of setup_bootflow_image() into a separate function.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-19 12:25:17 +01:00
Simon Glass
f8f73f892a bootstd: Fully complete iteration of a uclass
When trying all bootdevs in a uclass, the method flags are not preserved
in the iterator.

This has no impact on the first bootdev, since that is the one which
sets the flags. For the next one, iter_inc() is used and it finds the
next bootdev. However it sets the method_flags to 0

The result is that the third scan is conducted without the required
BOOTFLOW_METHF_SINGLE_UCLASS flag, so iteration procees to the next
label. This can miss bootdev if there three or more USB-storage devices,
for example.

Fix this by keeping the method flags around in this case.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-19 12:25:17 +01:00
Simon Glass
85978c8b2f bootstd: Try all bootmeths on the final partition
At present when one bootmeth fails on the final partition, the next
bootmeth is not tried. Adjust the logic to go to the next bootmeth,
which is the more natural behaviour.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-19 12:25:17 +01:00
Simon Glass
2449bd354f bootstd: Add more debugging to bootmeth_extlinux
Add a little more debugging to help figure out why bootflows are not
found.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-19 12:25:17 +01:00
Simon Glass
a289ed2b79 bootstd: Add more debugging to bootmeth_efi
Add a little more debugging to help figure out why bootflows are not
found.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-19 12:25:17 +01:00
11 changed files with 16 additions and 16 deletions

View File

@@ -972,6 +972,7 @@ err:
alist_uninit(&order);
return log_msg_ret("bso", -ENOMEM);
}
static int bootdev_pre_unbind(struct udevice *dev)

View File

@@ -294,7 +294,7 @@ int bootflow_menu_poll(struct expo *exp, int *seqp)
LOGR("bmp", expo_poll(exp, &act));
switch (act.type) {
case EXPOACT_SELECT:
case EXPOACT_SELECT:
*seqp = act.select.id - ITEM;
break;
case EXPOACT_POINT_ITEM: {

View File

@@ -172,8 +172,9 @@ void scene_menu_calc_bbox(struct scene_obj_menu *menu,
scene_bbox_union(menu->obj.scene, item->desc_id,
theme->menu_inset, &bbox[SCENEBB_desc]);
if (menu->cur_item_id == item->id)
if (menu->cur_item_id == item->id) {
scene_bbox_join(&local, 0, &bbox[SCENEBB_curitem]);
}
}
/*

View File

@@ -824,7 +824,7 @@ static int truetype_measure(struct udevice *dev, const char *name, uint size,
/* add the final line */
mline.bbox.x0 = 0;
mline.bbox.y0 = bbox->y1;
mline.bbox.x1 = tt_ceil((double)width * met->scale);
mline.bbox.x1 = tt_ceil((double)width * met->scale);;
bbox->y1 += met->font_size;
mline.bbox.y1 = bbox->y1;
mline.start = start;

View File

@@ -143,6 +143,7 @@ bool abuf_copy(const struct abuf *old, struct abuf *new);
int abuf_printf(struct abuf *buf, const char *fmt, ...)
__attribute__ ((format (__printf__, 2, 3)));
/**
* abuf_uninit_move() - Return the allocated contents and uninit the abuf
*

View File

@@ -657,7 +657,7 @@ struct bootflow_img *bootflow_img_add(struct bootflow *bflow, const char *fname,
int bootflow_get_seq(const struct bootflow *bflow);
/**
* bootflow_menu_setup() - Set up a menu for bootflows
* bootflow_menu_setup() - Set up up a menu for bootflows
*
* Set up the expo, initially empty
*

View File

@@ -381,7 +381,7 @@ void __assert_fail(const char *assertion, const char *file, unsigned int line,
#endif
/*
* LOGR() - helper macro for calling a function and logging error returns
* LOGR() - helper macro for calling a function and logging return
*
* Logs if the function returns a negative value
*
@@ -394,7 +394,7 @@ void __assert_fail(const char *assertion, const char *file, unsigned int line,
} while (0)
/*
* LOGZ() - helper macro for calling a function and logging error returns
* LOGZ() - helper macro for calling a function and logging return
*
* Logs if the function returns a non-zero value
*

View File

@@ -590,7 +590,7 @@ int vidconsole_get_font_size(struct udevice *dev, const char **name, uint *sizep
* vidconsole_set_quiet() - Select whether the console should output stdio
*
* @dev: vidconsole device
* @quiet: true to suppress stdout/stderr output, false to enable it
* @quiet: true to supress stdout/stderr output, false to enable it
*/
void vidconsole_set_quiet(struct udevice *dev, bool quiet);

View File

@@ -1,3 +1,4 @@
// SPDX-License-Identifier: GPL-2.0+
/*
* Copyright 2023 Google LLC
@@ -123,6 +124,8 @@ static int cedit_fdt(struct unit_test_state *uts)
ut_assertnonnull(menu);
ut_assert_console_end();
return 0;
}
BOOTSTD_TEST(cedit_fdt, UTF_CONSOLE);

View File

@@ -564,8 +564,7 @@ static int expo_render_image(struct unit_test_state *uts)
ut_assertok(scene_obj_set_bbox(scn, OBJ_TEXTED, 100, 200, 400, 650));
ut_assertok(expo_edit_str(exp, STR_TEXTED, &orig, &text));
abuf_printf(text, "This\nis the initial contents of the text editor "
"but it is quite likely that more will be added later");
abuf_printf(text, "This\nis the initial contents of the text editor but it is quite likely that more will be added later");
scn2 = expo_lookup_scene_id(exp, SCENE1);
ut_asserteq_ptr(scn, scn2);

View File

@@ -756,10 +756,7 @@ DM_TEST(dm_test_video_damage, UTF_SCAN_PDATA | UTF_SCAN_FDT);
/* Test font measurement */
static int dm_test_font_measure(struct unit_test_state *uts)
{
const char *test_string = "There is always much\nto be said for not "
"attempting more than you can do and for making a certainty of "
"what you try. But this principle, like others in life and "
"war, has its exceptions.";
const char *test_string = "There is always much\nto be said for not attempting more than you can do and for making a certainty of what you try. But this principle, like others in life and war, has its exceptions.";
const struct vidconsole_mline *line;
struct vidconsole_bbox bbox;
struct video_priv *priv;
@@ -840,9 +837,7 @@ static int dm_test_font_measure(struct unit_test_state *uts)
ut_asserteq(nl + 1, line->start);
ut_asserteq(129, line->len);
printf("line1 '%.*s'\n", line->len, test_string + line->start);
ut_asserteq_strn("to be said for not attempting more than you can do "
"and for making a certainty of what you try. But this "
"principle, like others in",
ut_asserteq_strn("to be said for not attempting more than you can do and for making a certainty of what you try. But this principle, like others in",
test_string + line->start);
line++;