Skip to content

fix: adjust layer1 dma2d config#397

Merged
guowei0105 merged 3 commits intoOneKeyHQ:mainfrom
guowei0105:new-boot
Nov 25, 2025
Merged

fix: adjust layer1 dma2d config#397
guowei0105 merged 3 commits intoOneKeyHQ:mainfrom
guowei0105:new-boot

Conversation

@guowei0105
Copy link
Copy Markdown
Contributor

@guowei0105 guowei0105 commented Nov 25, 2025

Summary by CodeRabbit

  • Bug Fixes
    • Fixed display initialization to ensure framebuffer is properly cleared on startup.
    • Improved display rendering timing logic for more reliable display updates.

✏️ Tip: You can customize this high-level summary in your review settings.

@guowei0105 guowei0105 requested a review from a team as a code owner November 25, 2025 09:44
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Nov 25, 2025

Walkthrough

LCD display initialization modifications in the Trezor UI module. Framebuffer memory is zeroed after LTDC layer setup, and DMA2D idle detection logic is inverted from READY to BUSY state checking.

Changes

Cohort / File(s) Summary
LCD display initialization
core/embed/extmod/modtrezorui/mipi_lcd.c
Framebuffer memory cleared via memset after LTDC configuration; DMA2D idle wait condition inverted from polling READY to polling BUSY state

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

  • Verify memory size calculation (hres * vres * 2) matches framebuffer layout
  • Confirm DMA2D condition inversion doesn't introduce timing or synchronization issues
  • Check initialization sequence remains correct after changes

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed Title refers to DMA2D config adjustment, which matches the actual changes to DMA2D idle waiting condition and framebuffer initialization.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

📝 Customizable high-level summaries are now available in beta!

You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.

  • Provide your own instructions using the high_level_summary_instructions setting.
  • Format the summary however you like (bullet lists, tables, multi-section layouts, contributor stats, etc.).
  • Use high_level_summary_in_walkthrough to move the summary from the description to the walkthrough section.

Example instruction:

"Divide the high-level summary into five sections:

  1. 📝 Description — Summarize the main change in 50–60 words, explaining what was done.
  2. 📓 References — List relevant issues, discussions, documentation, or related PRs.
  3. 📦 Dependencies & Requirements — Mention any new/updated dependencies, environment variable changes, or configuration updates.
  4. 📊 Contributor Summary — Include a Markdown table showing contributions:
    | Contributor | Lines Added | Lines Removed | Files Changed |
  5. ✔️ Additional Notes — Add any extra reviewer context.
    Keep each section concise (under 200 words) and use bullet or numbered lists for clarity."

Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later.


Comment @coderabbitai help to get the list of available commands and usage tips.

@revan-zhang
Copy link
Copy Markdown
Contributor

revan-zhang commented Nov 25, 2025

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
core/embed/extmod/modtrezorui/mipi_lcd.c (1)

727-728: Use lcd_params.bbp instead of hardcoded 2.

Hardcoded value breaks if pixel format changes.

-    memset((void*)DISPLAY_MEMORY_BASE, 0,
-           lcd_params.hres * lcd_params.vres * 2);
+    memset((void*)DISPLAY_MEMORY_BASE, 0,
+           lcd_params.hres * lcd_params.vres * lcd_params.bbp);
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to data retention organization setting

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 09f6fe8 and 3158aea.

📒 Files selected for processing (1)
  • core/embed/extmod/modtrezorui/mipi_lcd.c (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Gen check
  • GitHub Check: Style check
  • GitHub Check: Defs check

Comment thread core/embed/extmod/modtrezorui/mipi_lcd.c
@guowei0105 guowei0105 merged commit d6b021d into OneKeyHQ:main Nov 25, 2025
9 checks passed
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.

4 participants