Skip to content

Conversation

@Kainarx
Copy link
Contributor

@Kainarx Kainarx commented Dec 10, 2025

ESP-BSP Pull Request checklist

Note: For new BSPs create a PR with this link.

  • Version of modified component bumped
  • CI passing

Change description

Please describe your change here


Note

Enable DMA2D on IDF ≥6.0 using esp_lcd_dpi_panel_enable_dma2d and conditionally keep .flags.use_dma2d for older IDF across ILI9881C, LT8912B, and ST7796; bump component versions.

  • LCD (MIPI DSI) drivers:
    • DMA2D enable for IDF ≥6.0: Call esp_lcd_dpi_panel_enable_dma2d() in esp_lcd_ili9881c.c, esp_lcd_lt8912b.c, esp_lcd_st7796_mipi.c.
    • Config macros updated:
      • Add #include "esp_idf_version.h" and gate .flags.use_dma2d = true with #if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(6, 0, 0) in esp_lcd_ili9881c.h and esp_lcd_st7796.h.
      • Introduce ESP_LCD_DPI_PANEL_DMA2D_FLAGS() in esp_lcd_lt8912b.h and apply it across DPI timing macros.
  • Version bumps:
    • components/lcd/esp_lcd_ili9881c/idf_component.yml: 1.0.2
    • components/lcd/esp_lcd_lt8912b/idf_component.yml: 0.1.2
    • components/lcd/esp_lcd_st7796/idf_component.yml: 1.3.4
  • Misc:
    • Update SPDX years to 2024-2025 in touched files.

Written by Cursor Bugbot for commit 8c798f9. This will update automatically on new commits. Configure here.

@Kainarx
Copy link
Contributor Author

Kainarx commented Dec 10, 2025

@suda-morris @espzav PTAL,thanks

@github-actions github-actions bot changed the title fix(lcd): use new mipi dma2d api fix(lcd): use new mipi dma2d api (BSP-755) Dec 10, 2025
@Kainarx Kainarx force-pushed the fix/update_mipi_dma2d_in_idf6.0 branch from 4d186b9 to 8c798f9 Compare December 10, 2025 08:50
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is being reviewed by Cursor Bugbot

Details

Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

// Enable DMA2D for ESP-IDF 6.0+
ESP_GOTO_ON_ERROR(esp_lcd_dpi_panel_enable_dma2d(*ret_panel), err, TAG,
"enable DMA2D failed");
#endif
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: DPI panel not deleted on DMA2D enable failure

When esp_lcd_dpi_panel_enable_dma2d() fails after the DPI panel has already been successfully created by esp_lcd_new_panel_dpi(), the error handler only frees the driver struct and resets the GPIO, but does not delete the created DPI panel. This causes a resource leak since *ret_panel (or panel_handle) contains a valid panel pointer that is never cleaned up on this failure path.

Additional Locations (2)

Fix in Cursor Fix in Web


#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(6, 0, 0)
// Enable DMA2D for ESP-IDF 6.0+
ESP_GOTO_ON_ERROR(esp_lcd_dpi_panel_enable_dma2d(*ret_panel), err, TAG,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since DMA2D is not a very stable feature, it will have restriction when we enable ext mem encryption. Can we give the choice to the user instead of always enabling the dma2d mode?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It can be moved into BSP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants