60D and 7D have about 7-8 MB that appears to be unused by RscMgr (source). Currently, autoexec.bin is loaded there, but this doesn't fully use this memory.
With this PR, I've changed the 60D boot method to the one used on 550D/1100D (autoexec in AllocateMemory, with init_task patched on the fly), and I've used Canon's low-level allocation functions from AllocateMemory to manage the new 7MB buffer. Now, even under heavy load, ML will not have to allocate general-purpose memory from shoot_malloc (which can't be kept allocated forever) or from Canon's memory pools (which, on 60D, are nearly full).
Example: loaded Lua with a bunch of scripts, without umm_malloc, and a few other modules:
Some extra advantages of this change:
QEMU loads the vanilla 60D autoexec.bin (without compiling it with CONFIG_QEMU). Not much works this way though, but Canon GUI boots, alongside with flexinfo over it, and Lua startup scripts, if you have any.
dm-spy-experiments can now be used on 60D without having to disable 90% of the features so it can fit in RAM.
I did not do extensive tests to make sure the buffer is really unused, but I plan to do so
enable this on 7D (done, please test), maybe also 50D and 700D
Compiled for 7D and running. Did some selftests without problems so far.
Benchmark seems to perform about 2 percent better. About 92 MByte/s with Komputerbay 128 GB 1066x.
Anything in particular to test?
What’s the status of this PR? Do you want us to do further testing?
Last time I’ve checked, it was half-broken on 60D.
This worked wonders for getting the 7D working with 10/12-bit raw video when merged into the raw_video_10bit_12bit_LVState. However, it looks like pretty much every other platform won’t compile:
[ CC ] lv-img-engio.o
../../src/lv-img-engio.c: In function 'digic_iso_step':
../../src/lv-img-engio.c:899:33: error: implicit declaration of function '_raw_lv_get_iso_post_gain' [-Werror=implicit-function-declaration]
total_movie_gain *= _raw_lv_get_iso_post_gain();
../../src/lv-img-engio.c: At top level:
../../src/lv-img-engio.c:1012:30: error: 'EM_SHOW_LIVEVIEW' undeclared here (not in a function)
.edit_mode = EM_SHOW_LIVEVIEW,
cc1: some warnings being treated as errors
make: *** [lv-img-engio.o] Error 1
make: *** Waiting for unfinished jobs....
BTW – Could this possibly work on the 500D/550D like it did with the 7D? I took a closer look at what was done on the 7D and 60D and see that there are several stubs that need to be found and a few other changes to get it working properly.
The 550D and 500D are already using the classic boot method, so… no, it won’t help at all with 10/12-bit recording.
On 550D, this might help a tiny bit under heavy Lua workloads (if at all), but that’s pretty much the only benefit there. IIRC this camera doesn’t have much trouble with general-purpose memory. 500D is even better in this regard.