blob: 737dcf93d0485571ec30fa788a49ae5adabcf4a6 [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
Julius Werner6d9c1312019-03-28 13:33:55 -070016#include <assert.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 +020020static int gfx_init_done = -1;
21
22int gfx_get_init_done(void)
23{
24 if (gfx_init_done < 0)
25 return 0;
26 return gfx_init_done;
27}
28
29void gfx_set_init_done(int done)
30{
31 gfx_init_done = done;
32}
Aaron Durbinbc98cc62015-09-02 09:21:36 -050033
34int display_init_required(void)
35{
Joel Kitching6672bd82019-04-10 16:06:21 +080036 /* For vboot, always honor VBOOT_WD_FLAG_DISPLAY_INIT. */
Julius Werner6d9c1312019-03-28 13:33:55 -070037 if (CONFIG(VBOOT)) {
Joel Kitching6672bd82019-04-10 16:06:21 +080038 /* Must always select MUST_REQUEST_DISPLAY when using this
39 function. */
40 if (!CONFIG(VBOOT_MUST_REQUEST_DISPLAY))
Julius Werner6d9c1312019-03-28 13:33:55 -070041 dead_code();
Joel Kitching6672bd82019-04-10 16:06:21 +080042 return vboot_get_working_data()->flags
43 & VBOOT_WD_FLAG_DISPLAY_INIT;
Julius Werner6d9c1312019-03-28 13:33:55 -070044 }
Aaron Durbinbc98cc62015-09-02 09:21:36 -050045
46 /* By default always initialize display. */
47 return 1;
48}