mirror of
https://github.com/CTCaer/hekate.git
synced 2025-09-06 17:47:09 +00:00
bdk: display: remove malloc usage
This commit is contained in:
parent
3250b2e32a
commit
a47a6d32c6
2 changed files with 9 additions and 22 deletions
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2018 naehrwert
|
* Copyright (c) 2018 naehrwert
|
||||||
* Copyright (c) 2018-2024 CTCaer
|
* Copyright (c) 2018-2025 CTCaer
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify it
|
* This program is free software; you can redistribute it and/or modify it
|
||||||
* under the terms and conditions of the GNU General Public License,
|
* under the terms and conditions of the GNU General Public License,
|
||||||
|
@ -265,16 +265,9 @@ int display_dsi_vblank_read(u8 cmd, u32 len, void *data)
|
||||||
|
|
||||||
void display_dsi_write(u8 cmd, u32 len, void *data)
|
void display_dsi_write(u8 cmd, u32 len, void *data)
|
||||||
{
|
{
|
||||||
static u8 *fifo8 = NULL;
|
|
||||||
static u32 *fifo32 = NULL;
|
|
||||||
u32 host_control;
|
u32 host_control;
|
||||||
|
u32 fifo32[DSI_STATUS_TX_FIFO_SIZE] = {0};
|
||||||
// Allocate fifo buffer.
|
u8 *fifo8 = (u8 *)fifo32;
|
||||||
if (!fifo32)
|
|
||||||
{
|
|
||||||
fifo32 = malloc(DSI_STATUS_RX_FIFO_SIZE * 8 * sizeof(u32));
|
|
||||||
fifo8 = (u8 *)fifo32;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Prepare data for long write.
|
// Prepare data for long write.
|
||||||
if (len >= 2)
|
if (len >= 2)
|
||||||
|
@ -319,15 +312,8 @@ void display_dsi_write(u8 cmd, u32 len, void *data)
|
||||||
|
|
||||||
void display_dsi_vblank_write(u8 cmd, u32 len, void *data)
|
void display_dsi_vblank_write(u8 cmd, u32 len, void *data)
|
||||||
{
|
{
|
||||||
static u8 *fifo8 = NULL;
|
u32 fifo32[DSI_STATUS_TX_FIFO_SIZE] = {0};
|
||||||
static u32 *fifo32 = NULL;
|
u8 *fifo8 = (u8 *)fifo32;
|
||||||
|
|
||||||
// Allocate fifo buffer.
|
|
||||||
if (!fifo32)
|
|
||||||
{
|
|
||||||
fifo32 = malloc(DSI_STATUS_RX_FIFO_SIZE * 8 * sizeof(u32));
|
|
||||||
fifo8 = (u8 *)fifo32;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Prepare data for long write.
|
// Prepare data for long write.
|
||||||
if (len >= 2)
|
if (len >= 2)
|
||||||
|
@ -571,7 +557,7 @@ void display_init()
|
||||||
* When switching to the 16ff pad brick, the clock lane termination control
|
* When switching to the 16ff pad brick, the clock lane termination control
|
||||||
* is separated from data lane termination. This change of the mipi cal
|
* is separated from data lane termination. This change of the mipi cal
|
||||||
* brings in a bug that the DSI pad clock termination code can't be loaded
|
* brings in a bug that the DSI pad clock termination code can't be loaded
|
||||||
* in one time calibration. Trigger calibration twice.
|
* in one time calibration on T210B01. Trigger calibration twice.
|
||||||
*/
|
*/
|
||||||
reg_write_array((u32 *)MIPI_CAL_BASE, _di_mipi_pad_cal_config, ARRAY_SIZE(_di_mipi_pad_cal_config));
|
reg_write_array((u32 *)MIPI_CAL_BASE, _di_mipi_pad_cal_config, ARRAY_SIZE(_di_mipi_pad_cal_config));
|
||||||
for (u32 i = 0; i < 2; i++)
|
for (u32 i = 0; i < 2; i++)
|
||||||
|
|
|
@ -520,6 +520,7 @@
|
||||||
|
|
||||||
#define DSI_STATUS 0x15
|
#define DSI_STATUS 0x15
|
||||||
#define DSI_STATUS_RX_FIFO_SIZE 0x1F
|
#define DSI_STATUS_RX_FIFO_SIZE 0x1F
|
||||||
|
#define DSI_STATUS_TX_FIFO_SIZE 0x20 // Actual depth is 64.
|
||||||
|
|
||||||
#define DSI_INIT_SEQ_CONTROL 0x1A
|
#define DSI_INIT_SEQ_CONTROL 0x1A
|
||||||
#define DSI_INIT_SEQ_DATA_0 0x1B
|
#define DSI_INIT_SEQ_DATA_0 0x1B
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue