nyx: di: Set display id we got from bootloader

This commit is contained in:
CTCaer 2020-12-11 17:49:06 +02:00
parent 14a048a496
commit ad560b650e
4 changed files with 16 additions and 1 deletions

View file

@ -605,6 +605,15 @@ u16 display_get_decoded_panel_id()
return _display_id; return _display_id;
} }
void display_set_decoded_panel_id(u32 id)
{
// Decode Display ID.
_display_id = ((id >> 8) & 0xFF00) | (id & 0xFF);
if ((_display_id & 0xFF) == PANEL_JDI_XXX062M)
_display_id = PANEL_JDI_XXX062M;
}
void display_color_screen(u32 color) void display_color_screen(u32 color)
{ {
exec_cfg((u32 *)DISPLAY_A_BASE, cfg_display_one_color, 8); exec_cfg((u32 *)DISPLAY_A_BASE, cfg_display_one_color, 8);

View file

@ -695,8 +695,9 @@ void display_init();
void display_backlight_pwm_init(); void display_backlight_pwm_init();
void display_end(); void display_end();
/*! Get Display panel ID. */ /*! Get/Set Display panel ID. */
u16 display_get_decoded_panel_id(); u16 display_get_decoded_panel_id();
void display_set_decoded_panel_id(u32 id);
/*! Show one single color on the display. */ /*! Show one single color on the display. */
void display_color_screen(u32 color); void display_color_screen(u32 color);

View file

@ -130,4 +130,6 @@ void sdmmc_storage_init_wait_sd();
int sdmmc_storage_init_sd(sdmmc_storage_t *storage, sdmmc_t *sdmmc, u32 bus_width, u32 type); int sdmmc_storage_init_sd(sdmmc_storage_t *storage, sdmmc_t *sdmmc, u32 bus_width, u32 type);
int sdmmc_storage_init_gc(sdmmc_storage_t *storage, sdmmc_t *sdmmc); int sdmmc_storage_init_gc(sdmmc_storage_t *storage, sdmmc_t *sdmmc);
u32 sd_storage_ssr_get_au(sdmmc_storage_t *storage);
#endif #endif

View file

@ -366,6 +366,9 @@ void nyx_init_load_res()
// Clear info magic. // Clear info magic.
nyx_str->info.magic = 0; nyx_str->info.magic = 0;
// Set display id from previous initialization.
display_set_decoded_panel_id(nyx_str->info.disp_id);
// Initialize gfx console. // Initialize gfx console.
gfx_init_ctxt((u32 *)LOG_FB_ADDRESS, 1280, 656, 656); gfx_init_ctxt((u32 *)LOG_FB_ADDRESS, 1280, 656, 656);
gfx_con_init(); gfx_con_init();