feat: Add displayGrayscaleBase method for differential refresh

(#2334)

Introduces a new display method that prepares the framebuffer as a base
frame for grayscale overlays. On X3 panels, this uses the OEM
differential base waveform (AA-pre-BW) without forcing a resync. Other
panels fall back to normal display with configurable refresh mode.


Dependent upon matching SDK commit to work
This commit is contained in:
Justin Mitchell
2026-06-24 07:53:19 -04:00
committed by GitHub
parent 9ad2da0950
commit f6e59aab72
7 changed files with 80 additions and 3 deletions
+13 -1
View File
@@ -294,7 +294,19 @@ void XtcReaderActivity::renderPage() {
}
}
ReaderUtils::displayWithRefreshCycle(renderer, pagesUntilFullRefresh);
if (pagesUntilFullRefresh <= 1) {
// Periodic ghost cleanup: scrub via the normal path, then run the
// settle flavor of the grayscale base pass (DTM planes are equal after
// the display sync, so only the gentle reinforcement cells fire).
renderer.displayBuffer(HalDisplay::HALF_REFRESH);
renderer.preconditionGrayscale();
pagesUntilFullRefresh = SETTINGS.getRefreshFrequency();
} else {
// OEM grayscale pipeline base: differential "AA-pre-BW(mid)" update as
// the page turn on X3; plain FAST refresh on X4 (previous behavior).
renderer.displayGrayscaleBase(HalDisplay::FAST_REFRESH);
pagesUntilFullRefresh--;
}
// Pass 2: LSB buffer - mark DARK gray only (XTH value 1)
// In LUT: 0 bit = apply gray effect, 1 bit = untouched