chdk in the DIGIC6 world - page 13 - General Discussion and Assistance - CHDK Forum

chdk in the DIGIC6 world

  • 167 Replies
  • 74079 Views
*

Offline srsa_4c

  • ******
  • 4031
Re: chdk in the DIGIC6 world
« Reply #120 on: 05 / November / 2017, 10:46:14 »
Advertisements
I noticed a possible issue with the Digic6 build changes while working on the G5X port.


The FONT_WIDTH and FONT_HEIGHT values change in gui_draw.h based on the THUMB_FW value.


Unfortunately gui_draw.h is included by lib/font/rbf_font.c and many of the modules & games.


All the lib & module code is supposed to be platform independent and is only built once by the autobuild process (based on the first camera settings - A1000).


This means that for an autobuild the Digic6 cameras will have the wrong value for the font size built into the lib code and the module code.
:-[
You're right. Testing current autobuild on sx280 indeed shows broken RBF fonts (the are drawn ~half size).

Quote
I think it would be better to keep the FONT_WIDTH and FONT_HEIGHT values constant at their current values (8x16) and handle the Digic6 scaling within the gui_draw.c code and platform settings. This way the rest of the code continues to work with the same CHDK 'virtual' co-ordinate system.


I'm doing this for the G5X which has yet another drawing system (32bpp bitmap, with X2 scaling in both directions).
I'd be interested in seeing that new drawing system. I was thinking about using the RGBA buffer(s), but have not attempted to make an implementation.
If yours proves to be a usable alternative, we could remove the D6 related mess from core/gui_draw.c (and elsewhere) and implement the new system on all D6 ports.


*

Offline reyalp

  • ******
  • 12159
Re: chdk in the DIGIC6 world
« Reply #121 on: 05 / November / 2017, 15:00:07 »
The FONT_WIDTH and FONT_HEIGHT values change in gui_draw.h based on the THUMB_FW value.


Unfortunately gui_draw.h is included by lib/font/rbf_font.c and many of the modules & games.


All the lib & module code is supposed to be platform independent and is only built once by the autobuild process (based on the first camera settings - A1000).
I'm probably missing something, but this seems like a much bigger problem than just font size. All code for thumb2 platforms should built separately from the arm platforms (objects in .o2 instead of .o) so it has been assumed in a lot of places that THUMB_FW is safe to use in "platform independent" code.

Quote
I'm doing this for the G5X which has yet another drawing system (32bpp bitmap, with X2 scaling in both directions).
If it needs yet another drawing system, the above mentioned THUMB_FW assumption goes out the window. I knew this would be problem, but was hoping it wouldn't be so soon.
Don't forget what the H stands for.

*

Offline philmoz

  • *****
  • 3129
    • Photos
Re: chdk in the DIGIC6 world
« Reply #122 on: 05 / November / 2017, 16:08:55 »
[
Quote
I think it would be better to keep the FONT_WIDTH and FONT_HEIGHT values constant at their current values (8x16) and handle the Digic6 scaling within the gui_draw.c code and platform settings. This way the rest of the code continues to work with the same CHDK 'virtual' co-ordinate system.


I'm doing this for the G5X which has yet another drawing system (32bpp bitmap, with X2 scaling in both directions).
I'd be interested in seeing that new drawing system. I was thinking about using the RGBA buffer(s), but have not attempted to make an implementation.
If yours proves to be a usable alternative, we could remove the D6 related mess from core/gui_draw.c (and elsewhere) and implement the new system on all D6 ports.


Although it works the main problem is it destroys the Canon UI and I have not found a way to trigger it to refresh.


On the G5X there is only one buffer, and to erase the CHDK UI (e.g. leaving ALT or menu) I clear this buffer - this also wipes the Canon UI elements which don't get redrawn unless a significant event happens (enter & leave Canon menu for example).


So I can get the CHDK UI to work at the expense of the Canon UI.


Phil.





CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)

*

Offline philmoz

  • *****
  • 3129
    • Photos
Re: chdk in the DIGIC6 world
« Reply #123 on: 05 / November / 2017, 16:13:51 »
The FONT_WIDTH and FONT_HEIGHT values change in gui_draw.h based on the THUMB_FW value.


Unfortunately gui_draw.h is included by lib/font/rbf_font.c and many of the modules & games.


All the lib & module code is supposed to be platform independent and is only built once by the autobuild process (based on the first camera settings - A1000).
I'm probably missing something, but this seems like a much bigger problem than just font size. All code for thumb2 platforms should built separately from the arm platforms (objects in .o2 instead of .o) so it has been assumed in a lot of places that THUMB_FW is safe to use in "platform independent" code.


Hmm, you're right, it should build separately. I'll need to look at this again.

Quote
Quote
I'm doing this for the G5X which has yet another drawing system (32bpp bitmap, with X2 scaling in both directions).
If it needs yet another drawing system, the above mentioned THUMB_FW assumption goes out the window. I knew this would be problem, but was hoping it wouldn't be so soon.


Yes, this tripped me up for a while. I've added a few new #define controls in my G5X code; but it's still quite a way from being added to SVN.


Phil.
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)


