blob: dcee2d175cbf6e8452082c7f7eb7e55e522e1ce7 [file] [log] [blame]
Kyösti Mälkki5687fc92013-11-28 18:11:49 +02001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2011 The ChromiumOS Authors. All rights reserved.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
Kyösti Mälkki5687fc92013-11-28 18:11:49 +020014 */
15
Kyösti Mälkkiab56b3b2013-11-28 16:44:51 +020016#include <rules.h>
Kyösti Mälkki5687fc92013-11-28 18:11:49 +020017#include <bootmode.h>
Kyösti Mälkki5687fc92013-11-28 18:11:49 +020018#include <vendorcode/google/chromeos/chromeos.h>
Kyösti Mälkki5687fc92013-11-28 18:11:49 +020019
Kyösti Mälkkiab56b3b2013-11-28 16:44:51 +020020#if ENV_RAMSTAGE
21static int gfx_init_done = -1;
22
23int gfx_get_init_done(void)
24{
25 if (gfx_init_done < 0)
26 return 0;
27 return gfx_init_done;
28}
29
30void gfx_set_init_done(int done)
31{
32 gfx_init_done = done;
33}
34#endif
Aaron Durbinbc98cc62015-09-02 09:21:36 -050035
36int display_init_required(void)
37{
Furquan Shaikha6c5ddd2016-07-22 06:59:40 -070038 /* For Chrome OS always honor vboot_handoff_skip_display_init(). */
Aaron Durbinbc98cc62015-09-02 09:21:36 -050039 if (IS_ENABLED(CONFIG_CHROMEOS))
Furquan Shaikha6c5ddd2016-07-22 06:59:40 -070040 return !vboot_handoff_skip_display_init();
Aaron Durbinbc98cc62015-09-02 09:21:36 -050041
42 /* By default always initialize display. */
43 return 1;
44}