1110 Commits

Author SHA1 Message Date
Simon Glass
f95a85e1a6 expo: Track the number of render calls
Keep track of the frame count, i.e. the number of times that
expo_render() has been called since expo_enter_mode() was invoked.

Allow test mode to be enabled (if compiled in) by setting the 'expotest'
environment variable to 1.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
2025-10-07 10:54:13 +00:00
Simon Glass
ea95076ac6 expo: Introduce a test mode
Add a test mode for expo which will display useful debugging
information.

Put this feature behind a CONFIG_EXPO_TEST option to avoid code-size
growth. Create a separate C file and a header. Use static inlines to
avoid lots of CONFIG checking in expo.c

Enable this feature for sandbox and the EFI app for now.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
2025-10-07 10:54:13 +00:00
Simon Glass
6af145ea6b expo: Hide system pointer when entering expo mode
When entering expo mode, hide the system mouse pointer so that only the
custom expo pointer is visible. Restore it when exiting expo mode.

This uses the new set_ptr_visible() method if a mouse is enabled.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
2025-10-07 10:54:13 +00:00
Simon Glass
e99d2dc8ec mouse: Add support for scaling of video-device coordinates
Add a mouse_set_video() function to set up the video device associated
with the mouse. This allows mouse drivers to scale coordinates to match
the display resolution.

The video device information is stored in mouse_uc_priv rather than
being driver-specific, providing a common place for all mouse drivers to
access display dimensions for coordinate scaling.

Update expo_set_mouse_enable() to call mouse_set_video() to configure
the mouse with the display device.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
2025-10-07 10:54:13 +00:00
Simon Glass
10f0e9f4ca expo: Support drawing only the dirty portion of an expo
To optimise drawing on the display, provide a new function which draws
only the part of the display which is marked as dirty.

Series-to: concept
Cover-letter:
expo: Continue development of expo with mouse
This series integrates mouse support into expo and starts to build the
infrastructure for drawing the mouse pointer more efficiently (i.e.
without re-rendering the entire scene).

It also adds a few more structs to video_defs.h for position and size.

This is part D.
END

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-10-06 10:11:05 -06:00
Simon Glass
56f7bf5ed8 expo: Add selective rendering for dirty objects in scene
Support rendering only the dirty objects in a scene.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
2025-10-06 10:11:05 -06:00
Simon Glass
5484c25772 expo: Add a way to calculate the bbox of dirty objects
When rendering an expo we should normally only need to draw the objects
which are marked dirty. Add a way to calculate the bounding box of
these.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
2025-10-06 10:11:05 -06:00
Simon Glass
f2909a4cde expo: Set dirty flag when an object bbox changes
Add a flag to indicate that am object must be redrawn. Set this flag
when an object's bounding box changes.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
2025-10-06 10:11:04 -06:00
Simon Glass
cec177e67b expo: Add damage tracking
As a few step towards making rendering more efficient, add support for
tracking video damage within an expo.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
2025-10-06 10:04:36 -06:00
Simon Glass
3e8147c8e4 expo: Drop struct scene_obj_bbox in favour of vid_bbox
Replace the scene_obj_bbox with the common vid_bbox structure to avoid
having the same structs with different names.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-10-06 10:04:36 -06:00
Simon Glass
c4e7c60e97 expo: Show the mouse when enabled
When the mouse is enabled, show it at its new position each time the
expo is rendered.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-10-06 10:04:35 -06:00
Simon Glass
ef117db9c3 expo: Store mouse pointer and size in expo
Store the mouse pointer image and its dimensions in the expo structure
when mouse support is enabled. This avoids repeatedly looking up the
image and calculating its size.

Use struct vid_size to store the mouse pointer dimensions.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-10-06 10:03:29 -06:00
Simon Glass
ff8905943b expo: Update poll_mouse() to use struct vid_pos
Simplify the function to use struct vid_pos instead of separate x/y
pointers.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
2025-10-03 06:42:10 -06:00
Simon Glass
00692afa1c mouse: Update mouse_get_click() to use struct vid_pos
Change the API to use struct vid_pos instead of separate x/y pointers.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
2025-10-03 06:41:11 -06:00
Simon Glass
9f00a0e3f3 boot: Run the EFI bootmgr just before network devices
At present the EFI bootmgr scans all devices in the system before
deciding which one to boot. Ideally it would use the bootstd iterator
for this, but in the meantime, give it a lower priority, so it runs
just before the network devices.

Note that if there are no hunted network devices hunted, then it will
run at the end, after all bootdevs are exhausted. In other words, it
will always run.

Series-changes: 2
- Update commit message to indicate the bootmeth will always run
- Document how the priority was chosen

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-30 17:23:58 -06:00
Simon Glass
6e4f842505 boot: Run global bootmeths after all bootdevs are exhausted
When there are no more bootdevs we should still go through the global
bootmeths, since some may not have yet been used, if their priority has
not yet come up.

