koreader / koreader-base

Base framework offering a Lua scriptable environment for creating document readers
http://koreader.rocks/
GNU Affero General Public License v3.0
137 stars 106 forks source link

Fix GloHD mxcfb handling #390

Closed NiLuJe closed 6 years ago

NiLuJe commented 8 years ago

Note to self for when I have some free time:

TODO:

CAVEATS:

Said new wait_for_update_complete may or may not be actually used on production devices (cf. MX50_IOCTL_IF). And I don't have a device to check, so, if anyone could strace nickel, that'd help :).

NiLuJe commented 6 years ago

Right, I'd forgotten about this one!

Good news is: the AuraOne/SE & the H2O² roughly share the same DNA, so, once I get that updated strace up & running, that should give us a clearer idea of what to do for a whole range of devices :).

NiLuJe commented 6 years ago

For ref:

--- H2O/include/linux/mxcfb.h   2014-07-18 05:38:46.000000000 +0200
+++ H2O2/include/linux/mxcfb.h  2017-01-10 02:51:39.000000000 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright 2004-2011 Freescale Semiconductor, Inc. All Rights Reserved.
+ * Copyright 2004-2013 Freescale Semiconductor, Inc. All Rights Reserved.
  */

 /*
@@ -23,12 +23,19 @@

 #include <linux/fb.h>

+#if defined(CONFIG_ANDROID) || defined(ANDROID) //[
+#else //][ !CONFIG_ANDROID||!ANDROID
+   #define MX50_IOCTL_IF   1
+#endif //] !CONFIG_ANDROID
+
 #define FB_SYNC_OE_LOW_ACT 0x80000000
 #define FB_SYNC_CLK_LAT_FALL   0x40000000
 #define FB_SYNC_DATA_INVERT    0x20000000
 #define FB_SYNC_CLK_IDLE_EN    0x10000000
 #define FB_SYNC_SHARP_MODE 0x08000000
 #define FB_SYNC_SWAP_RGB   0x04000000
+#define FB_ACCEL_TRIPLE_FLAG   0x00000000
+#define FB_ACCEL_DOUBLE_FLAG   0x00000001

 struct mxcfb_gbl_alpha {
    int enable;
@@ -67,6 +74,8 @@ struct mxcfb_rect {

 #define GRAYSCALE_8BIT             0x1
 #define GRAYSCALE_8BIT_INVERTED            0x2
+#define GRAYSCALE_4BIT                          0x3
+#define GRAYSCALE_4BIT_INVERTED                 0x4

 #define AUTO_UPDATE_MODE_REGION_MODE       0
 #define AUTO_UPDATE_MODE_AUTOMATIC_MODE        1
@@ -86,35 +95,40 @@ struct mxcfb_rect {
 #define EPDC_FLAG_FORCE_MONOCHROME     0x02
 #define EPDC_FLAG_USE_CMAP         0x04
 #define EPDC_FLAG_USE_ALT_BUFFER       0x100
+#define EPDC_FLAG_TEST_COLLISION       0x200
+#define EPDC_FLAG_GROUP_UPDATE         0x400
 #define EPDC_FLAG_USE_AAD          0x1000
+#define EPDC_FLAG_USE_DITHERING_Y1     0x2000
+#define EPDC_FLAG_USE_DITHERING_Y4     0x4000
+#define EPDC_FLAG_USE_DITHERING_NTX_D8     0x100000

 #define FB_POWERDOWN_DISABLE           -1

 struct mxcfb_alt_buffer_data {
+#if defined(CONFIG_ANDROID) || defined (ANDROID)//[
+#else//][!CONFIG_ANDROID
    void *virt_addr;
+#endif//]!CONFIG_ANDROID
    __u32 phys_addr;
    __u32 width;    /* width of entire buffer */
    __u32 height;   /* height of entire buffer */
    struct mxcfb_rect alt_update_region;    /* region within buffer to update */
 };
-
 struct mxcfb_alt_buffer_data_org {
    __u32 phys_addr;
    __u32 width;    /* width of entire buffer */
    __u32 height;   /* height of entire buffer */
    struct mxcfb_rect alt_update_region;    /* region within buffer to update */
 };
-
 struct mxcfb_update_data {
    struct mxcfb_rect update_region;
    __u32 waveform_mode;
    __u32 update_mode;
    __u32 update_marker;
    int temp;
-   uint flags;
+   unsigned int flags;
    struct mxcfb_alt_buffer_data alt_buffer_data;
 };
