TX1 Porting Completed - page 3 - General Discussion and Assistance - CHDK Forum

TX1 Porting Completed

  • 91 Replies
  • 35494 Views
*

Offline GrAnd

  • ****
  • 916
  • [A610, S3IS]
    • CHDK
Re: TX1 Porting Completed
« Reply #20 on: 22 / April / 2008, 15:25:42 »
Advertisements
Anyway, I do not understand, why it may require 480 on boot. And how it could be used on boot either.
There is no differences between tx1 and other firmwares in this case. They also have the 480 constant. It's weird.
CHDK Developer.

Re: TX1 Porting Completed
« Reply #21 on: 22 / April / 2008, 16:12:18 »
There is no differences between tx1 and other firmwares in this case. They also have the 480 constant.

OK, I will look at the old emails and maybe do some tests.

Before I try to get the zebra working, can you tell me how the buffers are arranged ?

'Viewport' refers to memory where the record and playback images are stored ?
The viewport dimensions are normally 360x240 but on some cameras are 230 wide in playback mode ?
Each pixel is stored as three bytes (but not in RGB format) ?

Or is viewport height really 270 ?

The bitmap frame-buffer is were all our drawing is done, is it the same width and height as the viewport ?


The exact relationship between these buffers and the pixel-dimensions of the camera screen is not clear.

In the zebra code, for example,  the ratio viewport_height/screen_height is a factor in the calculations.


David

*

Offline ewavr

  • ****
  • 1057
  • A710IS
Re: TX1 Porting Completed
« Reply #22 on: 22 / April / 2008, 16:22:00 »
@Grand

Found somewhere in my email sent folder:

0xFFA3871C for TX1 (first dumped firmware)
  MOV R3, #0x10000000
  MOV R2, #0x10C
  ADD R3, R3, #0x360000
  LDR LR, =0x84C8
  MOV R12, #0x3C0 // 0x3C0=960, screen width in 2 times narrow = 480
  ADD R2, R2, #3     // total =0x10F = 271
  ADD R3, R3, #0x1000  // total 0x10361000

Compare it to A710 (@0xFFD37DC4):
  MOV R3, #0x10000000
  ADD R3, R3, #0x360000
  LDR LR, =0x5FFC
  MOV R12, #0x2D0  // 0x2D0=720,  screen width in 2 times narrow = 360
  MOV R2, #0xF0 // 0xF0= 240
  ADD R3, R3, #0x1000 // // total 0x10361000

If TX1 bitmap size is set to 320x240, some artifacts on image (startup screen, (c) Microfunguy).
If 480x271, normal image.

@Microfunguy:
Frame-buffer dimensions(for live/recorded image) for TX1 maybe is not equal to bitmap dimensions. 
Maybe vid_get_viewport_width() function required for TX1 for histogram/zebra.
« Last Edit: 22 / April / 2008, 16:41:28 by ewavr »

*

Offline GrAnd

  • ****
  • 916
  • [A610, S3IS]
    • CHDK
Re: TX1 Porting Completed
« Reply #23 on: 22 / April / 2008, 16:41:26 »
> 'Viewport' refers to memory where the record and playback images are stored ?
Yes. Zebra and Histogram take the data from that buffer for analysis.

> The viewport dimensions are normally 360x240 but on some cameras are 230 wide in playback mode ?
Regarding the height - you are correct.  But the width is 720 pixels actually. It's encoded as UYVYYY, So each 6 bytes represent 4 pixels.
If you look in histogram code, you can notice that the buffer size is 360*240*3. It's the same as 720*240/4*6 .

> Each pixel is stored as three bytes (but not in RGB format) ?
See above.

> Or is viewport height really 270 ?
I do not know. It's usually clear see from zebra drawing (if it missed Y-axis size).
BTW. It TVout mode the height seems to be 576 pixels. But CHDK does not bother about this mode.

> The bitmap frame-buffer is were all our drawing is done, is it the same width and height as the viewport ?
Not exactly. But it's the 360x240 for all cameras for now. Is TX1 the exception? It could be, but I doubt.