Add a final check for this at the end of the iterator.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-30 17:14:45 -06:00
Simon Glass
1200d2b52f boot: Don't change the method count after global bootmeths
At present before scanning global bootmeths, the iterator sets the
method count to the index of the first global bootmeth. Now that we
support scanning the global bootmeths multiple times, we must leave this
count alone.

Check against have_global and first_glob_method instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-30 17:14:45 -06:00
Simon Glass
db66d8d149 boot: Implement a priority for global bootmeths
Allow bootmeths to select when they want to run, using the bootdev
priority. Provide a new bootmeth_glob_allowed() function which checks if
a bootmeth is ready to use.

Fix a comment in bootflow_system() which is a test for global bootmeths.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-30 17:14:45 -06:00
Simon Glass
1c54931b8e boot: Only run global bootmeths once each
Use the methods_done flags to make sure that each global bootmeth is
only used once. For now this has no effect, since they are all processed
at the start.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-30 17:14:45 -06:00
Simon Glass
8f4d910ee4 boot: Support rescanning the global bootmeths
Add the logic to scan through the global bootmeths for every new
bootdev, in preparation for allowing global bootmeths to select where in
the hunter ordering they go.

Use a new bootmeth_glob_allowed() function to check if a bootmeth is
allowed, ensuring that each can run at most once.

For now this has no actual effect, since the global bootmeths are
unconditionally processed at the start, with iter->methods_done being
updated to include all of them. Therefore when scanning again, no
unprocessed global bootmeths will be found.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-30 17:14:45 -06:00
Simon Glass
5fcdd37f14 boot: Move preparing bootdev into a function
The code at the end of iter_inc() is already somewhat tortuous. Before
making it worse, move it into a function.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-30 17:14:45 -06:00
Simon Glass
07326c0baf boot: Keep track of which bootmeths have been used
Add a bitfield which tracks when bootmeths have been used. This will be
needed when global bootmeths can be used later in the iteration.

Fix a missing bootflow_free() while here.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-30 17:14:45 -06:00
Simon Glass
37cabfe0b1 boot: Add a flag for whether there are global bootmeths
The current 'doing_global' refers to being in the state of processing
global bootmeths. Since global bootmeths are currently used once at the
start, it becomes false once the last global bootmeth has been used.

In preparation for allowing bootmeths to run at other points in the
bootstd interation, add a new 'have_global' flag which tracks whether
there are any global bootmeths in the method_order[] list. It is set up
when iteration starts. Unlike doing_global which resets back to false
after the global bootmeths have been handled, once have_global is set to
true, it remains true for the entire iteration process. This provides a
quick check as to whether global-bootmeth processing is needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-30 17:14:45 -06:00
Simon Glass
cd6424c4c3 boot: Update first_glob_method when dropping a bootmeth
For now we only support dropping non-global bootmeths from the
iteration. Update first_glob_method in that case and add a few checks
that things are correct.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-30 17:14:45 -06:00
Simon Glass
dcd69dc315 boot: Move showing of bootflows out of the command
It is helpful in tests to be able to show the bootflow that is being
examined. Move show_bootflow() into boot/ and rename it.

Series-changes: 2
- Add a log_err() for an invalid state

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-30 17:14:28 -06:00
Simon Glass
b69a2b1ef8 boot: Add more debugging to iter_incr()
This function is the core of the bootstd iteration. Add some debugging
for the decisions it makes along the way, to make it easier to track
what is going on.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-30 17:10:56 -06:00
Simon Glass
f89d2779c3 boot: Improve comments related to global bootmeths
Add a few comments about global bootmeths and first_glob_method

Fix a broken line in bootmeth_setup_iter_order() while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2025-09-30 17:10:48 -06:00
Simon Glass
d9152ea75e bootctl: Initial experimentation
This provides a basic prototype for boot control.

Some documentation is in boot/bootctl/README.rst
2025-09-28 14:32:36 -06:00
Simon Glass
0efc5f0ffc expo: Allow manual positioning of menu items
Sometimes we want to position items individually rather than relying on
the automatic scene layout. Provide a flag for this, expanding the type
to cope.

Also add an assertion that the flags fit in the available space.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-25 09:47:09 -06:00
Simon Glass
47b3b6d969 boot: Tidy up positioning in bootflow_menu_new()
Several items use the SCENEOB_DISPLAY_MAX setting which does not work
with alignment. Some others have a negative height, which is now
checked, so results in the item being invisible.

