From 5f4841e277858d90ed603f3f1902a8a4683f8936 Mon Sep 17 00:00:00 2001 From: NiLuJe Date: Sun, 12 Aug 2018 20:01:04 +0200 Subject: [PATCH] Tweak JIT's loopunroll threshold on Kobo 16bpp (#4157) * Tweak JIT's loopunroll threshold on Kobo 16bpp To avoid early blacklist of the blitbuffer code on alpha-blending workloads. Least terrible workaround we could come up with to "fix" #4137 * gzip kindle/kobo/pb OTA tarballs w/ --rsyncable Should make them more zsync friendly. --- Makefile | 6 +++--- base | 2 +- frontend/device/kobo/device.lua | 14 +++++++++++++- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 895c51871..5629edfaf 100644 --- a/Makefile +++ b/Makefile @@ -186,7 +186,7 @@ kindleupdate: all # note that the targz file extension is intended to keep ISP from caching # the file, see koreader#1644. cd $(INSTALL_DIR) && \ - tar -czah --no-recursion -f ../koreader-$(DIST)-$(MACHINE)-$(VERSION).targz \ + tar -I"gzip --rsyncable" -cah --no-recursion -f ../koreader-$(DIST)-$(MACHINE)-$(VERSION).targz \ -T koreader/ota/package.index koboupdate: all @@ -215,7 +215,7 @@ koboupdate: all koreader/ota/package.index koreader.png README_kobo.txt # make gzip koboupdate for zsync OTA update cd $(INSTALL_DIR) && \ - tar -czah --no-recursion -f ../koreader-kobo-$(MACHINE)-$(VERSION).targz \ + tar -I"gzip --rsyncable" -cah --no-recursion -f ../koreader-kobo-$(MACHINE)-$(VERSION).targz \ -T koreader/ota/package.index pbupdate: all @@ -252,7 +252,7 @@ pbupdate: all applications/koreader/ota/package.index system # make gzip pbupdate for zsync OTA update cd $(INSTALL_DIR)/applications && \ - tar -czah --no-recursion -f ../../koreader-pocketbook-$(MACHINE)-$(VERSION).targz \ + tar -I"gzip --rsyncable" -cah --no-recursion -f ../../koreader-pocketbook-$(MACHINE)-$(VERSION).targz \ -T koreader/ota/package.index utupdate: all diff --git a/base b/base index 08c021af2..10d3aa437 160000 --- a/base +++ b/base @@ -1 +1 @@ -Subproject commit 08c021af2a1aed63a02c4407c5bbcfd53d15bcec +Subproject commit 10d3aa43753d36e6449d54609a949524b7bd1959 diff --git a/frontend/device/kobo/device.lua b/frontend/device/kobo/device.lua index addfabaa2..77ed38d04 100644 --- a/frontend/device/kobo/device.lua +++ b/frontend/device/kobo/device.lua @@ -23,7 +23,7 @@ local Kobo = Generic:new{ model = "Kobo", isKobo = yes, isTouchDevice = yes, -- all of them are - hasBGRFrameBuffer = yes, -- has always been the case, even on 16bpp FWs + hasBGRFrameBuffer = yes, -- True when >16bpp -- most Kobos have X/Y switched for the touch screen touch_switch_xy = true, @@ -198,6 +198,18 @@ local KoboNova = Kobo:new{ function Kobo:init() self.screen = require("ffi/framebuffer_mxcfb"):new{device = self, debug = logger.dbg} + -- NOTE: Something about the extra work needed to handle RGB565 conversions is making the JIT optimizer crazy when doing + -- alpha-blending, causing it to very quickly blacklist the entire blitbuffer code, which basically murders performance. + -- The least terrible workaround we could come up with is tweaking the optimizer's thresholds a bit, + -- to convince it not to give up too early. + -- As this may have a detrimental effect on performance, we try to deviate from defaults as little as possible, + -- completely avoiding it if possible... + -- c.f., #4137 for the gory details. + if self.screen.fb_bpp == 16 then + logger.info("Enabling Kobo @ 16bpp tweaks") + jit.opt.start("loopunroll=45") + self.hasBGRFrameBuffer = no + end self.powerd = require("device/kobo/powerd"):new{device = self} self.input = require("device/input"):new{ device = self,