*

Offline srsa_4c

  • ******
  • 4031
Re: chdk in the DIGIC6 world
« Reply #124 on: 05 / November / 2017, 17:11:00 »
Although it works the main problem is it destroys the Canon UI and I have not found a way to trigger it to refresh.


On the G5X there is only one buffer, and to erase the CHDK UI (e.g. leaving ALT or menu) I clear this buffer - this also wipes the Canon UI elements which don't get redrawn unless a significant event happens (enter & leave Canon menu for example).
I see, that's less than ideal.

I've been meaning to ask the following for a while.
What do you see in the camera's RAM at 0x5fe80000 (uncached) and beyond that?
If the g5x worked like the m10, the end of physical RAM would be assigned to YUV and opacity buffers.
The address comes from here (100c):
Code: [Select]
fc1b9218: 483c      ldr r0, =0x5fe80000I found this when doing the m10 port - while looking for equivalent parts of the firmwares.

And another question: In shooting modes where the focus rectangle is moving around; is it drawn on that single RGBA buffer?

*

Offline philmoz

  • *****
  • 3129
    • Photos
Re: chdk in the DIGIC6 world
« Reply #125 on: 05 / November / 2017, 17:25:04 »
:-[
You're right. Testing current autobuild on sx280 indeed shows broken RBF fonts (the are drawn ~half size).


Now I'm confused again. As reyalp said the build logic should take care of this - the THUMB_FW code is built in the .o2 folders. The modules/lib code should be built again for the first THUMB_FW camera with the correct values.


Phil.

CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)

*

Offline srsa_4c

  • ******
  • 4031
Re: chdk in the DIGIC6 world
« Reply #126 on: 05 / November / 2017, 17:39:44 »
Now I'm confused again.
Nevermind, I was wrong (this shows how often I set RBF fonts). There is no font size difference between autobuild and my own single build.

*

Offline philmoz

  • *****
  • 3129
    • Photos
Re: chdk in the DIGIC6 world
« Reply #127 on: 05 / November / 2017, 18:22:15 »
Although it works the main problem is it destroys the Canon UI and I have not found a way to trigger it to refresh.


On the G5X there is only one buffer, and to erase the CHDK UI (e.g. leaving ALT or menu) I clear this buffer - this also wipes the Canon UI elements which don't get redrawn unless a significant event happens (enter & leave Canon menu for example).
I see, that's less than ideal.

I've been meaning to ask the following for a while.
What do you see in the camera's RAM at 0x5fe80000 (uncached) and beyond that?
If the g5x worked like the m10, the end of physical RAM would be assigned to YUV and opacity buffers.
The address comes from here (100c):
Code: [Select]
fc1b9218:    483c         ldr   r0, =0x5fe80000I found this when doing the m10 port - while looking for equivalent parts of the firmwares.


Thanks, I'll check it out.


Quote
And another question: In shooting modes where the focus rectangle is moving around; is it drawn on that single RGBA buffer?


It does not appear to be written to the RGBA buffer.


Phil.

CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)


*

Offline philmoz

  • *****
  • 3129
    • Photos
Re: chdk in the DIGIC6 world
« Reply #128 on: 06 / November / 2017, 15:29:44 »
I've been meaning to ask the following for a while.
What do you see in the camera's RAM at 0x5fe80000 (uncached) and beyond that?
If the g5x worked like the m10, the end of physical RAM would be assigned to YUV and opacity buffers.
The address comes from here (100c):
Code: [Select]
fc1b9218:    483c         ldr   r0, =0x5fe80000I found this when doing the m10 port - while looking for equivalent parts of the firmwares.


When you draw the CHDK stuff on the YUV layer does it appear below the Canon UI elements?
If so what happens if the Canon menu is showing and you try and get into ALT mode and use the menus?


Phil.

CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)

*

Offline srsa_4c

  • ******
  • 4031
Re: chdk in the DIGIC6 world
« Reply #129 on: 06 / November / 2017, 16:18:59 »
When you draw the CHDK stuff on the YUV layer does it appear below the Canon UI elements?
If stuff is drawn on the overlay buffers (YUV + opacity), it completely replaces any Canon screen content. If you only draw on the YUV buffer and don't touch the corresponding opacity buffer, the visibility of your drawing will depend on Canon's graphics.
The address I wrote would be the start of the first YUV overlay buffer, the opacity buffers would be located immediately before that (their start address should be referenced near 0xfc1b9218).

 

Related Topics