mouse: Place mouse in the middle of the display

When starting the expo, put the mouse in the middle of the display so it
is more visible to the user.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass
2025-10-10 01:31:21 -06:00
parent 5e892b5ea2
commit 52d2f49d29
2 changed files with 4 additions and 0 deletions

View File

@@ -97,6 +97,8 @@ int mouse_set_video(struct udevice *dev, struct udevice *video_dev)
if (video_dev) {
uc_priv->video_width = video_get_xsize(video_dev);
uc_priv->video_height = video_get_ysize(video_dev);
uc_priv->last_pos.x = uc_priv->video_width / 2;
uc_priv->last_pos.y = uc_priv->video_height / 2;
} else {
uc_priv->video_width = 0;
uc_priv->video_height = 0;

View File

@@ -168,6 +168,8 @@ int mouse_set_ptr_visible(struct udevice *dev, bool visible);
* Sets up the video device in the mouse uclass private data so mouse drivers
* can scale coordinates to match the display resolution.
*
* This also places the mouse in the middle of the display
*
* @dev: Mouse device
* @video_dev: Video device
* Returns: 0 if OK, -ve on error