Kyösti Mälkki | 5687fc9 | 2013-11-28 18:11:49 +0200 | [diff] [blame] | 1 | /* |
| 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älkki | 5687fc9 | 2013-11-28 18:11:49 +0200 | [diff] [blame] | 14 | */ |
| 15 | |
Kyösti Mälkki | ab56b3b | 2013-11-28 16:44:51 +0200 | [diff] [blame] | 16 | #include <rules.h> |
Kyösti Mälkki | 5687fc9 | 2013-11-28 18:11:49 +0200 | [diff] [blame] | 17 | #include <bootmode.h> |
Kyösti Mälkki | 5687fc9 | 2013-11-28 18:11:49 +0200 | [diff] [blame] | 18 | #include <vendorcode/google/chromeos/chromeos.h> |
Kyösti Mälkki | 5687fc9 | 2013-11-28 18:11:49 +0200 | [diff] [blame] | 19 | |
Kyösti Mälkki | ab56b3b | 2013-11-28 16:44:51 +0200 | [diff] [blame] | 20 | #if ENV_RAMSTAGE |
| 21 | static int gfx_init_done = -1; |
| 22 | |
| 23 | int gfx_get_init_done(void) |
| 24 | { |
| 25 | if (gfx_init_done < 0) |
| 26 | return 0; |
| 27 | return gfx_init_done; |
| 28 | } |
| 29 | |
| 30 | void gfx_set_init_done(int done) |
| 31 | { |
| 32 | gfx_init_done = done; |
| 33 | } |
| 34 | #endif |
Aaron Durbin | bc98cc6 | 2015-09-02 09:21:36 -0500 | [diff] [blame] | 35 | |
| 36 | int display_init_required(void) |
| 37 | { |
Furquan Shaikh | a6c5ddd | 2016-07-22 06:59:40 -0700 | [diff] [blame] | 38 | /* For Chrome OS always honor vboot_handoff_skip_display_init(). */ |
Aaron Durbin | bc98cc6 | 2015-09-02 09:21:36 -0500 | [diff] [blame] | 39 | if (IS_ENABLED(CONFIG_CHROMEOS)) |
Furquan Shaikh | a6c5ddd | 2016-07-22 06:59:40 -0700 | [diff] [blame] | 40 | return !vboot_handoff_skip_display_init(); |
Aaron Durbin | bc98cc6 | 2015-09-02 09:21:36 -0500 | [diff] [blame] | 41 | |
| 42 | /* By default always initialize display. */ |
| 43 | return 1; |
| 44 | } |