Commit c96d81bb authored by Mikhail Karpenko's avatar Mikhail Karpenko

WIP: imgsrv stops at reading frame params

parent 99dc26ff
This diff is collapsed.
This diff is collapsed.
...@@ -38,7 +38,7 @@ struct huffman_pd { ...@@ -38,7 +38,7 @@ struct huffman_pd {
int jpeg_htable_is_programmed(void); int jpeg_htable_is_programmed(void);
void jpeg_htable_init (void); void jpeg_htable_init (void);
int jpeg_htable_fpga_encode (void); int jpeg_htable_fpga_encode (void);
void jpeg_htable_fpga_pgm (void); void jpeg_htable_fpga_pgm (unsigned int chn);
int jpeg_prep_htable (struct huffman_encoded_t * htable, struct huffman_fpga_code_t * hcodes); int jpeg_prep_htable (struct huffman_encoded_t * htable, struct huffman_fpga_code_t * hcodes);
#endif /* _JPEGHEAD */ #endif /* _JPEGHEAD */
...@@ -283,7 +283,15 @@ inline void updateIRQFocus(struct jpeg_ptr_t *jptr) ...@@ -283,7 +283,15 @@ inline void updateIRQFocus(struct jpeg_ptr_t *jptr)
u32 high_freq = x393_cmprs_hifreq(jptr->chn_num); u32 high_freq = x393_cmprs_hifreq(jptr->chn_num);
} }
static void set_default_interframe(struct interframe_params_t *params)
{
params->height = 1936;
params->width = 2592;
params->byrshift = 0;
params->color = 0;
params->quality2 = 127;
dev_dbg(NULL, "%s: DEBUG, setting default interframe parameters\n", __func__);
}
/** /**
* @brief Locate area between frames in the circular buffer * @brief Locate area between frames in the circular buffer
...@@ -310,10 +318,13 @@ inline struct interframe_params_t* updateIRQ_interframe(struct jpeg_ptr_t *jptr) ...@@ -310,10 +318,13 @@ inline struct interframe_params_t* updateIRQ_interframe(struct jpeg_ptr_t *jptr)
int circbuf_size = BYTE2DW(get_globalParam(G_CIRCBUFSIZE)); int circbuf_size = BYTE2DW(get_globalParam(G_CIRCBUFSIZE));
int len_offset = X393_BUFFSUB(jptr->jpeg_wp, 8); int len_offset = X393_BUFFSUB(jptr->jpeg_wp, 8);
int len32 = circbuf_priv_ptr[jptr->chn_num].buf_ptr[len_offset] & FRAME_LENGTH_MASK; int len32 = circbuf_priv_ptr[jptr->chn_num].buf_ptr[len_offset] & FRAME_LENGTH_MASK;
int frame_params_offset = X393_BUFFSUB(jptr->jpeg_wp, INTERFRAME_PARAMS_SZ); int frame_params_offset = X393_BUFFSUB(jptr->jpeg_wp, OFFSET_X40);
interframe = (struct interframe_params_t *) &circbuf_priv_ptr[jptr->chn_num].buf_ptr[frame_params_offset]; interframe = (struct interframe_params_t *) &circbuf_priv_ptr[jptr->chn_num].buf_ptr[frame_params_offset];
interframe->frame_length = len32; //interframe->frame_length = len32;
set_default_interframe(interframe);
set_globalParam(G_FRAME_SIZE, len32); set_globalParam(G_FRAME_SIZE, len32);
return interframe; return interframe;
...@@ -462,9 +473,9 @@ static irqreturn_t compressor_irq_handler(int irq, void *dev_id) ...@@ -462,9 +473,9 @@ static irqreturn_t compressor_irq_handler(int irq, void *dev_id)
if (updateIRQJPEG_wp(priv)) { if (updateIRQJPEG_wp(priv)) {
update_irq_circbuf(priv); update_irq_circbuf(priv);
updateIRQFocus(priv); updateIRQFocus(priv);
/*interframe = updateIRQ_interframe(); interframe = updateIRQ_interframe(priv);
updateIRQ_Exif(interframe); //updateIRQ_Exif(interframe);
wake_up_interruptible(&circbuf_wait_queue);*/ wake_up_interruptible(&circbuf_wait_queue);
} }
//wake_up_interruptible(&framepars_wait_queue); //wake_up_interruptible(&framepars_wait_queue);
...@@ -513,7 +524,7 @@ void tasklet_fpga_function(unsigned long arg) { ...@@ -513,7 +524,7 @@ void tasklet_fpga_function(unsigned long arg) {
int len32; int len32;
int circbuf_size = get_globalParam(G_CIRCBUFSIZE); int circbuf_size = get_globalParam(G_CIRCBUFSIZE);
unsigned long *buf_ptr; unsigned long *buf_ptr;
printk(KERN_DEBUG "%s: get_globalParam(G_CIRCBUFSIZE) = %d", __func__, circbuf_size); printk(KERN_DEBUG "%s: get_globalParam(G_CIRCBUFSIZE) = %d\n", __func__, circbuf_size);
#ifdef TEST_DISABLE_CODE #ifdef TEST_DISABLE_CODE
......
...@@ -1641,37 +1641,17 @@ struct sensorproc_t { ...@@ -1641,37 +1641,17 @@ struct sensorproc_t {
///*32-35*/ unsigned long timestamp_usec; //! number of microseconds to add ///*32-35*/ unsigned long timestamp_usec; //! number of microseconds to add
//}; //};
/* Some fields were rearranged to make old code happy, this should to be fixed /* Some fields were removed, may be we will need them later
* Last three double words contain time stamp and (length+0xff) marker in new camera * Last three double words contain time stamp and (length+0xff) marker in new camera
*/ */
struct interframe_params_t { struct interframe_params_t {
/// This data will survive as long as the frame itself in the circular buffer. Some other fields (like exposure) are stored in Exif unsigned long quality2;
/// dont move - should partially match P_* area unsigned long color;
union { unsigned long byrshift;
union{unsigned long hash32_r; struct{unsigned short scale_r; union {unsigned short hash16_r; struct{unsigned char gamma_r; unsigned char black_r; };};};}; ///00-03 unsigned long width;
union{unsigned long hash32_g; struct{unsigned short scale_g; union {unsigned short hash16_g; struct{unsigned char gamma_g; unsigned char black_g; };};};}; ///04-07 unsigned long height;
}; unsigned long timestamp_sec; //! number of seconds since 1970 till the start of the frame exposure
union{unsigned long hash32_gb;struct{unsigned short scale_gb;union {unsigned short hash16_gb;struct{unsigned char gamma_gb;unsigned char black_gb;};};};}; ///08-11 unsigned long timestamp_usec; //! number of microseconds to add
union{unsigned long hash32_b; struct{unsigned short scale_b; union {unsigned short hash16_b; struct{unsigned char gamma_b; unsigned char black_b; };};};}; ///12-15
unsigned short quality2; /// Quality is represented by 2-byte value. Each byte uses Y table if the value is Q<128,// 16-17
/// and C table with (Q-128) if it is Q>=128.
/// If the High byte is zero, it is treated as Q^0x80 (Q|=(Q^0x80)<<8) for compatibility
/// with a standard single-byte Q value
/// updated in 8.0.8.37 - bit 7 in quality2 means "portrait mode"
unsigned char color; /// color mode //18
unsigned char byrshift; /// bayer shift in compressor //19
unsigned short width; /// frame width, pixels 20-21 - NOTE: should be 20-21
unsigned short height; /// frame height, pixels 22-23
/*24 *//// unsigned char bindec_hor; //! ((bh-1) << 4) | (dh-1) & 0xf (binning/decimation horizontal, 1..16 for each)
/*25 *//// unsigned char bindec_vert; //! ((bv-1) << 4) | (dv-1) & 0xf (binning/decimation vertical , 1..16 for each)
/*24-25*/ unsigned long meta_index; //! index of the linked meta page
union {
/*28-31*/ unsigned long timestamp_sec ; //! number of seconds since 1970 till the start of the frame exposure
/*28-31*/ unsigned long frame_length; //! JPEG frame length in circular buffer, bytes
};
/*32-35*/ unsigned long timestamp_usec; //! number of microseconds to add
union { union {
unsigned long len32; //! should be 0xffxxyyzz - it will be a signature that JPEG data was not overwritten, unsigned long len32; //! should be 0xffxxyyzz - it will be a signature that JPEG data was not overwritten,
//! xxyyzz here is the length in 32 double words; //! xxyyzz here is the length in 32 double words;
...@@ -1679,7 +1659,7 @@ struct interframe_params_t { ...@@ -1679,7 +1659,7 @@ struct interframe_params_t {
unsigned char pad0; // pad double word with 3 bytes and use only most significant byte as 0xff marker unsigned char pad0; // pad double word with 3 bytes and use only most significant byte as 0xff marker
unsigned char pad1; unsigned char pad1;
unsigned char pad2; unsigned char pad2;
unsigned char signffff; unsigned char signff;
}; };
}; };
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment