mirror of
https://github.com/AsahiLinux/u-boot
synced 2025-02-26 12:27:12 +00:00
expo: Store the console in the expo
Rather than finding this each time, keep a pointer to it. This simplifies the code a little. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
0ab4f91a10
commit
42b18494bd
3 changed files with 13 additions and 8 deletions
|
@ -83,7 +83,16 @@ const char *expo_get_str(struct expo *exp, uint id)
|
||||||
|
|
||||||
int expo_set_display(struct expo *exp, struct udevice *dev)
|
int expo_set_display(struct expo *exp, struct udevice *dev)
|
||||||
{
|
{
|
||||||
|
struct udevice *cons;
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
ret = device_find_first_child_by_uclass(dev, UCLASS_VIDEO_CONSOLE,
|
||||||
|
&cons);
|
||||||
|
if (ret)
|
||||||
|
return log_msg_ret("con", ret);
|
||||||
|
|
||||||
exp->display = dev;
|
exp->display = dev;
|
||||||
|
exp->cons = cons;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
10
boot/scene.c
10
boot/scene.c
|
@ -278,16 +278,10 @@ static int scene_obj_render(struct scene_obj *obj, bool text_mode)
|
||||||
{
|
{
|
||||||
struct scene *scn = obj->scene;
|
struct scene *scn = obj->scene;
|
||||||
struct expo *exp = scn->expo;
|
struct expo *exp = scn->expo;
|
||||||
struct udevice *cons, *dev = exp->display;
|
struct udevice *dev = exp->display;
|
||||||
|
struct udevice *cons = text_mode ? NULL : exp->cons;
|
||||||
int x, y, ret;
|
int x, y, ret;
|
||||||
|
|
||||||
cons = NULL;
|
|
||||||
if (!text_mode) {
|
|
||||||
ret = device_find_first_child_by_uclass(dev,
|
|
||||||
UCLASS_VIDEO_CONSOLE,
|
|
||||||
&cons);
|
|
||||||
}
|
|
||||||
|
|
||||||
x = obj->x;
|
x = obj->x;
|
||||||
y = obj->y;
|
y = obj->y;
|
||||||
|
|
||||||
|
|
|
@ -50,6 +50,7 @@ struct expo_action {
|
||||||
*
|
*
|
||||||
* @name: Name of the expo (allocated)
|
* @name: Name of the expo (allocated)
|
||||||
* @display: Display to use (`UCLASS_VIDEO`), or NULL to use text mode
|
* @display: Display to use (`UCLASS_VIDEO`), or NULL to use text mode
|
||||||
|
* @cons: Console to use (`UCLASS_VIDEO_CONSOLE`), or NULL to use text mode
|
||||||
* @scene_id: Current scene ID (0 if none)
|
* @scene_id: Current scene ID (0 if none)
|
||||||
* @next_id: Next ID number to use, for automatic allocation
|
* @next_id: Next ID number to use, for automatic allocation
|
||||||
* @action: Action selected by user. At present only one is supported, with the
|
* @action: Action selected by user. At present only one is supported, with the
|
||||||
|
@ -62,6 +63,7 @@ struct expo_action {
|
||||||
struct expo {
|
struct expo {
|
||||||
char *name;
|
char *name;
|
||||||
struct udevice *display;
|
struct udevice *display;
|
||||||
|
struct udevice *cons;
|
||||||
uint scene_id;
|
uint scene_id;
|
||||||
uint next_id;
|
uint next_id;
|
||||||
struct expo_action action;
|
struct expo_action action;
|
||||||
|
|
Loading…
Add table
Reference in a new issue