Skip to content

Commit 43f7c15

Browse files
authored
Actually kill HW dithering on Kindle for real ;). (koreader#820)
1 parent 6a375f1 commit 43f7c15

File tree

1 file changed

+8
-28
lines changed

1 file changed

+8
-28
lines changed

ffi/framebuffer_mxcfb.lua

+8-28
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ local function refresh_k51(fb, refreshtype, waveform_mode, x, y, w, h)
295295
return mxc_update(fb, C.MXCFB_SEND_UPDATE, refarea, refreshtype, waveform_mode, x, y, w, h)
296296
end
297297

298-
local function refresh_koa2(fb, refreshtype, waveform_mode, x, y, w, h, dither)
298+
local function refresh_koa2(fb, refreshtype, waveform_mode, x, y, w, h)
299299
local refarea = ffi.new("struct mxcfb_update_data_koa2[1]")
300300
-- only for Amazon's driver, try to mostly follow what the stock reader does...
301301
if waveform_mode == C.WAVEFORM_MODE_KOA2_GLR16 then
@@ -308,19 +308,9 @@ local function refresh_koa2(fb, refreshtype, waveform_mode, x, y, w, h, dither)
308308
end
309309
-- NOTE: Since there's no longer a distinction between GC16_FAST & GC16, we're done!
310310
refarea[0].temp = C.TEMP_USE_AMBIENT
311-
-- Did we request HW dithering?
312-
-- FIXME: Behaves differently than on Kobo?
313-
if dither then
314-
refarea[0].dither_mode = C.EPDC_FLAG_USE_DITHERING_ORDERED
315-
if waveform_mode == C.WAVEFORM_MODE_A2 or waveform_mode == C.WAVEFORM_MODE_DU then
316-
refarea[0].quant_bit = 1;
317-
else
318-
refarea[0].quant_bit = 7;
319-
end
320-
else
321-
refarea[0].dither_mode = C.EPDC_FLAG_USE_DITHERING_PASSTHROUGH
322-
refarea[0].quant_bit = 0;
323-
end
311+
-- NOTE: Dithering appears to behave differently than on Kobo, so, forget about it until someone with the device cares enough...
312+
refarea[0].dither_mode = C.EPDC_FLAG_USE_DITHERING_PASSTHROUGH
313+
refarea[0].quant_bit = 0;
324314
-- Enable the appropriate flag when requesting what amounts to a 2bit update
325315
if waveform_mode == C.WAVEFORM_MODE_DU then
326316
refarea[0].flags = C.EPDC_FLAG_FORCE_MONOCHROME
@@ -332,7 +322,7 @@ local function refresh_koa2(fb, refreshtype, waveform_mode, x, y, w, h, dither)
332322
return mxc_update(fb, C.MXCFB_SEND_UPDATE_KOA2, refarea, refreshtype, waveform_mode, x, y, w, h)
333323
end
334324

335-
local function refresh_pw4(fb, refreshtype, waveform_mode, x, y, w, h, dither)
325+
local function refresh_pw4(fb, refreshtype, waveform_mode, x, y, w, h)
336326
local refarea = ffi.new("struct mxcfb_update_data_pw4[1]")
337327
-- only for Amazon's driver, try to mostly follow what the stock reader does...
338328
if waveform_mode == C.WAVEFORM_MODE_KOA2_GLR16 then
@@ -345,19 +335,9 @@ local function refresh_pw4(fb, refreshtype, waveform_mode, x, y, w, h, dither)
345335
end
346336
-- NOTE: Since there's no longer a distinction between GC16_FAST & GC16, we're done!
347337
refarea[0].temp = C.TEMP_USE_AMBIENT
348-
-- Did we request HW dithering?
349-
-- FIXME: Behaves differently than on Kobo?
350-
if dither then
351-
refarea[0].dither_mode = C.EPDC_FLAG_USE_DITHERING_ORDERED
352-
if waveform_mode == C.WAVEFORM_MODE_A2 or waveform_mode == C.WAVEFORM_MODE_DU then
353-
refarea[0].quant_bit = 1;
354-
else
355-
refarea[0].quant_bit = 7;
356-
end
357-
else
358-
refarea[0].dither_mode = C.EPDC_FLAG_USE_DITHERING_PASSTHROUGH
359-
refarea[0].quant_bit = 0;
360-
end
338+
-- NOTE: Dithering appears to behave differently than on Kobo, so, forget about it until someone with the device cares enough...
339+
refarea[0].dither_mode = C.EPDC_FLAG_USE_DITHERING_PASSTHROUGH
340+
refarea[0].quant_bit = 0;
361341
-- Enable the appropriate flag when requesting what amounts to a 2bit update
362342
if waveform_mode == C.WAVEFORM_MODE_DU then
363343
refarea[0].flags = C.EPDC_FLAG_FORCE_MONOCHROME

0 commit comments

Comments
 (0)