NiLuJe / FBInk

FrameBuffer eInker, a small tool & library to print text & images to an eInk Linux framebuffer
https://www.mobileread.com/forums/showthread.php?t=299110
GNU General Public License v3.0
332 stars 23 forks source link

Kobo Elipsa support (a.k.a, sunxi) #64

Closed NiLuJe closed 3 years ago

NiLuJe commented 3 years ago

Well, that was not fun.


This change is Reviewable

lgtm-com[bot] commented 3 years ago

This pull request introduces 2 alerts when merging 24acf62e8eb495775051dd56ab041b5a8400718d into 9e6b568982dc628ff97c88631987ea977f4cef9e - view on LGTM.com

new alerts:

NiLuJe commented 3 years ago

A few significant quirks:

NiLuJe commented 3 years ago

And now, ping @gtalusan, because I come bearing bug reports ;p.

In no particular order:

Kernel issues:

The issue is slightly gnarlier than the dithering one in that there is enough space in the first 16 bits (even without moving RECT & AUTO to higher bits) to fit all of these, but a lot of the code masks the wrong amount of bytes manually (& 0xFF) instead of using the GET_UPDATE_MODE macro...


nickel/pickel quirks:

The ion stuff was sniffed via a patched strace, as was the disp stuff, although it's also evident in debug logging if you raise disp's debug level: https://github.com/NiLuJe/FBInk/blob/24acf62e8eb495775051dd56ab041b5a8400718d/fbink.c#L2571-L2575

gtalusan commented 3 years ago

Nickel uses its own accelerated dithering instead of the kernel's. You should too.

Don't confuse pointers with uninitialized/doesn't-crash-then-don't-care values.

gtalusan commented 3 years ago

Also CARVEOUT | DMA is probably definitely a bug on our side. CARVEOUT is the way to go. πŸ’― on that.

NiLuJe commented 3 years ago

Nickel uses its own accelerated dithering instead of the kernel's. You should too.

I usually am (well, without the "accelerated" part :D), but the EPDCv2 dithering support available on Mk. 7 was surprisingly decent ;).

Don't confuse pointers with uninitialized/doesn't-crash-then-don't-care values.

I was on the fence, but the fact that they appeared to be close to actual useful pointers in the same ioctl args and deref to "correct" (usually 0 ;p) values was strange ^^.

(Definitely on the "mostly harmless" side of things, though. Although I wouldn't necessarily trust all the cfa_use checks in the kernel to do the right thing...).

NiLuJe commented 3 years ago

Also CARVEOUT | DMA is probably definitely a bug on our side. CARVEOUT is the way to go. 100 on that.

Switched to the carveout in 934616f, at a very quick glance nothing new horribly blew up, thanks ;).

β”Œβ”€(ROOT@europa:pts/1)──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────(~)─┐
└─(2.04:19%:21:55:100%:#)── cat /sys/kernel/debug/ion/heaps/carveout                                                                                                                                                                                                                                                                                   ──(Sun, Jul 11)β”€β”˜
          client              pid             size
----------------------------------------------------
        disp_ion                1         97714176
    finger_trace             2908          2629632
----------------------------------------------------
orphaned allocations (info is from last known client):
----------------------------------------------------
  total orphaned                0
          total         100343808
   deferred free                0
----------------------------------------------------
lgtm-com[bot] commented 3 years ago

This pull request introduces 2 alerts when merging 934616fee845b73ada9438bcb30197d73cbc8a7b into 9e6b568982dc628ff97c88631987ea977f4cef9e - view on LGTM.com

new alerts: