From 3f40a89316c8fe6ecb4a8eb66dd8d4c4e764087b Mon Sep 17 00:00:00 2001 From: "Kate J. Temkin" Date: Tue, 3 Apr 2018 03:56:50 -0600 Subject: [PATCH] fusee: don't flicker as we turn the display on Defers backlight init until the framebuffer's fully set up. --- fusee/src/hwinit.h | 3 +++ fusee/src/hwinit/di.c | 11 ++++++++--- fusee/src/hwinit/di.h | 4 ++++ 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/fusee/src/hwinit.h b/fusee/src/hwinit.h index 543c9638d..78a8824a0 100644 --- a/fusee/src/hwinit.h +++ b/fusee/src/hwinit.h @@ -28,6 +28,9 @@ void display_color_screen(u32 color); /*! Init display in full 1280x720 resolution (32bpp, line stride 768, framebuffer size = 1280*768*4 bytes). */ u32 *display_init_framebuffer(); +/*! Enable or disable the backlight. Should only be called when the screen is completely set up, to avoid flickering. */ +void display_enable_backlight(bool on); + void cluster_boot_cpu0(u64 entry, u32 ns_disable); #endif diff --git a/fusee/src/hwinit/di.c b/fusee/src/hwinit/di.c index 8bd7721e1..3b117c67a 100644 --- a/fusee/src/hwinit/di.c +++ b/fusee/src/hwinit/di.c @@ -183,14 +183,19 @@ void display_color_screen(u32 color) GPIO_6(0x24) = GPIO_6(0x24) & 0xFFFFFFFE | 1; } +void display_enable_backlight(bool on) { + GPIO_6(0x24) = GPIO_6(0x24) & 0xFFFFFFFE | !!on; +} + + u32 *display_init_framebuffer(void) { + u32 *lfb_addr = (u32 *)0xC0000000; + //This configures the framebuffer @ 0xC0000000 with a resolution of 1280x720 (line stride 768). exec_cfg((u32 *)DISPLAY_A_BASE, cfg_display_framebuffer, 32); sleep(35000); - GPIO_6(0x24) = GPIO_6(0x24) & 0xFFFFFFFE | 1; - - return (u32 *)0xC0000000; + return lfb_addr; } diff --git a/fusee/src/hwinit/di.h b/fusee/src/hwinit/di.h index 30fb1b512..a1058823c 100644 --- a/fusee/src/hwinit/di.h +++ b/fusee/src/hwinit/di.h @@ -2,6 +2,7 @@ #define _DI_H_ #include "types.h" +#include /*! Display registers. */ #define _DIREG(reg) ((reg) * 4) @@ -53,4 +54,7 @@ void display_color_screen(u32 color); /*! Init display in full 1280x720 resolution (32bpp, line stride 768, framebuffer size = 1280*768*4 bytes). */ u32 *display_init_framebuffer(void); +/*! Enable or disable the backlight. Should only be called when the screen is completely set up, to avoid flickering. */ +void display_enable_backlight(bool on); + #endif