Zebra display can work on all 16:9 TFT Cams but change need to lower mem usage. - page 2 - DryOS Development - CHDK Forum supplierdeeply

Zebra display can work on all 16:9 TFT Cams but change need to lower mem usage.

  • 14 Replies
  • 9648 Views
Advertisements
« Last Edit: 01 / January / 2011, 05:39:56 by Bernd R »
Ixus 1000 HS

*

Offline reyalp

  • ******
  • 14079
maybe other can try this idea or help if it work better on 16:9 Camera when have a buffer
I don't understand. Your idea about AllocateUncacheableMemory is wrong, as I explained.
Quote
maybe when allways allocate a 16:9 temporary buffer, and copy the display buffer(center) to correct positions, zebra/edge overlay can work in 4:3 mode too ?
??? I don't understand.
Quote
I think in libc this fixed values are wrong, because when the camera use a 4:3 shooting mode, the wide of the buffer is smaller.so need return value depend on shooting mode.

 long vid_get_bitmap_buffer_width() { return 960; }

long vid_get_bitmap_buffer_height() { return 270; }
So change the code so it depends on shooting mode....

Quote
1 raw have 15 meg, so this are a buffer of 75 megabyte need.75 is a odd number for memory, maybe there are some 500 kb more RAM here.
Odd number doesn't mean anything. There are other pools, this is known. To figure out how to use them you need to be able to reverse engineer the firmware.

Information below is untested:
The stings EXMEM_* list the different memory pools.
If you look at ExMem.AllocateCachable eventproc, it calls another function (sub_FF86C810 in d10), something like this
f(0xA,<size>,0)
Based on a table of the EXMEM_ strings (starting at FFB5031C in d10), this should be EXMEM_SCRIPT. The final 0 means cachable.
edit: looks like this is actually something else. AllocateUncachable calls different but very similar function, with the equivalent parameter also set to zero.

In my experience EXMEM_SCRIPT is small (not big enough for a full CHDK build). But 0 above should be EXMEM_RAMDISK, which ewavr reported to allowed a lot to be allocated.

You will also have to make the corresponding free function, which you should also be able to base on the corresponding ExMem eventproc.

Side effects of using memory from these pools are unknown.

Edit:
It looks like these only allow a single allocation (the Free function doesn't take an argument), so you'd need to make a sub-allocator if you wanted to use one as a replacement from malloc. This probably makes my conclusion that EXMEM_SCRIPT is small wrong, because I was trying to allocate more than one thing from it.

Edit:
If ExMem.View is to be believed, EXMEM_SCRIPT is good for 3,185,280 bytes on D10.
If you use ExMem.AllocCacheable with any size, this shows up in the size column of ExMem.View. If you free, it goes back to zero. It doesn't fail if you request a larger value.

Maybe I'm not understanding how this works...

Edit:
OK, I'm definitely not understanding something.
If I call_event_proc("ExMem.AllocCacheable") with any value, ExMem.View always reports
 EXMEM_SCRIPT         [0x43E02B80] , [0x00309A80]

If I call sub_FF86C810(0xA,size,0) it reports the requested size. Same for all the other EXMEM_ pools. It asserts if you try to alloc on one that is already allocated.

ExMem.AllocCacheable is
Code: [Select]
MOV     R1, R0
MOV     R0, #0xA
MOV     R2, #0
B       sub_FF86C810
And is registered with
RegisterEventProcedure_im1
« Last Edit: 02 / January / 2011, 02:21:18 by reyalp »
Don't forget what the H stands for.

*

Offline reyalp

  • ******
  • 14079
Hmmmmm
Don't forget what the H stands for.

@reyalp
>I don't understand. Your idea about AllocateUncacheableMemory is wrong, as I explained.

thanks for your explain, my idea was not limit of this function, i only want know if it is possible with that function to allocate more memory.I have understand in your first post that this is not possible and there is currently no way to allocate more memory.

but maybe the Expert developers can take that in mind , if they have time, try out how to get more memory.

>EXMEM_SCRIPT         [0x43E02B80] , [0x00309A80]

does your latest screenshot show alloc of more mem does work now ?.thats great, 16 megabyte is lots of RAM.
« Last Edit: 02 / January / 2011, 06:39:44 by Bernd R »
Ixus 1000 HS


*

Offline reyalp

  • ******
  • 14079
I've checked in some code and started a new thread for this http://chdk.setepontos.com/index.php?topic=5980.msg59128#msg59128
Don't forget what the H stands for.

 

Related Topics