@@ -606,6 +606,10 @@ esp_err_t bsp_display_new_with_handles(const bsp_display_config_t *config, bsp_l
606606#endif
607607 dpi_config .num_fbs = CONFIG_BSP_LCD_DPI_BUFFER_NUMS ;
608608
609+ #if CONFIG_BSP_LCD_USE_DMA2D && (ESP_IDF_VERSION < ESP_IDF_VERSION_VAL (6 , 0 , 0 ))
610+ dpi_config .flags .use_dma2d = true;
611+ #endif
612+
609613 ek79007_vendor_config_t vendor_config = {
610614 .mipi_config = {
611615 .dsi_bus = mipi_dsi_bus ,
@@ -619,6 +623,11 @@ esp_err_t bsp_display_new_with_handles(const bsp_display_config_t *config, bsp_l
619623 .vendor_config = & vendor_config ,
620624 };
621625 ESP_GOTO_ON_ERROR (esp_lcd_new_panel_ek79007 (io , & lcd_dev_config , & disp_panel ), err , TAG , "New LCD panel EK79007 failed" );
626+
627+ #if CONFIG_BSP_LCD_USE_DMA2D && ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL (6 , 0 , 0 )
628+ ESP_GOTO_ON_ERROR (esp_lcd_dpi_panel_enable_dma2d (disp_panel ), err , TAG , "LCD panel enable DMA2D failed" );
629+ #endif
630+
622631 ESP_GOTO_ON_ERROR (esp_lcd_panel_reset (disp_panel ), err , TAG , "LCD panel reset failed" );
623632 ESP_GOTO_ON_ERROR (esp_lcd_panel_init (disp_panel ), err , TAG , "LCD panel init failed" );
624633#elif CONFIG_BSP_LCD_TYPE_1280_800
@@ -631,6 +640,10 @@ esp_err_t bsp_display_new_with_handles(const bsp_display_config_t *config, bsp_l
631640#endif
632641 dpi_config .num_fbs = CONFIG_BSP_LCD_DPI_BUFFER_NUMS ;
633642
643+ #if CONFIG_BSP_LCD_USE_DMA2D && ESP_IDF_VERSION < ESP_IDF_VERSION_VAL (6 , 0 , 0 )
644+ dpi_config .flags .use_dma2d = true;
645+ #endif
646+
634647 ili9881c_vendor_config_t vendor_config = {
635648 .mipi_config = {
636649 .dsi_bus = mipi_dsi_bus ,
@@ -645,6 +658,11 @@ esp_err_t bsp_display_new_with_handles(const bsp_display_config_t *config, bsp_l
645658 .vendor_config = & vendor_config ,
646659 };
647660 ESP_GOTO_ON_ERROR (esp_lcd_new_panel_ili9881c (io , & lcd_dev_config , & disp_panel ), err , TAG , "New LCD panel ILI9881C failed" );
661+
662+ #if CONFIG_BSP_LCD_USE_DMA2D && ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL (6 , 0 , 0 )
663+ ESP_GOTO_ON_ERROR (esp_lcd_dpi_panel_enable_dma2d (disp_panel ), err , TAG , "LCD panel enable DMA2D failed" );
664+ #endif
665+
648666 ESP_GOTO_ON_ERROR (esp_lcd_panel_reset (disp_panel ), err , TAG , "LCD panel reset failed" );
649667 ESP_GOTO_ON_ERROR (esp_lcd_panel_init (disp_panel ), err , TAG , "LCD panel init failed" );
650668 ESP_GOTO_ON_ERROR (esp_lcd_panel_disp_on_off (disp_panel , true), err , TAG , "LCD panel ON failed" );
@@ -679,6 +697,12 @@ esp_err_t bsp_display_new_with_handles(const bsp_display_config_t *config, bsp_l
679697 LT8912B_1920x1080_PANEL_30HZ_DPI_CONFIG_WITH_FBS (CONFIG_BSP_LCD_DPI_BUFFER_NUMS )
680698 };
681699
700+ #if CONFIG_BSP_LCD_USE_DMA2D && ESP_IDF_VERSION < ESP_IDF_VERSION_VAL (6 , 0 , 0 )
701+ for (int i = 0 ; i < sizeof (dpi_configs ) / sizeof (dpi_configs [0 ]); i ++ ) {
702+ dpi_configs [i ].flags .use_dma2d = true;
703+ }
704+ #endif
705+
682706 const esp_lcd_panel_lt8912b_video_timing_t video_timings [] = {
683707 ESP_LCD_LT8912B_VIDEO_TIMING_800x600_60Hz (),
684708 ESP_LCD_LT8912B_VIDEO_TIMING_1024x768_60Hz (),
@@ -736,6 +760,11 @@ esp_err_t bsp_display_new_with_handles(const bsp_display_config_t *config, bsp_l
736760 .avi = io_avi ,
737761 };
738762 ESP_ERROR_CHECK (esp_lcd_new_panel_lt8912b (& io_all , & panel_config , & disp_panel ));
763+
764+ #if CONFIG_BSP_LCD_USE_DMA2D && ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL (6 , 0 , 0 )
765+ ESP_GOTO_ON_ERROR (esp_lcd_dpi_panel_enable_dma2d (disp_panel ), err , TAG , "LCD panel enable DMA2D failed" );
766+ #endif
767+
739768 ESP_GOTO_ON_ERROR (esp_lcd_panel_reset (disp_panel ), err , TAG , "LCD panel reset failed" );
740769 ESP_GOTO_ON_ERROR (esp_lcd_panel_init (disp_panel ), err , TAG , "LCD panel init failed" );
741770
@@ -977,7 +1006,7 @@ lv_display_t *bsp_display_start(void)
9771006 .hdmi_resolution = BSP_HDMI_RES_NONE ,
9781007#endif
9791008 .dsi_bus = {
980- .phy_clk_src = MIPI_DSI_PHY_CLK_SRC_DEFAULT ,
1009+ .phy_clk_src = 0 , // let the driver to choose the default clock source
9811010 .lane_bit_rate_mbps = BSP_LCD_MIPI_DSI_LANE_BITRATE_MBPS ,
9821011 }
9831012 },
0 commit comments