Fix these problems.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-25 09:47:09 -06:00
Simon Glass
829f6a3e0a boot: Add more debugging in FIT-handling
Provide return values from a few functions to make it easier to track
the flow of execution in a few places.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-22 11:23:05 -06:00
Simon Glass
46ea89dbf9 boot: Fix code formatting in fit_image_load()
Drop an unwanted blank line and format a few lines to 80cols.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-22 11:23:05 -06:00
Simon Glass
f0927fc920 boot: Add more debugging around devicetree selection
Provide some debugging for the select string and the FDT which is
actually chosen from the FIT.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-22 11:23:05 -06:00
Simon Glass
aaf889390f boot: Support a fake go with pxe
Provide a way to pass the 'fake go' flag from the bootflow flag through
to the PXE implementation, so that a request for a fake go
(via 'bootflow boot -f') is handled correctly in the bootmeth and when
booting.

Add a little more debugging of this in PXE.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-22 11:23:05 -06:00
Simon Glass
79ba2bc013 boot: Show the ramdisk node when debugging
Add a new debug line for the offset of the ramdisk node. Fix up some
missing newlines on other log messages in this file, while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-22 11:23:04 -06:00
Simon Glass
7f9e630a9e boot: Drop hex prefix from the booti image-moving message
This message includes the 0x prefix which is not used elsewhere. Drop it
for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-22 11:23:04 -06:00
Simon Glass
424bb755a9 boot: Select the fake-go state explicitly
Rather than always going through this state, require callers to
explicitly request it. This will allow the option to be enabled without
affecting the boot, unless the user expressly requests it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-22 11:23:04 -06:00
Simon Glass
5e97965c34 boot: Provide a Kconfig to enable faking the boot
This feature was designed for tracing but can be useful for debugging
too, since it is possible to examine the state of the system just before
handing off to the OS.

Provide a separate CONFIG_BOOTM_FAKE_GO option to allow this feature to
be used separate from tracing. Enable it for the EFI app.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-22 11:23:04 -06:00
Simon Glass
f7b1a67327 video: Drop extra parameters from vidconsole_show_cursor()
Now that both console drivers use the CLI index, we don't need the extra
parameters for this. Drop them.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-19 12:56:02 -06:00
Simon Glass
54f7d358cd video: Drop vidconsole_set_cursor_visible()
There is only one user of this function. Update it to use the new
vidconsole_show_cursor() instead.

Remove the now-unused vidconsole_set_cursor_visible()

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-19 12:56:02 -06:00
Simon Glass
bd8303cf43 expo: Enable the cursor when editing a textline
Call the appropriate vidconsole functions to ensure that the cursor
will be enabled while a textline is open.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-19 12:56:02 -06:00
Simon Glass
4eb8f8319a expo: Enable the mouse when available
When creating a new bootflow menu or cedit, enable the mouse, so the
user can interact with the expo more easily.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-15 13:23:13 -06:00
Simon Glass
bcf7b403e8 expo: Check the mouse when polling
If no key is pressed, check for a mouse click and process that, if
available.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-15 13:23:13 -06:00
Simon Glass
6cdc1c906a expo: Refactor expo_poll() to separate out key handling
In preparation for supporting mouse clicks, split the key-handling part
of this function into a separate poll_keys() function.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-15 13:23:13 -06:00
Simon Glass
a6fd275924 expo: Support sending a click to an expo
Implement clicking on an expo, which simply passes it onto the scene.
For now, there are no callers for this function.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-15 13:23:13 -06:00
Simon Glass
f5ec16dbea expo: Support sending a click to a scene
Implement clicking on an object in the scene. For now only menus and
textlines respond to this. For menus the behaviour is different for
popups than for normal menus.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-15 13:23:12 -06:00
Simon Glass
407503e4a3 expo: Support sending a click to a menu
Clicking on a menu can result in selecting an item. If it is a popup
menu then the item should be closed. Add support for this.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-15 13:23:12 -06:00
Simon Glass
92a2b06a3b expo: Add three new actions for mouse events
Popup menus have particular behaviour which needs to be modelled in
the expoact_type enum:

- clicking on a menu item should select it and close the menu
- clicking on a menu should highlight it and open the menu
- clicking on a menu while another menu is open should select the item,
  close the menu, then open the other menu

Add actions associated with each of these. These are modelled as
combined actions for simplicity.

Implement the actions in cedit. The general expo support will come
later.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-15 13:23:12 -06:00
Simon Glass
9d34fbe2e8 expo: Allow checking if a position is within a textline
For a textline it is possible to click into the edit field. Provide a
function to check whether a position is within this field.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-15 13:23:12 -06:00
Simon Glass
1e65b5e22e expo: Provide a way to check if a position is within a menu
To implement mouse clicks we need a way to figure out what the user has
clicked on. As a starting point, create a scene_menu_within() function
which returns the item containing an x, y coordinate.

Provide a helper function in scene.c for use with this. Add a simple
for completeness.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-15 13:23:12 -06:00