Hi,
Finally, i found a solution (but not the explanation).
My "Ft81x_Init_Font" function is designed as follow :
This function is called once for each of the 5 fonts just after the GPU initialization.
By adding the following sequence at each new page, the problem has been fixed.
But i don't understand why the first SetFont commands do not work sometimes.
Is this command needed to be sent at each new page?
If not, what my software needs to wait for before sending the first SetFont commands?
Regards
Finally, i found a solution (but not the explanation).
My "Ft81x_Init_Font" function is designed as follow :
Code Select
void Ft81x_Init_Font(
ft_gpu_hal_context* pt_host, /* host data */
ft_gpu_metric_block* pt_font_metrics, /* font metrics data */
uint8* pt_font_raw_data, /* font raw data */
uint32 font_raw_data_size, /* font raw data size */
uint16 handle_id, /* GPU handle identifier */
uint32 gram_address /* GPU General RAM address to store the font */
)
{
/* load fonts metrics and data in GRAM */
Ft_Hal_Write_Mem(pt_host, gram_address, (uint8*) pt_font_metrics, FONT_METRIC_SIZE);
Ft_Hal_Write_Mem(pt_host, gram_address + FONT_METRIC_SIZE, (uint8*) pt_font_raw_data, font_raw_data_size);
Ft81x_Start_Page(pt_host);
/* configure the handle */
Ft_Hal_Write_Cmd32(pt_host, BITMAP_HANDLE(handle_id));
Ft_Hal_Write_Cmd32(pt_host, BITMAP_SOURCE(raw_data_add));
Ft_Hal_Write_Cmd32(pt_host, BITMAP_LAYOUT(format, stride, max_height));
Ft_Hal_Write_Cmd32(pt_host, BITMAP_SIZE(NEAREST, BORDER, BORDER, max_width, max_height));
/* load the font in Coprocessor */
Ft_Gpu_CoCmd_SetFont(pt_host, handle_id, gram_address);
Ft81x_End_Page(pt_host);
}
This function is called once for each of the 5 fonts just after the GPU initialization.
Code Select
/* initialize GPU */
Ft81x_Init(&Gpu);
/* load fonts in GPU memory */
Ft81x_Init_Font(&Gpu, (s_ft_gpu_metric_block*) Font1_Metrics, (ubyte*) Font1, FONT1_RAW_BITMAP_SIZE, HANDLE_1, RAM_ADDR1);
Ft81x_Init_Font(&Gpu, (s_ft_gpu_metric_block*) Font2_Metrics, (ubyte*) Font2, FONT2_RAW_BITMAP_SIZE, HANDLE_2, RAM_ADDR2);
Ft81x_Init_Font(&Gpu, (s_ft_gpu_metric_block*) Font3_Metrics, (ubyte*) Font3, FONT3_RAW_BITMAP_SIZE, HANDLE_3, RAM_ADDR3);
Ft81x_Init_Font(&Gpu, (s_ft_gpu_metric_block*) Font4_Metrics, (ubyte*) Font4, FONT4_RAW_BITMAP_SIZE, HANDLE_4, RAM_ADDR4);
Ft81x_Init_Font(&Gpu, (s_ft_gpu_metric_block*) Font5_Metrics, (ubyte*) Font5, FONT5_RAW_BITMAP_SIZE, HANDLE_5, RAM_ADDR5);
By adding the following sequence at each new page, the problem has been fixed.
Code Select
Ft_Hal_Write_Cmd32(pt_host, BITMAP_HANDLE(handle_id));
Ft_Hal_Write_Cmd32(pt_host, BITMAP_SOURCE(raw_data_add));
Ft_Hal_Write_Cmd32(pt_host, BITMAP_LAYOUT(format, stride, max_height));
Ft_Hal_Write_Cmd32(pt_host, BITMAP_SIZE(NEAREST, BORDER, BORDER, max_width, max_height));
Ft_Gpu_CoCmd_SetFont(pt_host, handle_id, gram_address);
But i don't understand why the first SetFont commands do not work sometimes.
Is this command needed to be sent at each new page?
If not, what my software needs to wait for before sending the first SetFont commands?
Regards