display: Add NO_DISPLAY build config to skip display init

Required for stage 1 loader to allow chainloaded display/dcp experiments
to start with the state left by iboot.

Signed-off-by: Janne Grunau <j@jannau.net>
This commit is contained in:
Janne Grunau 2023-11-25 12:07:29 +01:00 committed by Hector Martin
parent 30485ead25
commit ba69847862
2 changed files with 14 additions and 0 deletions

View file

@ -12,6 +12,8 @@
// Minimal build for bring-up
//#define BRINGUP
// Disable display configuration / bringup on desktop devices
//#define NO_DISPLAY
// Print RTKit logs to the console
//#define RTKIT_SYSLOG

View file

@ -1,5 +1,7 @@
/* SPDX-License-Identifier: MIT */
#include "../build/build_cfg.h"
#include "display.h"
#include "adt.h"
#include "assert.h"
@ -225,6 +227,11 @@ int display_start_dcp(void)
if (iboot)
return 0;
#ifdef NO_DISPLAY
printf("display: NO_DISPLAY!\n");
return 0;
#endif
const display_config_t *disp_cfg = &display_config_m1;
if (adt_is_compatible(adt, 0, "J473AP"))
@ -350,6 +357,11 @@ int display_configure(const char *config)
dcp_timing_mode_t want;
struct display_options opts = {0};
#ifdef NO_DISPLAY
printf("display: skip configuration (NO_DISPLAY)\n");
return 0;
#endif
display_parse_mode(config, &want, &opts);
u64 start_time = get_ticks();