> In the zebra code, for example,  the ratio viewport_height/screen_height is a factor in the calculations.
Because they can be not the same - the case 240/230.
CHDK Developer.


Re: TX1 Porting Completed
« Reply #24 on: 22 / April / 2008, 16:42:07 »
Found somewhere in my email sent folder:


You beat me to it, I have just found those emails from 20th March   :)

The situation was ... the camera would boot but splash-screen was 'interlaced' and in three columns.

The following cured that problem :-

long vid_get_bitmap_width()
{
    return 480;
}

long vid_get_bitmap_height()
{
    return 271;
}


long vid_get_viewport_height()
{
    return 271;
}


I do not know if it was necessary to set viewport height to 271 or 240.

Anyway, the splashscreen was not centred so in gui.c  'screen_width'  became 'screen_width -120'  for the TX1.

All other displays that use screen_width (palette, calendar, debug, file reader, benchmarks) have 120 subtracted for the TX1 in order to centre them correctly.


I am not sure what we do with zebra mode as it works with buffers equal to screen size.


Does that mean 360x240 or 480x271 or 480x270 ?

(for those who do not know, the TX1 has the option of a 16:9 aspect-ratio).



David

*

Offline ewavr

  • ****
  • 1057
  • A710IS
Re: TX1 Porting Completed
« Reply #25 on: 22 / April / 2008, 16:46:40 »
@ Microfunguy:
We need screenshot with zebra (and/or memory dump).

BTW, 480/270=16/9.
« Last Edit: 22 / April / 2008, 16:53:42 by ewavr »

Re: TX1 Porting Completed
« Reply #26 on: 22 / April / 2008, 16:58:29 »
@ Microfunguy:
We need screenshot with zebra

Yes, I have already asked Cybercom to provide screenshot of solid zebra to check if there really is a problem.

Quote
BTW, 480/270=16/9.


I know that, but 480/271 does not and 271 is in the firmware  ;)

*

Offline GrAnd

  • ****
  • 916
  • [A610, S3IS]
    • CHDK
Re: TX1 Porting Completed
« Reply #27 on: 22 / April / 2008, 17:04:30 »
Ok. I have the idea. Two bitmap buffers have 480x270(271?) dimension. If you use 360 as width you can see the second buffer drawn on first screen. Because the address of second buffer is calculated from its size:
Code: (c) [Select]
    screen_width = vid_get_bitmap_width();
    screen_height  = vid_get_bitmap_height();
    screen_size = screen_width * screen_height;
    frame_buffer[0] = vid_get_bitmap_fb();
    frame_buffer[1] = frame_buffer[0] + screen_size;

But in the same time only 360 pixels in each line are used. That's why the logo is not centered if the width is set to 480.
Maybe Canon supposed to install wide LCD-screen to this cam but failed for some reasons.
CHDK Developer.


Re: TX1 Porting Completed
« Reply #28 on: 22 / April / 2008, 17:30:47 »
only 360 pixels in each line are used.

That is the first 360 pixels (not 60 to 420)  ?

Does the firmware interpolate the 720 wide viewport to fit the 360 wide screen ?


Anyway, as histograms and zebra are dealing with buffers I guess they need to be the real 480x270 or 480x271 size.

Not sure about the rest of the zebra code, will wait until Cybercom posts screen image 'tomorrow'.

*

Offline GrAnd

  • ****
  • 916
  • [A610, S3IS]
    • CHDK
Re: TX1 Porting Completed
« Reply #29 on: 22 / April / 2008, 17:47:35 »
> That is the first 360 pixels (not 60 to 420)  ?
From the pictures above it looks like the first 360 pixels are in use.

> Does the firmware interpolate the 720 wide viewport to fit the 360 wide screen ?
I think it's done by hardware.
More than a year ago when i analyzed the format of viewport buffer I got the picture grabbed from the buffer and decoded:


The actual shot was:


> as histograms and zebra are dealing with buffers I guess they need to be the real 480x270 or 480x271 size.
I agree. But it is not a big deal to manage this if all dimensions are known.
CHDK Developer.

 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal