From ba6984786294ad4e849473584611d3406f89a1d3 Mon Sep 17 00:00:00 2001 From: Janne Grunau Date: Sat, 25 Nov 2023 12:07:29 +0100 Subject: [PATCH] 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 --- config.h | 2 ++ src/display.c | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/config.h b/config.h index 7ba01566..31c89387 100644 --- a/config.h +++ b/config.h @@ -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 diff --git a/src/display.c b/src/display.c index 7145030c..19c5b697 100644 --- a/src/display.c +++ b/src/display.c @@ -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();