Skip to content

Display driver suspend API improvement#7006

Open
bleska wants to merge 1 commit into
mainfrom
bleska/T3W1_display_driver_suspend_API_refactor
Open

Display driver suspend API improvement#7006
bleska wants to merge 1 commit into
mainfrom
bleska/T3W1_display_driver_suspend_API_refactor

Conversation

@bleska
Copy link
Copy Markdown
Contributor

@bleska bleska commented May 27, 2026

Remove bool touch_wakeup_enabled parameter from display_suspend() and display_resume() — it was too specific to touch-panel hardware and leaked touch wakeup policy into the display driver.

Move the branching logic (light-suspend vs. full deinit) up to suspend_io.c, which is the appropriate level of abstraction. display_resume() now handles both cases internally: light-resume when the driver is still initialized, and full reinit when it was fully deinitialized during suspend.

Remove `bool touch_wakeup_enabled` from `display_suspend()` and
`display_resume()`. The parameter was too specific to touch-panel
hardware and leaked touch wakeup policy into the display driver.

The branching between light-suspend and full deinit is moved to
`suspend_io.c`, which is the appropriate level of abstraction.
`display_resume()` now handles both cases internally: light-resume
when the driver is still initialized, and full reinit when it was
fully deinitialized during suspend.

[no changelog]
@bleska bleska self-assigned this May 27, 2026
@bleska bleska added the T3W1 Trezor Safe 7 label May 27, 2026
@bleska bleska added this to Firmware May 27, 2026
@github-project-automation github-project-automation Bot moved this to 🔎 Needs review in Firmware May 27, 2026
@bleska bleska moved this from 🔎 Needs review to 🏃‍♀️ In progress in Firmware May 27, 2026
@bleska bleska added the no-QA On PR-merge, automatically transition status in the "Firmware" project to "Done (no QA)" state. label May 27, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 27, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: aa0068d4-92b7-40fd-ada5-75a28e19cdba

📥 Commits

Reviewing files that changed from the base of the PR and between 6c06011 and 6fb4957.

📒 Files selected for processing (3)
  • core/embed/io/display/inc/io/display.h
  • core/embed/io/display/ltdc_dsi/display_driver.c
  • core/embed/io/suspend/stm32u5/suspend_io.c

Walkthrough

This PR simplifies the display suspend/resume API by removing a touch_wakeup_enabled boolean parameter from both display_suspend and display_resume functions. The touch-wakeup-conditional logic is moved from the driver implementation to the callers in suspend IO, which now determine touch wakeup status upfront and conditionally invoke either display_suspend() or full display_deinit() during suspend, and unconditionally call the simplified display_resume() during resume. The driver now handles suspend/resume state transitions solely based on stored wakeup parameters, and all USE_TOUCH_WAKEUP conditional branches in the driver are removed.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • trezor/trezor-firmware#6900: The retrieved PR adds/threads a touch_wakeup_enabled flag through display_suspend/display_resume and suspend handling for touch-to-wake, while this PR removes that flag and simplifies the same suspend/resume APIs to depend only on stored wakeup parameters—the changes are directly connected at the same code points.

Suggested reviewers

  • TychoVrahe
  • matejcik
  • obrusvit
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The description clearly explains the rationale and implementation details of the API change, but does not follow the repository's template structure for core developers. Follow the template: assign yourself, add to Firmware project with priority/team/sprint, and set development status (Draft=In Progress, Final=Needs Review) as applicable.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Display driver suspend API improvement' accurately describes the main change: simplifying the suspend/resume API by removing the touch_wakeup_enabled parameter.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch bleska/T3W1_display_driver_suspend_API_refactor

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@github-actions
Copy link
Copy Markdown

en main(all)

model device_test click_test persistence_test
T2T1 test(all) main(all) test(all) main(all) test(all) main(all)
T3B1 test(all) main(all) test(all) main(all) test(all) main(all)
T3T1 test(all) main(all) test(all) main(all) test(all) main(all)
T3W1 test(all) main(all) test(all) main(all) test(all) main(all)

Latest CI run: 26511661689

@bleska bleska marked this pull request as ready for review May 27, 2026 14:18
@bleska bleska requested a review from TychoVrahe as a code owner May 27, 2026 14:18
@bleska bleska moved this from 🏃‍♀️ In progress to 🔎 Needs review in Firmware May 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-QA On PR-merge, automatically transition status in the "Firmware" project to "Done (no QA)" state. T3W1 Trezor Safe 7

Projects

Status: 🔎 Needs review

Development

Successfully merging this pull request may close these issues.

1 participant