#include <linux/poll.h>
Include dependency graph for circbuf.h:
This graph shows which files directly or indirectly include this file:
Go to the source code of this file.
Defines | |
#define | X313_CHAIN_SIGNATURE 0xffffffff |
#define | X313_CHAIN_SIGNATURE4 0xffff0000 |
#define | X313_LENGTH_MASK 0xff000000 |
#define | X313_PADDED_FRAME(x) ((((x)+67+CCAM_MMAP_META ) >>2) & 0xfffffff8) |
#define | X313_BUFFSUB(x, y) (((x)>=(y))? ((x)-(y)) : ((x)+ (CCAM_DMA_SIZE-(y)))) |
#define | X313_BUFFADD(x, y) ((((x) + (y))<=CCAM_DMA_SIZE)? ((x) + (y)) : ((x) - (CCAM_DMA_SIZE-(y)))) |
Functions | |
int | circbuf_all_open (struct inode *inode, struct file *filp) |
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) |
int | circbuf_all_ioctl (struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg) |
just to notify it is not implemented | |
int | circbuf_open (struct inode *inode, struct file *filp) |
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 | jpeghead_open (struct inode *inode, struct file *filp) |
loff_t | jpeghead_lseek (struct file *file, loff_t offset, int orig) |
ssize_t | jpeghead_read (struct file *file, char *buf, size_t count, loff_t *off) |
ssize_t | jpeghead_write (struct file *file, const char *buf, size_t count, loff_t *off) |
void | init_ccam_dma_buf_ptr (void) |
still used in autoexposure or something - why is in needed there? | |
Variables | |
unsigned long * | ccam_dma_buf_ptr |
Without "static" system hangs after "Uncompressing Linux... | |
wait_queue_head_t | circbuf_wait_queue |
#define X313_BUFFADD | ( | x, | |||
y | ) | ((((x) + (y))<=CCAM_DMA_SIZE)? ((x) + (y)) : ((x) - (CCAM_DMA_SIZE-(y)))) |
Definition at line 45 of file circbuf.h.
Referenced by circbuf_lseek(), ext_fill_jpeg_mmap_desc(), x313_dma_forget_jpeg(), and x313_dma_read().
Definition at line 44 of file circbuf.h.
Referenced by circbuf_lseek(), circbufValidPointer(), jpeghead_lseek(), x313_dma_restore_jpeg(), and X313_dma_update().
#define X313_CHAIN_SIGNATURE 0xffffffff |
Definition at line 38 of file circbuf.h.
Referenced by x313_dma_forget_jpeg(), x313_dma_reset_chain(), x313_DMA_size(), and X313_dma_update().
#define X313_CHAIN_SIGNATURE4 0xffff0000 |
Definition at line 39 of file circbuf.h.
Referenced by x313_dma_forget_jpeg(), x313_dma_reset_chain(), x313_DMA_size(), and X313_dma_update().
#define X313_LENGTH_MASK 0xff000000 |
Definition at line 41 of file circbuf.h.
Referenced by circbuf_lseek(), circbufValidPointer(), jpeghead_lseek(), and X313_dma_update().
Definition at line 43 of file circbuf.h.
Referenced by circbuf_lseek(), x313_dma_forget_jpeg(), and X313_dma_update().
int circbuf_all_ioctl | ( | struct inode * | inode, | |
struct file * | filp, | |||
unsigned int | cmd, | |||
unsigned long | arg | |||
) |
just to notify it is not implemented
Definition at line 295 of file circbuf.c.
References circbuf_pd::minor, and printk.
loff_t circbuf_all_lseek | ( | struct file * | file, | |
loff_t | offset, | |||
int | orig | |||
) |
Definition at line 241 of file circbuf.c.
References circbuf_lseek(), CMOSCAM_MINOR_CIRCBUF, CMOSCAM_MINOR_JPEAGHEAD, jpeghead_lseek(), MD10, circbuf_pd::minor, and printk.
int circbuf_all_mmap | ( | struct file * | file, | |
struct vm_area_struct * | vma | |||
) |
Definition at line 274 of file circbuf.c.
References circbuf_mmap(), CMOSCAM_MINOR_CIRCBUF, MD10, circbuf_pd::minor, and printk.
int circbuf_all_open | ( | struct inode * | inode, | |
struct file * | filp | |||
) |
Definition at line 202 of file circbuf.c.
References circbuf_open(), CMOSCAM_MINOR_CIRCBUF, CMOSCAM_MINOR_JPEAGHEAD, GFP_KERNEL, jpeghead_open(), kfree, kmalloc, MD10, circbuf_pd::minor, and printk.
unsigned int circbuf_all_poll | ( | struct file * | file, | |
poll_table * | wait | |||
) |
Definition at line 284 of file circbuf.c.
References circbuf_poll(), CMOSCAM_MINOR_CIRCBUF, MD10, circbuf_pd::minor, and printk.
ssize_t circbuf_all_read | ( | struct file * | file, | |
char * | buf, | |||
size_t | count, | |||
loff_t * | off | |||
) |
Definition at line 252 of file circbuf.c.
References circbuf_read(), CMOSCAM_MINOR_CIRCBUF, CMOSCAM_MINOR_JPEAGHEAD, jpeghead_read(), MD10, circbuf_pd::minor, and printk.
int circbuf_all_release | ( | struct inode * | inode, | |
struct file * | filp | |||
) |
Definition at line 223 of file circbuf.c.
References CMOSCAM_MINOR_CIRCBUF, CMOSCAM_MINOR_JPEAGHEAD, kfree, MD10, and printk.
ssize_t circbuf_all_write | ( | struct file * | file, | |
const char * | buf, | |||
size_t | count, | |||
loff_t * | off | |||
) |
Definition at line 262 of file circbuf.c.
References circbuf_write(), CMOSCAM_MINOR_CIRCBUF, CMOSCAM_MINOR_JPEAGHEAD, jpeghead_write(), MD10, circbuf_pd::minor, and printk.
loff_t circbuf_lseek | ( | struct file * | file, | |
loff_t | offset, | |||
int | orig | |||
) |
Definition at line 386 of file circbuf.c.
References camSeqGetJPEG_rp(), camSeqGetJPEG_wp(), camSeqSetJPEG_rp(), ccam_dma_buf, CCAM_DMA_SIZE, circbufValidPointer(), CIRCLSEEK_FIRST, CIRCLSEEK_FREE, CIRCLSEEK_LAST, CIRCLSEEK_NEXT, CIRCLSEEK_PREV, CIRCLSEEK_READY, CIRCLSEEK_SCND, CIRCLSEEK_SETP, CIRCLSEEK_TORP, CIRCLSEEK_TOWP, CIRCLSEEK_USED, CIRCLSEEK_VALID, CIRCLSEEK_WAIT, MD11, MD12, printk, rp, frame_params_t::timestamp_sec, X313_BUFFADD, X313_BUFFSUB, X313_LENGTH_MASK, and X313_PADDED_FRAME.
Referenced by circbuf_all_lseek(), and circbuf_open().
int circbuf_mmap | ( | struct file * | file, | |
struct vm_area_struct * | vma | |||
) |
Definition at line 573 of file circbuf.c.
References ccam_dma_buf, MD7, and printk.
Referenced by circbuf_all_mmap().
int circbuf_open | ( | struct inode * | inode, | |
struct file * | filp | |||
) |
Definition at line 305 of file circbuf.c.
References CCAM_DMA_SIZE, circbuf_lseek(), CIRCLSEEK_LAST, MD10, and printk.
Referenced by circbuf_all_open().
unsigned int circbuf_poll | ( | struct file * | file, | |
poll_table * | wait | |||
) |
=========================================================================== ! If the current read pointer is invalid, circbuf_poll returns POLLHUP ! as no data will be ever available until file poinetr is reset. ! if it is valid, wait is setup and the blocking condition occurs ! ifthe current file pointer is equal to the FPGA write pointer !===========================================================================
result of testing read poinetr
not a valid read pointer, probable buffer overrun
there was frame already available
pointer valid, no frame yet
Frame might become available during call to poll_wait so nobody will wake us up. Let's see if there is stillno frame
we are lucky - got it
Definition at line 602 of file circbuf.c.
References camSeqGetJPEG_wp(), circbufValidPointer(), MD10, and printk.
Referenced by circbuf_all_poll().
ssize_t circbuf_read | ( | struct file * | file, | |
char * | buf, | |||
size_t | count, | |||
loff_t * | off | |||
) |
Definition at line 556 of file circbuf.c.
References ccam_dma_buf, CCAM_DMA_SIZE, D, and printk.
Referenced by circbuf_all_read().
ssize_t circbuf_write | ( | struct file * | file, | |
const char * | buf, | |||
size_t | count, | |||
loff_t * | off | |||
) |
Definition at line 536 of file circbuf.c.
References ccam_dma_buf, CCAM_DMA_SIZE, D, and printk.
Referenced by circbuf_all_write().
void init_ccam_dma_buf_ptr | ( | void | ) |
still used in autoexposure or something - why is in needed there?
Definition at line 159 of file circbuf.c.
References ccam_dma_buf.
Referenced by cmoscam_init().
loff_t jpeghead_lseek | ( | struct file * | file, | |
loff_t | offset, | |||
int | orig | |||
) |
================================================================= ! Overloading lseek with additional functionality (to avoid ioctls) ! with orig==SEEK_END lseek will treat (offset>0) as a byte pointer ! in (char *)ccam_dma_buf of a frame pointer and use quality, ! width and height to regenerate header. ! frame pointers are 32-bytes aligned, so adding 1 to offest ! will make sure it is always >0 (as offset=0, orig=SEEK_END ! will just move pointer to the end and return file length. ! ! When called with orig==SEEK_END, offset>0 lseek will position ! file at the very beginning and return 0 if OK, -EINVAL if ! frame header is not found for the specified offset !================================================================
New functionality
32 bytes before the frame pointer, may roll-over to the end of ccam_dma_buf
signature is overwritten
acquisition of this frame is not done yet - length word high byte is non-zero
it is 0
Definition at line 650 of file circbuf.c.
References ccam_dma_buf, frame_params_t::height, JPEG_HEADER_SIZE, frame_params_t::quality, rp, setJPEGHeader(), frame_params_t::signffff, frame_params_t::timestamp_sec, frame_params_t::width, X313_BUFFSUB, and X313_LENGTH_MASK.
Referenced by circbuf_all_lseek().
int jpeghead_open | ( | struct inode * | inode, | |
struct file * | filp | |||
) |
make it blocking to use shared resource - jpeg header that may need re-calculation for different requests? or use individual header arrays?
Definition at line 629 of file circbuf.c.
References JPEG_HEADER_SIZE.
Referenced by circbuf_all_open().
ssize_t jpeghead_read | ( | struct file * | file, | |
char * | buf, | |||
size_t | count, | |||
loff_t * | off | |||
) |
Definition at line 697 of file circbuf.c.
References D, jpeg_header_sbuffer_ptr, JPEG_HEADER_SIZE, and printk.
Referenced by circbuf_all_read().
ssize_t jpeghead_write | ( | struct file * | file, | |
const char * | buf, | |||
size_t | count, | |||
loff_t * | off | |||
) |
Definition at line 717 of file circbuf.c.
References D, jpeg_header_sbuffer_ptr, JPEG_HEADER_SIZE, and printk.
Referenced by circbuf_all_write().
unsigned long* ccam_dma_buf_ptr |
Without "static" system hangs after "Uncompressing Linux...
Definition at line 157 of file circbuf.c.
Referenced by add_frame_params(), ext_fill_jpeg_mmap_desc_(), flush_par_cache(), x313_dma_forget_jpeg(), x313_dma_init(), x313_dma_reset_chain(), x313_DMA_size(), x313_dma_start(), X313_dma_update(), x313_JPEG_dump(), and x313_setDMABuffer().
wait_queue_head_t circbuf_wait_queue |
====================================================================================== ! Wait queue for the processes waiting for a new frame to appear in the circular buffer !======================================================================================
Definition at line 167 of file circbuf.c.
Referenced by add_frame_params().