-
 struct mxcfb_update_data_org {
    struct mxcfb_rect update_region;
    __u32 waveform_mode;
@@ -125,6 +139,11 @@ struct mxcfb_update_data_org {
    struct mxcfb_alt_buffer_data_org alt_buffer_data;
 };

+struct mxcfb_update_marker_data {
+   __u32 update_marker;
+   __u32 collision_test;
+};
+
 /*
  * Structure used to define waveform modes for driver
  * Needed for driver to perform auto-waveform selection
@@ -136,14 +155,21 @@ struct mxcfb_waveform_modes {
    int mode_gc8;
    int mode_gc16;
    int mode_gc32;
-   
-   int mode_a2;
-   int mode_gl16;
-   /*
-    * reagl_flow
-    */
+
+//#ifdef CONFIG_MACH_MX6SL_NTX //[
    int mode_aa;
    int mode_aad;
+   int mode_gl16;
+   int mode_a2;
+//#endif //] CONFIG_MACH_MX6SL_NTX 
+};
+
+/*
+ * Structure used to define a 5*3 matrix of parameters for
+ * setting IPU DP CSC module related to this framebuffer.
+ */
+struct mxcfb_csc_matrix {
+   int param[5][3];
 };

 #define MXCFB_WAIT_FOR_VSYNC   _IOW('F', 0x20, u_int32_t)
