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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>