Add EPD waveform controller for Nook Glowlight 4 Plus (bnrv1300)#597
Open
backcountrymountains wants to merge 1 commit into
Open
Add EPD waveform controller for Nook Glowlight 4 Plus (bnrv1300)#597backcountrymountains wants to merge 1 commit into
backcountrymountains wants to merge 1 commit into
Conversation
4 tasks
1399c80 to
a9a6ddf
Compare
The GL4 Plus (bnrv1300) uses an AllWinner "Emperor" platform that is architecturally distinct from the GL4/4e (Freescale NTX). Split it into its own DeviceInfo ID and wire it to a dedicated EPD controller. NookEmperorEPDController uses ViewRootImpl.setRefreshMode(int) via reflection — a B&N-specific addition to their Android 8.1 framework. The call routes through SurfaceFlinger → HWC (hwcomposer.virgo.so) → hwc_set_layer_refresh_mode → layer->refreshMode → /dev/disp ioctl. Because HWC reads layer->refreshMode during composition, the waveform is applied to the correct (incoming) buffer, not the currently-displayed one. GC16 (mode 0x4) confirmed working on device: kernel dmesg shows mode=0x200004 on full-page refreshes. No root or Magisk module required. Fallback order: 1. ViewRootImpl.setRefreshMode (B&N Android 8.1) 2. SurfaceControl.setRefreshMode via mSurfaceControl (AOSP Android 10+) 3. sysfs force_update_mode write (requires Magisk epd_gc16 module) Note: this PR overlaps with koreader#592 on DeviceInfo.kt (same bnrv1300 split) and on EPDFactory.kt (koreader#592 adds NOOK_GL4PLUS to the NGL4 group; this PR gives it a dedicated controller instead). Should be merged after koreader#592 or Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
a9a6ddf to
286c149
Compare
Contributor
Author
|
Rebased onto master after #592 merged and resolved conflicts:
Also fixed all Codacy "Unnecessary long whitespace" warnings in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The Nook Glowlight 4 Plus (bnrv1300) uses an AllWinner "Emperor" platform that is architecturally distinct from the GL4/4e (Freescale NTX). This PR splits it into its own
DeviceInfoID and adds a dedicated EPD controller that enables GC16 waveform without root or a Magisk module.DeviceInfo.kt: splitbnrv1300from theNOOK_GL4group intoNOOK_GL4PLUSEPDFactory.kt: routeNOOK_GL4PLUStoNookEmperorEPDControllerinstead ofNGL4EPDControllerNookEmperorEPDController.kt: new controller usingViewRootImpl.setRefreshModevia reflectionTestActivity.kt: add "Nook GL4 Plus" entry to the EInk test driver map (per @hugleo's request in Add lights support for Nook Glowlight 4 Plus (bnrv1300) #592)How it works
B&N's Android 8.1 firmware adds
setRefreshMode(int)directly toViewRootImpl. The controller reaches it via reflection and the call routes through SurfaceFlinger → HWC (hwcomposer.virgo.so) →hwc_set_layer_refresh_mode→layer->refreshMode→/dev/dispioctl. Because HWC readslayer->refreshModeduring composition, the waveform is applied to the correct (incoming) buffer.Fallback order if reflection fails:
ViewRootImpl.setRefreshMode— B&N Android 8.1 (preferred, confirmed working)SurfaceControl.setRefreshModeviamSurfaceControlfield — AOSP Android 10+force_update_modewrite — last resort, requires Magiskepd_gc16moduleTesting
Confirmed on a Nook Glowlight 4 Plus running B&N Android 8.1 (bnrv1300):
ViewRootImpl.setRefreshModepath active on launch (logged)mode=0x4) confirmed in kernel dmesg (mode=0x200004) on full-page refreshesNo setup required
Unlike some EPD drivers, this controller needs no ADB properties, no
appopsgrants, and no Magisk modules. No wiki page is needed.🤖 Generated with Claude Code
This change is