View Single Post
Old 03-27-2020, 12:55 AM   #6
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,506
Karma: 26047202
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
I naively read that as simply swapping the epdc to the inverted palette like the K4, which simply involves an ioctl to set the fb's vinfo grayscale field to 2 (GRAYSCALE_8BIT_INVERTED), but I don't have the device either .

(The ioctl approach *should* work everywhere, though, but I don't remember testing this all that much.
[EDIT: Even works properly on a Kobo, where the fb cmap is completely bogus]
[EDITē: Which makes sense, as it turns out that in this case, the epdc driver simply enforces the EPDC_FLAG_ENABLE_INVERSION flag ]
TL;DR: Which means that, yes, this (ioctl) will enable the bare-minimum HW nightmode automagically everywhere without having to handle it on a per-refresh basis. No fancy waveform modes or fl trickery, though (unless ligl bases its decisions on checking the grayscale flag's value).).

EDIT: On the other hand, on Zelda/Rex, there *is* an MXCFB_SET_NIGHTMODE ioctl. I'm not *quite* sure how it's supposed to work (especially since it doesn't appear to have anything to do with the mxcfb_nightmode_ctrl struct, which appears to be handled by the fl driver, on Zelda, at least). And it also doesn't appear to be plugged into anything in the driver code?
I do have strace builds around for Zelda/Rex if someone's curious (the one shipped w/ USBNet will prooobably segfault on Zelda/Rex).

Last edited by NiLuJe; 03-27-2020 at 01:25 AM.
NiLuJe is offline   Reply With Quote