Commit 4ddade87 authored by Andrey Filippov's avatar Andrey Filippov

debugging with updated FPGA code (039300a8), removed debug files

parent 0d5bd2de
This diff is collapsed.
// FILE NAME : cxsdma.h
// read/write image and FPN buffers from SDRAM
#ifndef _CIRCBUF_H
#define _CIRCBUF_H
#include <linux/poll.h>
int circbuf_all_open (struct inode *inode, struct file *filp); // set filesize
int circbuf_all_release(struct inode *inode, struct file *filp);
loff_t circbuf_all_lseek (struct file * file, loff_t offset, int orig);
ssize_t circbuf_all_write (struct file * file, const char * buf, size_t count, loff_t *off);
ssize_t circbuf_all_read (struct file * file, char * buf, size_t count, loff_t *off);
int circbuf_all_mmap (struct file *file, struct vm_area_struct *vma);
unsigned int circbuf_all_poll (struct file *file, poll_table *wait);
//!just to notify it is not implemented
int circbuf_all_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg);
int circbuf_open (struct inode *inode, struct file *filp); // set filesize
loff_t circbuf_lseek (struct file * file, loff_t offset, int orig);
ssize_t circbuf_write (struct file * file, const char * buf, size_t count, loff_t *off);
ssize_t circbuf_read (struct file * file, char * buf, size_t count, loff_t *off);
int circbuf_mmap (struct file *file, struct vm_area_struct *vma);
unsigned int circbuf_poll (struct file *file, poll_table *wait);
//int init_ccam_dma_buf_ptr(void);
/*!======================================================================================
*! Wait queue for the processes waiting for a new frame to appear in the circular buffer
*!======================================================================================*/
extern wait_queue_head_t circbuf_wait_queue;
extern unsigned long *ccam_dma_buf_ptr;
//unsigned long *circbuf_get_ccam_ptr(void);
// private data
struct circbuf_priv_t {
int minor;
unsigned long *buf_ptr;
dma_addr_t phys_addr;
};
extern struct circbuf_priv_t *circbuf_priv_ptr;
#endif /* _CIRCBUF_H */
...@@ -938,7 +938,7 @@ loff_t circbuf_lseek(struct file * file, loff_t offset, int orig) { ...@@ -938,7 +938,7 @@ loff_t circbuf_lseek(struct file * file, loff_t offset, int orig) {
return file->f_pos ; //! data already available, return file pointer return file->f_pos ; //! data already available, return file pointer
default: default:
if ((offset & ~0x1f)==LSEEK_DAEMON_CIRCBUF) { if ((offset & ~0x1f)==LSEEK_DAEMON_CIRCBUF) {
wait_event_interruptible (circbuf_wait_queue, get_imageParamsThis(chn, P_DAEMON_EN) & (1<<(offset & 0x1f))); wait_event_interruptible (circbuf_wait_queue, get_imageParamsFrame(chn, P_DAEMON_EN, camSeqGetJPEG_frame(chn)) & (1<<(offset & 0x1f)));
} }
} }
dev_dbg(g_dev_ptr, "return SEEK_END file->f_pos =0x%08llx\n",file->f_pos); dev_dbg(g_dev_ptr, "return SEEK_END file->f_pos =0x%08llx\n",file->f_pos);
......
...@@ -67,10 +67,12 @@ extern struct circbuf_priv_t *circbuf_priv_ptr; ...@@ -67,10 +67,12 @@ extern struct circbuf_priv_t *circbuf_priv_ptr;
#endif #endif
/* debug code follows */ /* debug code follows */
#ifdef PRE_FRAMEPARS
extern unsigned short circbuf_quality; extern unsigned short circbuf_quality;
extern unsigned short circbuf_height; extern unsigned short circbuf_height;
extern unsigned short circbuf_width; extern unsigned short circbuf_width;
extern unsigned char circbuf_byrshift; extern unsigned char circbuf_byrshift;
#endif
/* end of debug code */ /* end of debug code */
#endif /* _CIRCBUF_H */ #endif /* _CIRCBUF_H */
...@@ -19,6 +19,7 @@ int initMultiPars (int sensor_port); /// initialize structures for individu ...@@ -19,6 +19,7 @@ int initMultiPars (int sensor_port); /// initialize structures for individu
void initFramePars (int sensor_port); ///initialize all parameters, set thisFrameNumber to frame8 (read from hardware, usually 0 after resetting i2c and cmd_seq) void initFramePars (int sensor_port); ///initialize all parameters, set thisFrameNumber to frame8 (read from hardware, usually 0 after resetting i2c and cmd_seq)
void resetFrameNumber (int sensor_port, u32 aframe, int hreset); /// reset this frame number (called from initFramePars(), also can be used to avoid frame number integer overflow) void resetFrameNumber (int sensor_port, u32 aframe, int hreset); /// reset this frame number (called from initFramePars(), also can be used to avoid frame number integer overflow)
unsigned long get_imageParamsFrame(int sensor_port, int n, int frame);
unsigned long get_imageParamsThis (int sensor_port, int n); unsigned long get_imageParamsThis (int sensor_port, int n);
unsigned long get_imageParamsPrev (int sensor_port, int n); unsigned long get_imageParamsPrev (int sensor_port, int n);
unsigned long get_imageParamsPast(int sensor_port, int n, int frame); unsigned long get_imageParamsPast(int sensor_port, int n, int frame);
......
...@@ -582,6 +582,9 @@ int histograms_release (struct inode *inode, ///< inode ...@@ -582,6 +582,9 @@ int histograms_release (struct inode *inode, ///< inode
* @param orig SEEK_SET, SEEK_CUR or SEEK_SET END * @param orig SEEK_SET, SEEK_CUR or SEEK_SET END
* @return file position (histogram frame index (combined frame index and channel)) * @return file position (histogram frame index (combined frame index and channel))
*/ */
// TODO: NC393 - use int camSeqGetJPEG_frame(unsigned int chn); and
// get_imageParamsFrame(..., camSeqGetJPEG_frame(chn)) instead of get_imageParamsThis(...)
// TODO: add flag that will allow driver to wakeup processes before the specified frame comes ? // TODO: add flag that will allow driver to wakeup processes before the specified frame comes ?
loff_t histograms_lseek (struct file * file, loff_t histograms_lseek (struct file * file,
loff_t offset, loff_t offset,
......
This diff is collapsed.
...@@ -34,6 +34,8 @@ int camseq_get_jpeg_wp(unsigned int chn); ...@@ -34,6 +34,8 @@ int camseq_get_jpeg_wp(unsigned int chn);
int camseq_get_jpeg_rp(unsigned int chn); int camseq_get_jpeg_rp(unsigned int chn);
void camseq_set_jpeg_rp(unsigned int chn, int ptr); void camseq_set_jpeg_rp(unsigned int chn, int ptr);
int camSeqGetJPEG_frame(unsigned int chn);
// DWORD I/O, same as in NC353 // DWORD I/O, same as in NC353
int camSeqGetJPEG_wp (unsigned int chn); int camSeqGetJPEG_wp (unsigned int chn);
int camSeqGetJPEG_rp (unsigned int chn); int camSeqGetJPEG_rp (unsigned int chn);
......
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