@@ -158,6 +184,8 @@ struct mxcfb_waveform_modes {
 #define MXCFB_GET_DIFMT           _IOR('F', 0x2A, u_int32_t)
 #define MXCFB_GET_FB_BLANK     _IOR('F', 0x2B, u_int32_t)
 #define MXCFB_SET_DIFMT        _IOW('F', 0x2C, u_int32_t)
+#define MXCFB_ENABLE_VSYNC_EVENT   _IOW('F', 0x33, int32_t)
+#define MXCFB_CSC_UPDATE   _IOW('F', 0x2D, struct mxcfb_csc_matrix)

 /* IOCTLs for E-ink panel updates */
 #define MXCFB_SET_WAVEFORM_MODES   _IOW('F', 0x2B, struct mxcfb_waveform_modes)
@@ -165,11 +193,16 @@ struct mxcfb_waveform_modes {
 #define MXCFB_SET_AUTO_UPDATE_MODE _IOW('F', 0x2D, __u32)
 #define MXCFB_SEND_UPDATE      _IOW('F', 0x2E, struct mxcfb_update_data)
 #define MXCFB_SEND_UPDATE_ORG      _IOW('F', 0x2E, struct mxcfb_update_data_org)
+#ifdef MX50_IOCTL_IF//[
 #define MXCFB_WAIT_FOR_UPDATE_COMPLETE _IOW('F', 0x2F, __u32)
+#define MXCFB_WAIT_FOR_UPDATE_COMPLETE2 _IOWR('F', 0x35, struct mxcfb_update_marker_data)
+#else //][!MX50_IOCTL_IF
+#define MXCFB_WAIT_FOR_UPDATE_COMPLETE _IOWR('F', 0x35, struct mxcfb_update_marker_data)
+#endif//] MX50_IOCTL_IF
 #define MXCFB_SET_PWRDOWN_DELAY        _IOW('F', 0x30, int32_t)
 #define MXCFB_GET_PWRDOWN_DELAY        _IOR('F', 0x31, int32_t)
 #define MXCFB_SET_UPDATE_SCHEME        _IOW('F', 0x32, __u32)
-#define MXCFB_SET_MERGE_ON_WAVEFORM_MISMATCH   _IOW('F', 0x37, int32_t)
+#define MXCFB_GET_WORK_BUFFER      _IOWR('F', 0x34, unsigned long)

 #ifdef __KERNEL__

@@ -189,13 +222,9 @@ enum {

 int mxcfb_set_refresh_mode(struct fb_info *fbi, int mode,
               struct mxcfb_rect *update_region);
-void mxcfb_register_mode(int disp_port,
-       const struct fb_videomode *modedb,
+int mxc_elcdif_frame_addr_setup(dma_addr_t phys);
+void mxcfb_elcdif_register_mode(const struct fb_videomode *modedb,
        int num_modes, int dev_mode);

-void mxcfb_register_presetup(int disp_port,
-       int (*pre_setup)(struct fb_info *info));
-
-int mxc_elcdif_frame_addr_setup(dma_addr_t phys);
 #endif             /* __KERNEL__ */
 #endif
NiLuJe commented 6 years ago

And now that the R2/Mark7 kernels are up...

--- H2O2/include/linux/mxcfb.h  2017-01-10 02:51:39.000000000 +0100
+++ H2O2R2/include/uapi/linux/mxcfb.h   2017-10-16 16:27:15.000000000 +0200
@@ -1,20 +1,27 @@
 /*
- * Copyright 2004-2013 Freescale Semiconductor, Inc. All Rights Reserved.
+ * Copyright (C) 2013-2015 Freescale Semiconductor, Inc. All Rights Reserved
  */

 /*
- * The code contained herein is licensed under the GNU Lesser General
- * Public License.  You may obtain a copy of the GNU Lesser General
- * Public License Version 2.1 or later at the following locations:
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
  *
- * http://www.opensource.org/licenses/lgpl-license.html
- * http://www.gnu.org/copyleft/lgpl.html
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */

 /*
- * @file arch-mxc/   mxcfb.h
+ * @file uapi/linux/mxcfb.h
  *
- * @brief Global header file for the MXC Frame buffer
+ * @brief Global header file for the MXC frame buffer
  *
  * @ingroup Framebuffer
  */
@@ -23,11 +30,6 @@

 #include <linux/fb.h>

-#if defined(CONFIG_ANDROID) || defined(ANDROID) //[
-#else //][ !CONFIG_ANDROID||!ANDROID
-   #define MX50_IOCTL_IF   1
-#endif //] !CONFIG_ANDROID
-
 #define FB_SYNC_OE_LOW_ACT 0x80000000
 #define FB_SYNC_CLK_LAT_FALL   0x40000000
 #define FB_SYNC_DATA_INVERT    0x20000000
@@ -65,6 +67,11 @@ struct mxcfb_gamma {
    int slopek[16];
 };

+struct mxcfb_gpu_split_fmt {
+   struct fb_var_screeninfo var;
+   unsigned long offset;
+};
+
 struct mxcfb_rect {
    __u32 top;
    __u32 left;
@@ -87,6 +94,8 @@ struct mxcfb_rect {
 #define UPDATE_MODE_PARTIAL            0x0
 #define UPDATE_MODE_FULL           0x1

+#define WAVEFORM_MODE_GLR16            6
+#define WAVEFORM_MODE_GLD16            7
 #define WAVEFORM_MODE_AUTO         257

 #define TEMP_USE_AMBIENT           0x1000
@@ -97,30 +106,52 @@ struct mxcfb_rect {
 #define EPDC_FLAG_USE_ALT_BUFFER       0x100
 #define EPDC_FLAG_TEST_COLLISION       0x200
 #define EPDC_FLAG_GROUP_UPDATE         0x400
-#define EPDC_FLAG_USE_AAD          0x1000
 #define EPDC_FLAG_USE_DITHERING_Y1     0x2000
 #define EPDC_FLAG_USE_DITHERING_Y4     0x4000
-#define EPDC_FLAG_USE_DITHERING_NTX_D8     0x100000
+#define EPDC_FLAG_USE_REGAL                0x8000
+
+enum mxcfb_dithering_mode {
+   EPDC_FLAG_USE_DITHERING_PASSTHROUGH = 0x0,
+   EPDC_FLAG_USE_DITHERING_FLOYD_STEINBERG,
+   EPDC_FLAG_USE_DITHERING_ATKINSON,
+   EPDC_FLAG_USE_DITHERING_ORDERED,
+   EPDC_FLAG_USE_DITHERING_QUANT_ONLY,
+   EPDC_FLAG_USE_DITHERING_MAX,
+};

 #define FB_POWERDOWN_DISABLE           -1
+#define FB_TEMP_AUTO_UPDATE_DISABLE     -1

-struct mxcfb_alt_buffer_data {
-#if defined(CONFIG_ANDROID) || defined (ANDROID)//[
-#else//][!CONFIG_ANDROID
+struct mxcfb_alt_buffer_data_ntx {
    void *virt_addr;
-#endif//]!CONFIG_ANDROID
    __u32 phys_addr;
    __u32 width;    /* width of entire buffer */
    __u32 height;   /* height of entire buffer */
    struct mxcfb_rect alt_update_region;    /* region within buffer to update */
 };
-struct mxcfb_alt_buffer_data_org {
+
+
+struct mxcfb_alt_buffer_data {
    __u32 phys_addr;
    __u32 width;    /* width of entire buffer */
    __u32 height;   /* height of entire buffer */
    struct mxcfb_rect alt_update_region;    /* region within buffer to update */
 };
-struct mxcfb_update_data {
+
+// mxcfb_update_data v1 for NTX linux since from mx50/mx6sl .
+struct mxcfb_update_data_v1_ntx {
+   struct mxcfb_rect update_region;
+   __u32 waveform_mode;
+   __u32 update_mode;
+   __u32 update_marker;
+   int temp;
+   unsigned int flags;
+   struct mxcfb_alt_buffer_data_ntx alt_buffer_data;
+};
+
+
+// mxcfb_update_data v1 since from mx50/mx6sl .
+struct mxcfb_update_data_v1 {
    struct mxcfb_rect update_region;
    __u32 waveform_mode;
    __u32 update_mode;
@@ -129,14 +160,20 @@ struct mxcfb_update_data {
    unsigned int flags;
    struct mxcfb_alt_buffer_data alt_buffer_data;
 };
-struct mxcfb_update_data_org {
+
+
+// mxcfb_update_data v2 since from mx7d .
+#define mxcfb_update_data_v2 mxcfb_update_data
+struct mxcfb_update_data {
    struct mxcfb_rect update_region;
    __u32 waveform_mode;
    __u32 update_mode;
    __u32 update_marker;
    int temp;
-   uint flags;
-   struct mxcfb_alt_buffer_data_org alt_buffer_data;
+   unsigned int flags;
+   int dither_mode;
+   int quant_bit;
+   struct mxcfb_alt_buffer_data alt_buffer_data;
 };

 struct mxcfb_update_marker_data {
@@ -144,24 +181,45 @@ struct mxcfb_update_marker_data {
    __u32 collision_test;
 };

+
+#define WFM_ENABLE_AA              1
+#define WFM_ENABLE_AAD         1
+
+
 /*
  * Structure used to define waveform modes for driver
  * Needed for driver to perform auto-waveform selection
  */
-struct mxcfb_waveform_modes {
+#ifndef MXCFB_WAVEFORM_MODES_NTX //[
+#define MXCFB_WAVEFORM_MODES_NTX
+struct mxcfb_waveform_modes_ntx {
    int mode_init;
    int mode_du;
    int mode_gc4;
    int mode_gc8;
    int mode_gc16;
    int mode_gc32;
+   int mode_gl16;
+   int mode_a2;

-//#ifdef CONFIG_MACH_MX6SL_NTX //[
+#ifdef WFM_ENABLE_AA//[
    int mode_aa;
+#endif //]WFM_ENABLE_AA
+
+#ifdef WFM_ENABLE_AAD//[
    int mode_aad;
-   int mode_gl16;
-   int mode_a2;
-//#endif //] CONFIG_MACH_MX6SL_NTX 
+#endif //]WFM_ENABLE_AAD
+   
+};
+#endif//] MXCFB_WAVEFORM_MODES_NTX
+
+struct mxcfb_waveform_modes {
+   int mode_init;
+   int mode_du;
+   int mode_gc4;
+   int mode_gc8;
+   int mode_gc16;
+   int mode_gc32;
 };

 /*
@@ -184,47 +242,30 @@ struct mxcfb_csc_matrix {
 #define MXCFB_GET_DIFMT           _IOR('F', 0x2A, u_int32_t)
 #define MXCFB_GET_FB_BLANK     _IOR('F', 0x2B, u_int32_t)
 #define MXCFB_SET_DIFMT        _IOW('F', 0x2C, u_int32_t)
-#define MXCFB_ENABLE_VSYNC_EVENT   _IOW('F', 0x33, int32_t)
 #define MXCFB_CSC_UPDATE   _IOW('F', 0x2D, struct mxcfb_csc_matrix)
+#define MXCFB_SET_GPU_SPLIT_FMT    _IOW('F', 0x2F, struct mxcfb_gpu_split_fmt)
+#define MXCFB_SET_PREFETCH _IOW('F', 0x30, int)
+#define MXCFB_GET_PREFETCH _IOR('F', 0x31, int)

 /* IOCTLs for E-ink panel updates */
 #define MXCFB_SET_WAVEFORM_MODES   _IOW('F', 0x2B, struct mxcfb_waveform_modes)
+#define MXCFB_SET_WAVEFORM_MODES_NTX   _IOW('F', 0x2B, struct mxcfb_waveform_modes_ntx)
 #define MXCFB_SET_TEMPERATURE      _IOW('F', 0x2C, int32_t)
 #define MXCFB_SET_AUTO_UPDATE_MODE _IOW('F', 0x2D, __u32)
+#define MXCFB_SEND_UPDATE_V1_NTX       _IOW('F', 0x2E, struct mxcfb_update_data_v1_ntx)
+#define MXCFB_SEND_UPDATE_V1       _IOW('F', 0x2E, struct mxcfb_update_data_v1)
 #define MXCFB_SEND_UPDATE      _IOW('F', 0x2E, struct mxcfb_update_data)
-#define MXCFB_SEND_UPDATE_ORG      _IOW('F', 0x2E, struct mxcfb_update_data_org)
-#ifdef MX50_IOCTL_IF//[
-#define MXCFB_WAIT_FOR_UPDATE_COMPLETE _IOW('F', 0x2F, __u32)
-#define MXCFB_WAIT_FOR_UPDATE_COMPLETE2 _IOWR('F', 0x35, struct mxcfb_update_marker_data)
-#else //][!MX50_IOCTL_IF
-#define MXCFB_WAIT_FOR_UPDATE_COMPLETE _IOWR('F', 0x35, struct mxcfb_update_marker_data)
-#endif//] MX50_IOCTL_IF
+#define MXCFB_SEND_UPDATE_V2       _IOW('F', 0x2E, struct mxcfb_update_data)
+#define MXCFB_WAIT_FOR_UPDATE_COMPLETE _IOWR('F', 0x2F, struct mxcfb_update_marker_data) // mx7d/mx6ull/mx6sll interface .
+#define MXCFB_WAIT_FOR_UPDATE_COMPLETE_V3  _IOWR('F', 0x2F, struct mxcfb_update_marker_data) // mx7d/mx6ull/mx6sll interface .
+#define MXCFB_WAIT_FOR_UPDATE_COMPLETE_V1  _IOW('F', 0x2F, __u32) // mx50/NTX interface .
+#define MXCFB_WAIT_FOR_UPDATE_COMPLETE_V2  _IOWR('F', 0x35, struct mxcfb_update_marker_data) // mx6sl BSP interface .
 #define MXCFB_SET_PWRDOWN_DELAY        _IOW('F', 0x30, int32_t)
 #define MXCFB_GET_PWRDOWN_DELAY        _IOR('F', 0x31, int32_t)
 #define MXCFB_SET_UPDATE_SCHEME        _IOW('F', 0x32, __u32)
 #define MXCFB_GET_WORK_BUFFER      _IOWR('F', 0x34, unsigned long)
-
-#ifdef __KERNEL__
-
-extern struct fb_videomode mxcfb_modedb[];
-extern int mxcfb_modedb_sz;
-
-enum {
-   MXC_DISP_SPEC_DEV = 0,
-   MXC_DISP_DDC_DEV = 1,
-};
-
-enum {
-   MXCFB_REFRESH_OFF,
-   MXCFB_REFRESH_AUTO,
-   MXCFB_REFRESH_PARTIAL,
-};
-
-int mxcfb_set_refresh_mode(struct fb_info *fbi, int mode,
-              struct mxcfb_rect *update_region);
-int mxc_elcdif_frame_addr_setup(dma_addr_t phys);
-void mxcfb_elcdif_register_mode(const struct fb_videomode *modedb,
-       int num_modes, int dev_mode);
-
-#endif             /* __KERNEL__ */
+#define MXCFB_DISABLE_EPDC_ACCESS  _IO('F', 0x35)
+#define MXCFB_ENABLE_EPDC_ACCESS   _IO('F', 0x36)
+#define MXCFB_SET_TEMP_AUTO_UPDATE_PERIOD   _IOW('F', 0x37, int32_t)
 #endif
+
NiLuJe commented 6 years ago

Fingers crossed for a decent eInk driver in Kobo's next device!

(And a fun CPU, if that i.MX 7D mention turns out not to be a lie!)

poire-z commented 6 years ago

All that is a bit CJK to me :) Did you mean/do you think there's still some improvements for koreader possible on GloHD ? (which I find good enough) Do kernel/capabilities change with kobo firmware upgrades (I'm still on a old 3.16.0), or they just upgrade nickel and their apps?

NiLuJe commented 6 years ago

@poire-z : We might be doing things slightly wrong on Mark6 devices, yeah. (And this shows that we'll probably have to do things differently for Mark7 ones).

All of this is part of me updating my strace patches to actually confirm that fact ;).

AFAIK, it's been (unfortunately) extremely rare for Kobo to actually ship updates to the Kernel in FW updates. They can, though, but it hasn't been used much (at least from what I've seen on my H2O).

Granted, that's coming from Kindles, where everything is pretty much in a constant state of flux ;). A tightly controlled and usually solid flux, but, still, things move very fast there (and it's fairly visible because of the extremely modular approach of the SW stack, vs. Kobo's monolithic Nickel).

NiLuJe commented 6 years ago

Okay! Finished updating the strace patch, got it to build, and it appears to work properly on my H2O...

strace-kobo.tar.gz

So, now, I need testers with Mark6 & Mark7 devices! :).

Basically, you need SSH access under Nickel, and with the attached binary, you trace nickel's ioctls, like so: ./strace -fitv -e trace=ioctl -p $(pidof nickel). Then you move around a bit, first in the Library, then in a book.

You should get something similar to this:

./strace: Process 572 attached with 10 threads
[pid   572] 02:06:54 [2f6191f6] ioctl(3, MXCFB_SEND_UPDATE_V1_NTX, {update_region={top=41, left=30, width=380, height=879}, waveform_mode=WAVEFORM_MODE_AUTO, update_mode=UPDATE_MODE_PARTIAL, update_marker=58, temp=TEMP_USE_AMBIENT, flags=0, alt_buffer_data={virt_addr=(nil), phys_addr=0, width=0, height=0, alt_update_region={top=0, left=0, width=0, height=0}}}, 0x7ec5b334) = 0
[pid  1147] 02:06:54 [????????] +++ exited with 0 +++
[pid   572] 02:06:58 [2f6191f6] ioctl(3, MXCFB_SEND_UPDATE_V1_NTX, {update_region={top=41, left=30, width=380, height=879}, waveform_mode=WAVEFORM_MODE_AUTO, update_mode=UPDATE_MODE_PARTIAL, update_marker=59, temp=TEMP_USE_AMBIENT, flags=0, alt_buffer_data={virt_addr=(nil), phys_addr=0, width=0, height=0, alt_update_region={top=0, left=0, width=0, height=0}}}, 0x7ec5b334) = 0
[pid  1207] 02:07:01 [????????] +++ exited with 0 +++
[pid   572] 02:07:03 [2f6191f6] ioctl(3, MXCFB_SEND_UPDATE_V1_NTX, {update_region={top=41, left=30, width=380, height=879}, waveform_mode=WAVEFORM_MODE_AUTO, update_mode=UPDATE_MODE_PARTIAL, update_marker=60, temp=TEMP_USE_AMBIENT, flags=0, alt_buffer_data={virt_addr=(nil), phys_addr=0, width=0, height=0, alt_update_region={top=0, left=0, width=0, height=0}}}, 0x7ec5b334) = 0
[pid   572] 02:07:04 [2f6191f6] ioctl(3, MXCFB_SEND_UPDATE_V1_NTX, {update_region={top=162, left=70, width=300, height=70}, waveform_mode=NTX_WFM_MODE_A2, update_mode=UPDATE_MODE_PARTIAL, update_marker=61, temp=TEMP_USE_AMBIENT, flags=EPDC_FLAG_FORCE_MONOCHROME, alt_buffer_data={virt_addr=(nil), phys_addr=0, width=0, height=0, alt_update_region={top=0, left=0, width=0, height=0}}}, 0x7ec5a554) = 0
./strace: Process 1251 attached
[pid  1006] 02:07:05 [2f6191f6] ioctl(26, FIONREAD, [566]) = 0
[pid   572] 02:07:06 [2f6191f6] ioctl(3, MXCFB_SEND_UPDATE_V1_NTX, {update_region={top=11, left=0, width=1080, height=1429}, waveform_mode=WAVEFORM_MODE_AUTO, update_mode=UPDATE_MODE_FULL, update_marker=62, temp=TEMP_USE_AMBIENT, flags=0, alt_buffer_data={virt_addr=(nil), phys_addr=0, width=0, height=0, alt_update_region={top=0, left=0, width=0, height=0}}}, 0x7ec5b334) = 0
[pid  1006] 02:07:06 [2f6191f6] ioctl(26, FIONREAD <unfinished ...>
[pid   572] 02:07:06 [2f6191f6] ioctl(3, MXCFB_SEND_UPDATE_V1_NTX, {update_region={top=252, left=60, width=720, height=1160}, waveform_mode=WAVEFORM_MODE_AUTO, update_mode=UPDATE_MODE_PARTIAL, update_marker=63, temp=TEMP_USE_AMBIENT, flags=0, alt_buffer_data={virt_addr=(nil), phys_addr=0, width=0, height=0, alt_update_region={top=0, left=0, width=0, height=0}}}, 0x7ec5b334) = 0
[pid  1006] 02:07:06 [2f6191f6] <... ioctl resumed> , [566]) = 0
[pid   572] 02:07:09 [2f6191f6] ioctl(3, MXCFB_SEND_UPDATE_V1_NTX, {update_region={top=11, left=0, width=1080, height=1429}, waveform_mode=WAVEFORM_MODE_AUTO, update_mode=UPDATE_MODE_PARTIAL, update_marker=64, temp=TEMP_USE_AMBIENT, flags=0, alt_buffer_data={virt_addr=(nil), phys_addr=0, width=0, height=0, alt_update_region={top=0, left=0, width=0, height=0}}}, 0x7ec5b334) = 0
[pid   572] 02:07:09 [2f6191f6] ioctl(3, MXCFB_SEND_UPDATE_V1_NTX, {update_region={top=326, left=60, width=140, height=990}, waveform_mode=WAVEFORM_MODE_AUTO, update_mode=UPDATE_MODE_PARTIAL, update_marker=65, temp=TEMP_USE_AMBIENT, flags=0, alt_buffer_data={virt_addr=(nil), phys_addr=0, width=0, height=0, alt_update_region={top=0, left=0, width=0, height=0}}}, 0x7ec5b334) = 0
./strace: Process 1252 attached
./strace: Process 1253 attached
[pid   572] 02:07:10 [2f6191f6] ioctl(3, MXCFB_SEND_UPDATE_V1_NTX, {update_region={top=11, left=0, width=1080, height=1429}, waveform_mode=WAVEFORM_MODE_AUTO, update_mode=UPDATE_MODE_PARTIAL, update_marker=66, temp=TEMP_USE_AMBIENT, flags=0, alt_buffer_data={virt_addr=(nil), phys_addr=0, width=0, height=0, alt_update_region={top=0, left=0, width=0, height=0}}}, 0x7ec5b334) = 0
[pid   572] 02:07:10 [2f6191f6] ioctl(3, MXCFB_SEND_UPDATE_V1_NTX, {update_region={top=326, left=60, width=140, height=990}, waveform_mode=WAVEFORM_MODE_AUTO, update_mode=UPDATE_MODE_PARTIAL, update_marker=67, temp=TEMP_USE_AMBIENT, flags=0, alt_buffer_data={virt_addr=(nil), phys_addr=0, width=0, height=0, alt_update_region={top=0, left=0, width=0, height=0}}}, 0x7ec5b334) = 0
[pid  1253] 02:07:11 [2f6191f6] ioctl(35, FIONREAD, [4096]) = 0
[pid  1253] 02:07:11 [2f6191f6] ioctl(35, FIONREAD, [556]) = 0
[pid  1253] 02:07:11 [2f6191f6] ioctl(35, FIONREAD, [242]) = 0
[pid  1253] 02:07:11 [2f6191f6] ioctl(35, FIONREAD, [810]) = 0
[pid  1253] 02:07:11 [????????] +++ exited with 0 +++
[pid  1252] 02:07:11 [????????] +++ exited with 0 +++
[pid   572] 02:07:12 [2f6191f6] ioctl(3, MXCFB_SEND_UPDATE_V1_NTX, {update_region={top=41, left=30, width=380, height=879}, waveform_mode=WAVEFORM_MODE_AUTO, update_mode=UPDATE_MODE_PARTIAL, update_marker=68, temp=TEMP_USE_AMBIENT, flags=0, alt_buffer_data={virt_addr=(nil), phys_addr=0, width=0, height=0, alt_update_region={top=0, left=0, width=0, height=0}}}, 0x7ec5b334) = 0
[pid   572] 02:07:13 [2f6191f6] ioctl(3, MXCFB_SEND_UPDATE_V1_NTX, {update_region={top=81, left=70, width=300, height=70}, waveform_mode=NTX_WFM_MODE_A2, update_mode=UPDATE_MODE_PARTIAL, update_marker=69, temp=TEMP_USE_AMBIENT, flags=EPDC_FLAG_FORCE_MONOCHROME, alt_buffer_data={virt_addr=(nil), phys_addr=0, width=0, height=0, alt_update_region={top=0, left=0, width=0, height=0}}}, 0x7ec5a554) = 0
[pid   572] 02:07:14 [2f6191f6] ioctl(3, MXCFB_SEND_UPDATE_V1_NTX, {update_region={top=11, left=0, width=1080, height=1429}, waveform_mode=WAVEFORM_MODE_AUTO, update_mode=UPDATE_MODE_FULL, update_marker=70, temp=TEMP_USE_AMBIENT, flags=0, alt_buffer_data={virt_addr=(nil), phys_addr=0, width=0, height=0, alt_update_region={top=0, left=0, width=0, height=0}}}, 0x7ec5b334) = 0
[pid  1006] 02:07:14 [2f6191f6] ioctl(26, FIONREAD, [566]) = 0
[pid  1006] 02:07:18 [2f6191f6] ioctl(26, FIONREAD, [566]) = 0
[pid   572] 02:07:19 [2f6191f6] ioctl(3, MXCFB_SEND_UPDATE_V1_NTX, {update_region={top=181, left=50, width=245, height=488}, waveform_mode=NTX_WFM_MODE_DU, update_mode=UPDATE_MODE_PARTIAL, update_marker=71, temp=TEMP_USE_AMBIENT, flags=0, alt_buffer_data={virt_addr=(nil), phys_addr=0, width=0, height=0, alt_update_region={top=0, left=0, width=0, height=0}}}, 0x7ec5a53c) = 0
./strace: Process 1254 attached
./strace: Process 1255 attached
[pid  1006] 02:07:20 [2f6191f6] ioctl(26, FIONREAD, [566]) = 0
./strace: Process 1256 attached
[pid   572] 02:07:22 [2f6191f6] ioctl(3, MXCFB_SEND_UPDATE_V1_NTX, {update_region={top=11, left=0, width=1080, height=1429}, waveform_mode=WAVEFORM_MODE_AUTO, update_mode=UPDATE_MODE_FULL, update_marker=72, temp=TEMP_USE_AMBIENT, flags=0, alt_buffer_data={virt_addr=(nil), phys_addr=0, width=0, height=0, alt_update_region={top=0, left=0, width=0, height=0}}}, 0x7ec5b334) = 0
[pid   572] 02:07:22 [2f6191f6] ioctl(3, MXCFB_WAIT_FOR_UPDATE_COMPLETE_V1, {71}, 0x7ec5b320) = 0
[pid   572] 02:07:22 [2f6191f6] ioctl(3, MXCFB_WAIT_FOR_UPDATE_COMPLETE_V1, {72}, 0x7ec5b300) = 0x3bc
[pid   572] 02:07:24 [2f6191f6] ioctl(3, MXCFB_SEND_UPDATE_V1_NTX, {update_region={top=0, left=0, width=1080, height=1440}, waveform_mode=WAVEFORM_MODE_AUTO, update_mode=UPDATE_MODE_PARTIAL, update_marker=73, temp=TEMP_USE_AMBIENT, flags=0, alt_buffer_data={virt_addr=(nil), phys_addr=0, width=0, height=0, alt_update_region={top=0, left=0, width=0, height=0}}}, 0x7ec5b334) = 0
[pid  1006] 02:07:24 [2f6191f6] ioctl(26, FIONREAD, [566]) = 0
[pid   572] 02:07:32 [2f6191f6] ioctl(3, MXCFB_SEND_UPDATE_V1_NTX, {update_region={top=0, left=0, width=1080, height=1440}, waveform_mode=NTX_WFM_MODE_GC16, update_mode=UPDATE_MODE_FULL, update_marker=74, temp=TEMP_USE_AMBIENT, flags=0, alt_buffer_data={virt_addr=(nil), phys_addr=0, width=0, height=0, alt_update_region={top=0, left=0, width=0, height=0}}}, 0x7ec5b334) = 0
[pid   572] 02:07:32 [2f6191f6] ioctl(3, MXCFB_WAIT_FOR_UPDATE_COMPLETE_V1, {73}, 0x7ec5b320) = 0
[pid   572] 02:07:32 [2f6191f6] ioctl(3, MXCFB_WAIT_FOR_UPDATE_COMPLETE_V1, {74}, 0x7ec5b300) = 0x3a6
[pid   572] 02:07:35 [2f6191f6] ioctl(3, MXCFB_SEND_UPDATE_V1_NTX, {update_region={top=0, left=0, width=1080, height=1440}, waveform_mode=WAVEFORM_MODE_AUTO, update_mode=UPDATE_MODE_PARTIAL, update_marker=75, temp=TEMP_USE_AMBIENT, flags=0, alt_buffer_data={virt_addr=(nil), phys_addr=0, width=0, height=0, alt_update_region={top=0, left=0, width=0, height=0}}}, 0x7ec5b334) = 0
[pid   572] 02:07:38 [2f6191f6] ioctl(3, MXCFB_SEND_UPDATE_V1_NTX, {update_region={top=11, left=0, width=1080, height=1429}, waveform_mode=WAVEFORM_MODE_AUTO, update_mode=UPDATE_MODE_PARTIAL, update_marker=76, temp=TEMP_USE_AMBIENT, flags=0, alt_buffer_data={virt_addr=(nil), phys_addr=0, width=0, height=0, alt_update_region={top=0, left=0, width=0, height=0}}}, 0x7ec5b334) = 0
[pid   572] 02:07:39 [2f6191f6] ioctl(3, MXCFB_SEND_UPDATE_V1_NTX, {update_region={top=41, left=30, width=380, height=879}, waveform_mode=WAVEFORM_MODE_AUTO, update_mode=UPDATE_MODE_PARTIAL, update_marker=77, temp=TEMP_USE_AMBIENT, flags=0, alt_buffer_data={virt_addr=(nil), phys_addr=0, width=0, height=0, alt_update_region={top=0, left=0, width=0, height=0}}}, 0x7ec5b334) = 0
[pid   572] 02:07:40 [2f6191f6] ioctl(3, MXCFB_SEND_UPDATE_V1_NTX, {update_region={top=81, left=70, width=300, height=70}, waveform_mode=NTX_WFM_MODE_A2, update_mode=UPDATE_MODE_PARTIAL, update_marker=78, temp=TEMP_USE_AMBIENT, flags=EPDC_FLAG_FORCE_MONOCHROME, alt_buffer_data={virt_addr=(nil), phys_addr=0, width=0, height=0, alt_update_region={top=0, left=0, width=0, height=0}}}, 0x7ec5a554) = 0
[pid  1006] 02:07:41 [2f6191f6] ioctl(26, FIONREAD, [566]) = 0
[pid   572] 02:07:41 [2f6191f6] ioctl(3, MXCFB_SEND_UPDATE_V1_NTX, {update_region={top=11, left=0, width=1080, height=1429}, waveform_mode=WAVEFORM_MODE_AUTO, update_mode=UPDATE_MODE_FULL, update_marker=79, temp=TEMP_USE_AMBIENT, flags=0, alt_buffer_data={virt_addr=(nil), phys_addr=0, width=0, height=0, alt_update_region={top=0, left=0, width=0, height=0}}}, 0x7ec5b334) = 0
[pid   572] 02:07:41 [2f6191f6] ioctl(3, MXCFB_SEND_UPDATE_V1_NTX, {update_region={top=11, left=0, width=1030, height=1166}, waveform_mode=WAVEFORM_MODE_AUTO, update_mode=UPDATE_MODE_PARTIAL, update_marker=80, temp=TEMP_USE_AMBIENT, flags=0, alt_buffer_data={virt_addr=(nil), phys_addr=0, width=0, height=0, alt_update_region={top=0, left=0, width=0, height=0}}}, 0x7ec5b334) = 0
[pid   572] 02:07:41 [2f6191f6] ioctl(3, MXCFB_SEND_UPDATE_V1_NTX, {update_region={top=11, left=0, width=1020, height=1020}, waveform_mode=WAVEFORM_MODE_AUTO, update_mode=UPDATE_MODE_PARTIAL, update_marker=81, temp=TEMP_USE_AMBIENT, flags=0, alt_buffer_data={virt_addr=(nil), phys_addr=0, width=0, height=0, alt_update_region={top=0, left=0, width=0, height=0}}}, 0x7ec5b334) = 0
[pid  1006] 02:07:41 [2f6191f6] ioctl(26, FIONREAD, [566]) = 0
^C./strace: Process 572 detached
./strace: Process 848 detached
./strace: Process 850 detached
./strace: Process 856 detached
./strace: Process 878 detached
./strace: Process 884 detached
./strace: Process 918 detached
./strace: Process 1006 detached
./strace: Process 1251 detached
./strace: Process 1254 detached
./strace: Process 1255 detached
./strace: Process 1256 detached

That's exactly what I need to confirm whether we're doing things right on Mark6 & Mark7 devices :).

poire-z commented 6 years ago

Then you move around a bit, first in the Library, then in a book.

Here's what I got doing that on my GloHD with FW 3.16: strace_GloHD_fw3.16.txt

NiLuJe commented 6 years ago

That looks identical to my Mark5 (at least on that FW version), so, so far, so good... :). Thanks!

taosxx commented 6 years ago

Not sure if it's still needed, nevertheless, here is another one: Mark 6 (Glo HD) with firmware 4.8.11073 (GloHD_4.8.11073.txt)

NiLuJe commented 6 years ago

@taosxx : Strace dumps will always make me happy, so, thanks ;).

(Also identical to my Mk5, so, good news :)).

NiLuJe commented 6 years ago

Closing this, since we've established that there's nothing to "fix" ;).

The only question mark left is Mark7, and the code is in to handle that "right", it's just commented out because I'm lacking a Nickel strace dump from a Mark7 ;).

NiLuJe commented 6 years ago

Created #694 as a followup for Mark7 :).