make -C ../magic-lantern/60D_install_qemu
./run_canon_fw.sh 60D,firmware="boot=1" -d debugmsg,io
# same for 600D, 650D, 700D, 70D
In ML menu, selected Display -> Advanced -> Orientation -> Normal/Mirror/Reverse, then copied the console output. Had to silence a few things in QEMU to get clean logs. The important lines are those like this:[ DisplayMgr:ff0611b4 ] (82:02) SIO [3]:0xf01d
[ GuiMainTask:ff325714 ] (04:03) -->Mirror start
[ DisplayMgr:ff0611b4 ] (82:02) SIO [0]:0x1000
[ DisplayMgr:ff0611b4 ] (82:02) SIO [1]:0xbe01
[ DisplayMgr:ff0611b4 ] (82:02) SIO [2]:0xe401
[ DisplayMgr:ff0611b4 ] (82:02) SIO [3]:0xf01d
[ GuiMainTask:ff325774 ] (04:03) -->Normal start
[ DisplayMgr:ff0611b4 ] (82:02) SIO [0]:0x1001
[ DisplayMgr:ff0611b4 ] (82:02) SIO [1]:0xbe01
[ DisplayMgr:ff0611b4 ] (82:02) SIO [2]:0xe401
[ DisplayMgr:ff0611b4 ] (82:02) SIO [3]:0xf01d
[ GuiMainTask:ff325744 ] (04:03) -->Reverse start
[ DisplayMgr:ff0611b4 ] (82:02) SIO [0]:0x1000
[ DisplayMgr:ff0611b4 ] (82:02) SIO [1]:0xbe01
[ DisplayMgr:ff0611b4 ] (82:02) SIO [2]:0xe401
[ DisplayMgr:ff0611b4 ] (82:02) SIO [3]:0xf09d
cat 700D-*.log | grep -E "DisplayMgr.*SIO|-->"
[ GuiMainTask:ff4d91bc ] (04:03) -->Mirror start
[ DisplayMgr:ff128980 ] (82:01) SIO [0]:0x36
[ DisplayMgr:ff128980 ] (82:01) SIO [1]:0x140
[ GuiMainTask:ff4d921c ] (04:03) -->Normal start
[ DisplayMgr:ff128980 ] (82:01) SIO [0]:0x36
[ DisplayMgr:ff128980 ] (82:01) SIO [1]:0x100
[ GuiMainTask:ff4d91ec ] (04:03) -->Reverse start
[ DisplayMgr:ff128980 ] (82:01) SIO [0]:0x36
[ DisplayMgr:ff128980 ] (82:01) SIO [1]:0x1c0
cat 70D-*.log | grep -E "DisplayMgr.*SIO|-->"
[ GuiMainTask:ff504660 ] (04:03) -->Mirror start
[ DisplayMgr:ff134c18 ] (82:02) SIO [0]:0x602
[ GuiMainTask:ff5046c0 ] (04:03) -->Normal start
[ DisplayMgr:ff134c18 ] (82:02) SIO [0]:0x600
[ GuiMainTask:ff504690 ] (04:03) -->Reverse start
[ DisplayMgr:ff134c18 ] (82:02) SIO [0]:0x606
static void run_test()
{
msleep(3000);
#ifdef CONFIG_5D3_113
void (*lcd_sio_init)() = (void *) 0xFF12D284;
void (*lcd_sio_write)(uint32_t * data, int size) = (void *) 0xFF12D1E0;
void (*lcd_sio_finish)(void * sio_obj) = (void *) 0xFF13BDC8;
void ** p_lcd_sio_obj = (void **) 0x246F0;
#endif
// 650D 104: FF127E88, FF127D88, FF13B868, 23C48.
// 700D 115: FF128A28, FF128928, FF13C420, 23C58.
printf("LCD sio start\n");
lcd_sio_init();
lcd_sio_write((uint32_t[]) { 0x36, 0x140 }, 2);
lcd_sio_finish(*p_lcd_sio_obj);
printf("LCD sio finish\n");
}
11949> DisplayMgr:ff12d238:82:02: SIO [0]:0x34
11981> DisplayMgr:ff12d238:82:02: SIO [1]:0x1700
119B5> DisplayMgr:ff12d238:82:02: SIO [2]:0x1808
119E9> DisplayMgr:ff12d238:82:02: SIO [3]:0x1960
11A1C> DisplayMgr:ff12d238:82:02: SIO [4]:0x35
for (int i = 0; i < 64; i++)
{
lcd_sio_init();
lcd_sio_write((uint32_t[]) { 0x34, 0x1900 | (i + (rand() & 3) * 64), 0x35 }, 3);
lcd_sio_finish(*p_lcd_sio_obj);
msleep(50);
}
for (int reg = 0; reg < 0x100; reg++)
{
for (int val = 0; val < 0x100; val++)
{
bmp_printf(FONT_LARGE, 50, 50, "%02x: %02x", reg, val);
lcd_sio_init();
lcd_sio_write((uint32_t[]) { 0x34, (reg << 8) | val, 0x35 }, 3);
lcd_sio_finish(*p_lcd_sio_obj);
msleep(50);
}
/* restore the display back to working condition */
enter_play_mode();
exit_play_qr_mode();
}
700D: ?
#ifdef CONFIG_EOSM_202
void (*lcd_sio_init)() = (void *) 0xFF12909C;
void (*lcd_sio_write)(uint32_t * data, int size) = (void *) 0xFF128F9C;
void (*lcd_sio_finish)(void * sio_obj) = (void *) 0xFF13B454;
void ** p_lcd_sio_obj = (void **) 0x?????;
#endif
// 650D 104: FF127E88, FF127D88, FF13B868, 23C48.
// 700D 115: FF128A28, FF128928, FF13C420, 23C58.
// EOSM 202: FF12909C, FF128F9C, FF13B454, ?????.
if (is_camera("EOSM", "2.0.2"))
{
/* TFT Command start ... TFT Command end */
tft_sio_init = (void *) 0xFF12906C;
tft_sio_write = (void *) 0xFF128F6C;
tft_sio_finish = (void *) 0xFF13B30C;
p_tft_sio_obj = (void **) 0x3EAF0;
}
[67698789] run_test: NULL PTR (0,e1a00000)
pc=19980218 lr= 143e80 stack=1dd9d8+0x8000
entry=a2890(143e80)
e1a00000 e59ff014 e59ff014 e59ff014
e59ff014 e1a00000 e59ff010 e59ff010
Magic Lantern version : Nightly.2017Nov26.EOSM202
Mercurial changeset : ef46234b628a+ (LiveView_flip-wip) tip
Built on 2017-11-26 18:59:44 UTC by rosiefort@RosieFoComputer.
Free Memory : 166K + 3479K
Oops - my disassembly for EOS M was still on 1.0.6...
- color adjusments (temperature?)Interesting , I came across the same thing with the Digic IV/5D2 experimenting with the registries on the adtg_gui build I use in my 3.5k/UHD developments thread
- flipping
- half resolution
- scaling, translation (both H and V)
the most boring videos ever
Mirror/flip registers:
...
650D, 700D: register 0x01, mask 0xC0
lcd_sio_init();
lcd_sio_write((uint32_t[]) { 0x36, 0x140 }, 2);
lcd_sio_finish(*p_lcd_sio_obj);
/* send a SIO command sequence to TFT controller */
static void tft_command(uint32_t * buffer, int size)
{
/* there is a call to take_semaphore in tft_sio_init and give_semaphore in tft_sio_finish */
/* so it's probably thread-safe (todo: test) */
tft_sio_init();
tft_sio_write(buffer, size);
tft_sio_finish(*p_tft_sio_obj);
}
Documenting other registers (either on 5D3 or on other models) is welcome. Other than trial and error, I don't have a better way to analyze them.
Still can't wrap my head around how you came up with the value for p_tft_sio_obj.
tft_command((uint32_t[]) { 0x36, (reg << 8) | val }, 2);
How do you want it documented?
Still can't wrap my head around how you came up with the value for p_tft_sio_obj.
ROM:FF12A76C LDR R4, =0x3E650
...
ROM:FF12A7DC LDR R0, [R4,#0x40]
ROM:FF12A7E0 BL sub_FF13B454
5D3 123: FF12C950, FF12C8AC, FF13BE8C, 23C48
5D3 134: FF12C958, FF12C8B4, FF13BE94, 23C48
7D 203: FF070114, FF070068, FF07F8F4, 21D0
700D: try this for tft_set_reg:Code: [Select]tft_command((uint32_t[]) { 0x36, (reg << 8) | val }, 2);
In other words, register 0 set to value 0x36, then the tested register set to the tested value. Maybe it matters.
Also start the outer brute-forcing loop from 1, not from 0 (for int reg = 1 ...).
Maybe only one of these two tricks is needed, maybe both, not sure.
GuiLockTas:ff0700c8:82:01:8: SIO [6]:0x690
DisplayMgr:ff128980:82:01: SIO [0]:0xd1
DisplayMgr:ff128980:82:01: SIO [1]:0x114
DisplayMgr:ff128980:82:01: SIO [2]:0x11d
DisplayMgr:ff128980:82:01: SIO [3]:0x123
DisplayMgr:ff128980:82:01: SIO [4]:0x144
DisplayMgr:ff128980:82:01: SIO [5]:0x153
DisplayMgr:ff128980:82:01: SIO [6]:0x19a
DisplayMgr:ff128980:82:01: SIO [7]:0xc7
DisplayMgr:ff128980:82:01: SIO [8]:0x100
DisplayMgr:ff128980:82:01: SIO [9]:0x153
DisplayMgr:ff128980:82:01: SIO [10]:0x153
...
DisplayMgr:ff128ca0:82:03: CalcBrightness = 92(DEC)
DisplayMgr:ff128cb8:82:03: CommandBrightness = 0x265c
DisplayMgr:000c5cf0:00:00: *** register_interrupt(0x0, 0x84, 0xff13c07c, 0x5), from ff13c228
DisplayMgr:ff1288dc:82:01: SIO [0]:0x265c
DisplayMgr:000c5cf0:00:00: *** register_interrupt(0x0, 0x84, 0xff13c07c, 0x5), from ff13c228
DisplayMgr:ff1288dc:82:01: SIO [0]:0x2492
**INTERRUP:ff127cb8:82:01: WaitTimerCallBack 120
DisplayMgr:ff1288dc:82:01: SIO [0]:0x2030
/* should have no effect, no matter how many times you call it */
tft_command((uint32_t[]) { rand() & 0xFF }, 1);
/* should set register "reg" to value "val" */
tft_command((uint32_t[]) { reg, 0x100 | val }, 2);
tft_command((uint32_t[]) { (reg << 8) | val }, 1);
tft_command((uint32_t[]) { 0x36, (reg << 8) | val }, 2);
/* should have no effect, no matter how many times you call it */
tft_command((uint32_t[]) { rand() & 0xFF }, 1);
/* should set register "reg" to value "val" */
tft_command((uint32_t[]) { reg, 0x100 | val }, 2);
lcd_sio_write((uint32_t[]) { 0x36, 0x140 }, 2);
/* should set register "reg" to value "val" */
tft_command((uint32_t[]) { reg, 0x100 | val }, 2);
tft_command((uint32_t[]) { (reg << 8) | val }, 1);
for (int reg = 48; reg < 0x100; reg++)
tft_command((uint32_t[]) { reg, 0x100 | val }, 2);
Hi, I tried to compile and test the module for 50D from dfort commit, but it doesn't work.
Having some fun with 7D. Dfort, have you tried register 0x10 with incrementing/decrementing values?
Gamma correction: might be useful to make the screen more readable in sunlight.
Color calibration: was requested before (http://www.magiclantern.fm/forum/index.php?topic=15807). There are LOTS of registers for color adjustments.
Position fine-tuning: when you look at the screen from an angle, might be helpful (most models have it (http://builds.magiclantern.fm/features.html) - IMAGE_POSITION; done with a different method; no idea if the feature is actually working on all of them).
Inverted display colors: was requested (https://www.magiclantern.fm/forum/index.php?topic=18419), already done on DIGIC 4 models, but the image also gets recorded that way (IMAGE_EFFECTS on the feature matrix (http://builds.magiclantern.fm/features.html)). This investigation would allow inverting the display colors without affecting the recorded image.