Commit 2b8f9342 authored by Andrey Filippov's avatar Andrey Filippov

Working on exif, fixing some other problems

parent 527b91bf
...@@ -294,46 +294,46 @@ static int __init elphelmem_init(void) ...@@ -294,46 +294,46 @@ static int __init elphelmem_init(void)
pr_err("ERROR allocating Bidirectional DMA memory buffer\n"); pr_err("ERROR allocating Bidirectional DMA memory buffer\n");
} }
pr_info("Coherent buffer vaddr: 0x%08X\n",(u32) pElphel_buf -> vaddr); pr_info("Coherent buffer vaddr: 0x%08x\n",(u32) pElphel_buf -> vaddr);
pr_info("Coherent buffer paddr: 0x%08X\n",(u32) pElphel_buf -> paddr); pr_info("Coherent buffer paddr: 0x%08x\n",(u32) pElphel_buf -> paddr);
pr_info("Coherent buffer length: 0x%08X\n",(u32) pElphel_buf -> size * PAGE_SIZE); pr_info("Coherent buffer length: 0x%08lx\n",(u32) pElphel_buf -> size * PAGE_SIZE);
pr_info(" circbuf channel 0 vaddr: 0x%08X paddr: 0x%08X length 0x%08X\n", pr_info(" circbuf channel 0 vaddr: 0x%08x paddr: 0x%08x length 0x%08lx\n",
(u32) pElphel_buf -> circbuf_chn0_vaddr, (u32) pElphel_buf -> circbuf_chn0_vaddr,
(u32) pElphel_buf -> circbuf_chn0_paddr, (u32) pElphel_buf -> circbuf_chn0_paddr,
(u32) pElphel_buf-> circbuf_chn0_size * PAGE_SIZE); (u32) pElphel_buf-> circbuf_chn0_size * PAGE_SIZE);
pr_info(" circbuf channel 1 vaddr: 0x%08X paddr: 0x%08X length 0x%08X\n", pr_info(" circbuf channel 1 vaddr: 0x%08x paddr: 0x%08x length 0x%08lx\n",
(u32) pElphel_buf -> circbuf_chn1_vaddr, (u32) pElphel_buf -> circbuf_chn1_vaddr,
(u32) pElphel_buf -> circbuf_chn1_paddr, (u32) pElphel_buf -> circbuf_chn1_paddr,
(u32) pElphel_buf-> circbuf_chn1_size * PAGE_SIZE); (u32) pElphel_buf-> circbuf_chn1_size * PAGE_SIZE);
pr_info(" circbuf channel 2 vaddr: 0x%08X paddr: 0x%08X length 0x%08X\n", pr_info(" circbuf channel 2 vaddr: 0x%08x paddr: 0x%08x length 0x%08lx\n",
(u32) pElphel_buf -> circbuf_chn2_vaddr, (u32) pElphel_buf -> circbuf_chn2_vaddr,
(u32) pElphel_buf -> circbuf_chn2_paddr, (u32) pElphel_buf -> circbuf_chn2_paddr,
(u32) pElphel_buf-> circbuf_chn2_size * PAGE_SIZE); (u32) pElphel_buf-> circbuf_chn2_size * PAGE_SIZE);
pr_info(" circbuf channel 3 vaddr: 0x%08X paddr: 0x%08X length 0x%08X\n", pr_info(" circbuf channel 3 vaddr: 0x%08x paddr: 0x%08x length 0x%08lx\n",
(u32) pElphel_buf -> circbuf_chn3_vaddr, (u32) pElphel_buf -> circbuf_chn3_vaddr,
(u32) pElphel_buf -> circbuf_chn3_paddr, (u32) pElphel_buf -> circbuf_chn3_paddr,
(u32) pElphel_buf-> circbuf_chn3_size * PAGE_SIZE); (u32) pElphel_buf-> circbuf_chn3_size * PAGE_SIZE);
pr_info(" raw channel 0 vaddr: 0x%08X paddr: 0x%08X length 0x%08X\n", pr_info(" raw channel 0 vaddr: 0x%08x paddr: 0x%08x length 0x%08lx\n",
(u32) pElphel_buf -> raw_chn0_vaddr, (u32) pElphel_buf -> raw_chn0_vaddr,
(u32) pElphel_buf -> raw_chn0_paddr, (u32) pElphel_buf -> raw_chn0_paddr,
(u32) pElphel_buf-> raw_chn0_size * PAGE_SIZE); (u32) pElphel_buf-> raw_chn0_size * PAGE_SIZE);
pr_info(" raw channel 1 vaddr: 0x%08X paddr: 0x%08X length 0x%08X\n", pr_info(" raw channel 1 vaddr: 0x%08x paddr: 0x%08x length 0x%08lx\n",
(u32) pElphel_buf -> raw_chn1_vaddr, (u32) pElphel_buf -> raw_chn1_vaddr,
(u32) pElphel_buf -> raw_chn1_paddr, (u32) pElphel_buf -> raw_chn1_paddr,
(u32) pElphel_buf-> raw_chn1_size * PAGE_SIZE); (u32) pElphel_buf-> raw_chn1_size * PAGE_SIZE);
pr_info(" raw channel 2 vaddr: 0x%08X paddr: 0x%08X length 0x%08X\n", pr_info(" raw channel 2 vaddr: 0x%08x paddr: 0x%08x length 0x%08lx\n",
(u32) pElphel_buf -> raw_chn2_vaddr, (u32) pElphel_buf -> raw_chn2_vaddr,
(u32) pElphel_buf -> raw_chn2_paddr, (u32) pElphel_buf -> raw_chn2_paddr,
(u32) pElphel_buf-> raw_chn2_size * PAGE_SIZE); (u32) pElphel_buf-> raw_chn2_size * PAGE_SIZE);
pr_info(" raw channel 3 vaddr: 0x%08X paddr: 0x%08X length 0x%08X\n", pr_info(" raw channel 3 vaddr: 0x%08x paddr: 0x%08x length 0x%08lx\n",
(u32) pElphel_buf -> raw_chn3_vaddr, (u32) pElphel_buf -> raw_chn3_vaddr,
(u32) pElphel_buf -> raw_chn3_paddr, (u32) pElphel_buf -> raw_chn3_paddr,
(u32) pElphel_buf-> raw_chn3_size * PAGE_SIZE); (u32) pElphel_buf-> raw_chn3_size * PAGE_SIZE);
......
...@@ -118,12 +118,16 @@ static int exif_fields = 0; // total number of the Exif fields in the he ...@@ -118,12 +118,16 @@ static int exif_fields = 0; // total number of the Exif fields in the he
static int exif_template_size = 0; // size of Exif template static int exif_template_size = 0; // size of Exif template
static char exif_template[MAX_EXIF_SIZE]; static char exif_template[MAX_EXIF_SIZE];
//static int tiff_fields = 0; // total number of the Tiff fields in the header
static int tiff_template_size = 0; // size of Tiff template
static char tiff_template[MAX_EXIF_SIZE];
static int aexif_meta_size[SENSOR_PORTS] = {0,0,0,0}; // size of Exif meta data page (is it the same for all ports?) 393: set as individual static int aexif_meta_size[SENSOR_PORTS] = {0,0,0,0}; // size of Exif meta data page (is it the same for all ports?) 393: set as individual
static int aexif_wp[SENSOR_PORTS] = {1,1,1,1}; // frame write pointer in the meta_buffer static int aexif_wp[SENSOR_PORTS] = {1,1,1,1}; // frame write pointer in the meta_buffer
static int aexif_enabled[SENSOR_PORTS] = {0,0,0,0}; // enable storing of frame meta data, enable reading Exif data static int aexif_enabled[SENSOR_PORTS] = {0,0,0,0}; // enable storing of frame meta data, enable reading Exif data
static int aexif_valid[SENSOR_PORTS] = {0,0,0,0}; // Exif tables and buffer are valid. static int aexif_valid[SENSOR_PORTS] = {0,0,0,0}; // Exif tables and buffer are valid.
static char * ameta_buffer[SENSOR_PORTS]= {NULL,NULL,NULL,NULL}; // dynamically allocated buffer to store frame meta data. static char * ameta_buffer[SENSOR_PORTS]= {NULL,NULL,NULL,NULL}; // dynamically allocated buffer to store frame meta data.
static char exif_tmp_buff[MAX_EXIF_SIZE]; static char exif_tmp_buff[MAX_EXIF_SIZE]; // Not thread safe - should be fixed!
//static char * meta_buffer=NULL; // dynamically allocated buffer to store frame meta data. //static char * meta_buffer=NULL; // dynamically allocated buffer to store frame meta data.
// page 0 - temporary storage, 1..MAX_EXIF_FRAMES - buffer // page 0 - temporary storage, 1..MAX_EXIF_FRAMES - buffer
...@@ -165,12 +169,21 @@ ssize_t minor_file_size(int minor) { //return current file size for different mi ...@@ -165,12 +169,21 @@ ssize_t minor_file_size(int minor) { //return current file size for different mi
switch (minor) { switch (minor) {
case DEV393_MINOR(DEV393_EXIF_TEMPLATE): case DEV393_MINOR(DEV393_EXIF_TEMPLATE):
return exif_template_size; return exif_template_size;
case DEV393_MINOR(DEV393_TIFF_TEMPLATE):
return tiff_template_size;
case DEV393_MINOR(DEV393_EXIF0): case DEV393_MINOR(DEV393_EXIF0):
case DEV393_MINOR(DEV393_EXIF1): case DEV393_MINOR(DEV393_EXIF1):
case DEV393_MINOR(DEV393_EXIF2): case DEV393_MINOR(DEV393_EXIF2):
case DEV393_MINOR(DEV393_EXIF3): case DEV393_MINOR(DEV393_EXIF3):
sensor_port = minor - DEV393_MINOR(DEV393_EXIF0); sensor_port = minor - DEV393_MINOR(DEV393_EXIF0);
return aexif_enabled[sensor_port]? (exif_template_size * (MAX_EXIF_FRAMES+1)):0; return aexif_enabled[sensor_port]? (exif_template_size * (MAX_EXIF_FRAMES+1)):0;
case DEV393_MINOR(DEV393_TIFF0):
case DEV393_MINOR(DEV393_TIFF1):
case DEV393_MINOR(DEV393_TIFF2):
case DEV393_MINOR(DEV393_TIFF3):
sensor_port = minor - DEV393_MINOR(DEV393_TIFF0);
return aexif_enabled[sensor_port]? (tiff_template_size * (MAX_EXIF_FRAMES+1)):0;
case DEV393_MINOR(DEV393_EXIF_META0): case DEV393_MINOR(DEV393_EXIF_META0):
case DEV393_MINOR(DEV393_EXIF_META1): case DEV393_MINOR(DEV393_EXIF_META1):
case DEV393_MINOR(DEV393_EXIF_META2): case DEV393_MINOR(DEV393_EXIF_META2):
...@@ -184,6 +197,7 @@ ssize_t minor_file_size(int minor) { //return current file size for different mi ...@@ -184,6 +197,7 @@ ssize_t minor_file_size(int minor) { //return current file size for different mi
default:return 0; default:return 0;
} }
} }
ssize_t minor_max_size(int minor) { //return max file size for different minors ssize_t minor_max_size(int minor) { //return max file size for different minors
switch (minor) { switch (minor) {
case DEV393_MINOR(DEV393_EXIF_TEMPLATE): case DEV393_MINOR(DEV393_EXIF_TEMPLATE):
...@@ -193,6 +207,14 @@ ssize_t minor_max_size(int minor) { //return max file size for different minors ...@@ -193,6 +207,14 @@ ssize_t minor_max_size(int minor) { //return max file size for different minors
case DEV393_MINOR(DEV393_EXIF2): case DEV393_MINOR(DEV393_EXIF2):
case DEV393_MINOR(DEV393_EXIF3): case DEV393_MINOR(DEV393_EXIF3):
return MAX_EXIF_SIZE * (MAX_EXIF_FRAMES+1); return MAX_EXIF_SIZE * (MAX_EXIF_FRAMES+1);
case DEV393_MINOR(DEV393_TIFF0):
case DEV393_MINOR(DEV393_TIFF1):
case DEV393_MINOR(DEV393_TIFF2):
case DEV393_MINOR(DEV393_TIFF3):
return MAX_EXIF_SIZE * (MAX_EXIF_FRAMES+1);
case DEV393_MINOR(DEV393_EXIF_META0): case DEV393_MINOR(DEV393_EXIF_META0):
case DEV393_MINOR(DEV393_EXIF_META1): case DEV393_MINOR(DEV393_EXIF_META1):
case DEV393_MINOR(DEV393_EXIF_META2): case DEV393_MINOR(DEV393_EXIF_META2):
...@@ -258,6 +280,8 @@ int exif_rebuild_chn(int sensor_port, int frames) { ...@@ -258,6 +280,8 @@ int exif_rebuild_chn(int sensor_port, int frames) {
return 0; return 0;
} }
int exif_enable(int en) { int exif_enable(int en) {
int sensor_port,rslt; int sensor_port,rslt;
for (sensor_port =0; sensor_port < SENSOR_PORTS; sensor_port++){ for (sensor_port =0; sensor_port < SENSOR_PORTS; sensor_port++){
...@@ -295,8 +319,8 @@ inline void write_meta_raw_irq(int sensor_port, char * data, int offset, int len ...@@ -295,8 +319,8 @@ inline void write_meta_raw_irq(int sensor_port, char * data, int offset, int len
inline int write_meta_irq(int sensor_port, char * data, int * indx, unsigned long ltag, int len) { //write data to meta, called from IRQ(len==0 => use field length) inline int write_meta_irq(int sensor_port, char * data, int * indx, unsigned long ltag, int len) { //write data to meta, called from IRQ(len==0 => use field length)
int i; int i;
if (!aexif_enabled[sensor_port]) return 0; if (!aexif_enabled[sensor_port]) return 0;
if (indx && (dir_table[* indx].ltag==ltag)) i=*indx; if (indx && (dir_table[* indx].ltag==ltag)) i=*indx; // cache hit
else { else { // cache miss
for (i=0; i<exif_fields; i++) if (dir_table[i].ltag==ltag) break; for (i=0; i<exif_fields; i++) if (dir_table[i].ltag==ltag) break;
if (i>=exif_fields) return -1; //ltag not found if (i>=exif_fields) return -1; //ltag not found
} }
...@@ -499,11 +523,16 @@ int exif_open(struct inode *inode, struct file *filp) { ...@@ -499,11 +523,16 @@ int exif_open(struct inode *inode, struct file *filp) {
case DEV393_MINOR(DEV393_EXIF1): case DEV393_MINOR(DEV393_EXIF1):
case DEV393_MINOR(DEV393_EXIF2): case DEV393_MINOR(DEV393_EXIF2):
case DEV393_MINOR(DEV393_EXIF3): case DEV393_MINOR(DEV393_EXIF3):
case DEV393_MINOR(DEV393_TIFF0):
case DEV393_MINOR(DEV393_TIFF1):
case DEV393_MINOR(DEV393_TIFF2):
case DEV393_MINOR(DEV393_TIFF3):
case DEV393_MINOR(DEV393_EXIF_META0): case DEV393_MINOR(DEV393_EXIF_META0):
case DEV393_MINOR(DEV393_EXIF_META1): case DEV393_MINOR(DEV393_EXIF_META1):
case DEV393_MINOR(DEV393_EXIF_META2): case DEV393_MINOR(DEV393_EXIF_META2):
case DEV393_MINOR(DEV393_EXIF_META3): case DEV393_MINOR(DEV393_EXIF_META3):
case DEV393_MINOR(DEV393_EXIF_TEMPLATE): case DEV393_MINOR(DEV393_EXIF_TEMPLATE):
case DEV393_MINOR(DEV393_TIFF_TEMPLATE):
case DEV393_MINOR(DEV393_EXIF_METADIR): case DEV393_MINOR(DEV393_EXIF_METADIR):
case DEV393_MINOR(DEV393_EXIF_TIME): case DEV393_MINOR(DEV393_EXIF_TIME):
break; break;
...@@ -528,6 +557,11 @@ int exif_release(struct inode *inode, struct file *filp){ ...@@ -528,6 +557,11 @@ int exif_release(struct inode *inode, struct file *filp){
case DEV393_MINOR(DEV393_EXIF2): case DEV393_MINOR(DEV393_EXIF2):
case DEV393_MINOR(DEV393_EXIF3): case DEV393_MINOR(DEV393_EXIF3):
break; break;
case DEV393_MINOR(DEV393_TIFF0):
case DEV393_MINOR(DEV393_TIFF1):
case DEV393_MINOR(DEV393_TIFF2):
case DEV393_MINOR(DEV393_TIFF3):
break;
case DEV393_MINOR(DEV393_EXIF_META0): case DEV393_MINOR(DEV393_EXIF_META0):
case DEV393_MINOR(DEV393_EXIF_META1): case DEV393_MINOR(DEV393_EXIF_META1):
case DEV393_MINOR(DEV393_EXIF_META2): case DEV393_MINOR(DEV393_EXIF_META2):
...@@ -535,6 +569,8 @@ int exif_release(struct inode *inode, struct file *filp){ ...@@ -535,6 +569,8 @@ int exif_release(struct inode *inode, struct file *filp){
break; break;
case DEV393_MINOR(DEV393_EXIF_TEMPLATE): case DEV393_MINOR(DEV393_EXIF_TEMPLATE):
break; break;
case DEV393_MINOR(DEV393_TIFF_TEMPLATE):
break;
case DEV393_MINOR(DEV393_EXIF_METADIR): case DEV393_MINOR(DEV393_EXIF_METADIR):
break; break;
case DEV393_MINOR(DEV393_EXIF_TIME): case DEV393_MINOR(DEV393_EXIF_TIME):
...@@ -572,7 +608,8 @@ loff_t exif_lseek (struct file * file, loff_t offset, int orig) { ...@@ -572,7 +608,8 @@ loff_t exif_lseek (struct file * file, loff_t offset, int orig) {
} else { } else {
switch (p) { switch (p) {
case DEV393_MINOR(DEV393_EXIF_TEMPLATE): //enable/disable case DEV393_MINOR(DEV393_EXIF_TEMPLATE): // enable/disable
case DEV393_MINOR(DEV393_TIFF_TEMPLATE): // both files offer the same lseek commands
switch (offset) { switch (offset) {
case EXIF_LSEEK_DISABLE: case EXIF_LSEEK_DISABLE:
exif_enable(0); exif_enable(0);
...@@ -598,6 +635,17 @@ loff_t exif_lseek (struct file * file, loff_t offset, int orig) { ...@@ -598,6 +635,17 @@ loff_t exif_lseek (struct file * file, loff_t offset, int orig) {
// file->f_pos=exif_meta_size * offset; // file->f_pos=exif_meta_size * offset;
file->f_pos=exif_template_size * offset; file->f_pos=exif_template_size * offset;
break; break;
case DEV393_MINOR(DEV393_TIFF0):
case DEV393_MINOR(DEV393_TIFF1):
case DEV393_MINOR(DEV393_TIFF2):
case DEV393_MINOR(DEV393_TIFF3):
// sensor_port = p - DEV393_MINOR(DEV393_EXIF0);
if (offset > MAX_EXIF_FRAMES) return -EOVERFLOW; //larger than buffer
// file->f_pos=exif_meta_size * offset;
file->f_pos=tiff_template_size * offset;
break;
case DEV393_MINOR(DEV393_EXIF_META0): case DEV393_MINOR(DEV393_EXIF_META0):
case DEV393_MINOR(DEV393_EXIF_META1): case DEV393_MINOR(DEV393_EXIF_META1):
case DEV393_MINOR(DEV393_EXIF_META2): case DEV393_MINOR(DEV393_EXIF_META2):
...@@ -672,6 +720,11 @@ ssize_t exif_write (struct file * file, const char * buf, size_t count, loff ...@@ -672,6 +720,11 @@ ssize_t exif_write (struct file * file, const char * buf, size_t count, loff
if (copy_from_user(&exif_template[*off], buf, count)) return -EFAULT; if (copy_from_user(&exif_template[*off], buf, count)) return -EFAULT;
exif_template_size=*off+count; exif_template_size=*off+count;
break; break;
case DEV393_MINOR(DEV393_TIFF_TEMPLATE):
exif_invalidate();
if (copy_from_user(&tiff_template[*off], buf, count)) return -EFAULT;
tiff_template_size=*off+count;
break;
case DEV393_MINOR(DEV393_EXIF_METADIR): case DEV393_MINOR(DEV393_EXIF_METADIR):
exif_invalidate(); exif_invalidate();
cp= (char *) &dir_table; cp= (char *) &dir_table;
...@@ -715,6 +768,12 @@ ssize_t exif_write (struct file * file, const char * buf, size_t count, loff ...@@ -715,6 +768,12 @@ ssize_t exif_write (struct file * file, const char * buf, size_t count, loff
case DEV393_MINOR(DEV393_EXIF3): case DEV393_MINOR(DEV393_EXIF3):
return -EINVAL; // no writing - read only return -EINVAL; // no writing - read only
break; break;
case DEV393_MINOR(DEV393_TIFF0):
case DEV393_MINOR(DEV393_TIFF1):
case DEV393_MINOR(DEV393_TIFF2):
case DEV393_MINOR(DEV393_TIFF3):
return -EINVAL; // no writing - read only
break;
default:return -EINVAL; default:return -EINVAL;
} }
*off+=count; *off+=count;
...@@ -732,6 +791,7 @@ ssize_t exif_read (struct file * file, char * buf, size_t count, loff_t *of ...@@ -732,6 +791,7 @@ ssize_t exif_read (struct file * file, char * buf, size_t count, loff_t *of
int start_p, page_p,i; int start_p, page_p,i;
int sensor_port; int sensor_port;
char tmp[MAX_EXIF_SIZE]; //! Or is it possible to disable IRQ while copy_from_user()? char tmp[MAX_EXIF_SIZE]; //! Or is it possible to disable IRQ while copy_from_user()?
int is_tiff = 0;
/* /*
Does not work with PHP - always read 8192 bytes Does not work with PHP - always read 8192 bytes
if ((*off+count)>maxsize) { if ((*off+count)>maxsize) {
...@@ -750,6 +810,9 @@ ssize_t exif_read (struct file * file, char * buf, size_t count, loff_t *of ...@@ -750,6 +810,9 @@ ssize_t exif_read (struct file * file, char * buf, size_t count, loff_t *of
case DEV393_MINOR(DEV393_EXIF_TEMPLATE): case DEV393_MINOR(DEV393_EXIF_TEMPLATE):
if (copy_to_user(buf, &exif_template[*off], count)) return -EFAULT; if (copy_to_user(buf, &exif_template[*off], count)) return -EFAULT;
break; break;
case DEV393_MINOR(DEV393_TIFF_TEMPLATE):
if (copy_to_user(buf, &tiff_template[*off], count)) return -EFAULT;
break;
case DEV393_MINOR(DEV393_EXIF_METADIR): case DEV393_MINOR(DEV393_EXIF_METADIR):
cp= (char *) &dir_table; cp= (char *) &dir_table;
if (copy_to_user(buf, &cp[*off], count)) return -EFAULT; if (copy_to_user(buf, &cp[*off], count)) return -EFAULT;
...@@ -766,11 +829,17 @@ ssize_t exif_read (struct file * file, char * buf, size_t count, loff_t *of ...@@ -766,11 +829,17 @@ ssize_t exif_read (struct file * file, char * buf, size_t count, loff_t *of
if (!aexif_enabled[sensor_port]) return 0; if (!aexif_enabled[sensor_port]) return 0;
if (copy_to_user(buf, &ameta_buffer[sensor_port][*off], count)) return -EFAULT; if (copy_to_user(buf, &ameta_buffer[sensor_port][*off], count)) return -EFAULT;
break; break;
case DEV393_MINOR(DEV393_TIFF0):// generates exif data by merging exif_template with the selected meta_buffer page
case DEV393_MINOR(DEV393_TIFF1):
case DEV393_MINOR(DEV393_TIFF2):
case DEV393_MINOR(DEV393_TIFF3):
is_tiff=1;
/* no break */
case DEV393_MINOR(DEV393_EXIF0):// generates exif data by merging exif_template with the selected meta_buffer page case DEV393_MINOR(DEV393_EXIF0):// generates exif data by merging exif_template with the selected meta_buffer page
case DEV393_MINOR(DEV393_EXIF1): case DEV393_MINOR(DEV393_EXIF1):
case DEV393_MINOR(DEV393_EXIF2): case DEV393_MINOR(DEV393_EXIF2):
case DEV393_MINOR(DEV393_EXIF3): case DEV393_MINOR(DEV393_EXIF3):
sensor_port = p - DEV393_MINOR(DEV393_EXIF0); sensor_port = (p - ((is_tiff)?DEV393_MINOR(DEV393_TIFF0):DEV393_MINOR(DEV393_EXIF0))) & 3; // &3 just to make compiler happy
//will truncate by the end of current page //will truncate by the end of current page
if (!aexif_enabled[sensor_port]) return 0; if (!aexif_enabled[sensor_port]) return 0;
i=((int) *off) / exif_template_size; i=((int) *off) / exif_template_size;
...@@ -784,8 +853,11 @@ ssize_t exif_read (struct file * file, char * buf, size_t count, loff_t *of ...@@ -784,8 +853,11 @@ ssize_t exif_read (struct file * file, char * buf, size_t count, loff_t *of
if ((page_p+count) > exif_template_size) count=exif_template_size-page_p; if ((page_p+count) > exif_template_size) count=exif_template_size-page_p;
memcpy(tmp,exif_template, exif_template_size); memcpy(tmp,exif_template, exif_template_size);
dev_dbg(g_devfp_ptr,"count= 0x%x, pos= 0x%x, start_p=0x%x, page_p=0x%x\n", (int) count, (int) *off, (int)start_p, (int)page_p); dev_dbg(g_devfp_ptr,"count= 0x%x, pos= 0x%x, start_p=0x%x, page_p=0x%x\n", (int) count, (int) *off, (int)start_p, (int)page_p);
for (i=0;i<exif_fields;i++){ if (is_tiff) for (i=0;i<exif_fields;i++) {
memcpy(&tmp[dir_table[i].dst],&metap[dir_table[i].src], dir_table[i].len); if (dir_table[i].dst_tiff > 0) memcpy(&tmp[dir_table[i].dst_tiff],&metap[dir_table[i].src], dir_table[i].len);
}
else for (i=0;i<exif_fields;i++) {
if (dir_table[i].dst_exif > 0) memcpy(&tmp[dir_table[i].dst_exif],&metap[dir_table[i].src], dir_table[i].len);
} }
if (copy_to_user(buf, &tmp[page_p], count)) return -EFAULT; if (copy_to_user(buf, &tmp[page_p], count)) return -EFAULT;
break; break;
...@@ -796,7 +868,11 @@ ssize_t exif_read (struct file * file, char * buf, size_t count, loff_t *of ...@@ -796,7 +868,11 @@ ssize_t exif_read (struct file * file, char * buf, size_t count, loff_t *of
return count; return count;
} }
/* This code is copied from exif_read, consider replacing it with this function invocation */ /* This code is copied from exif_read, consider replacing it with this function invocation
* It is used only in ahci_elphel.c for raw write, currently will use only Jpeg/Exif,(no Tiff) */
// Need to get rid of static buffer
size_t exif_get_data(int sensor_port, unsigned short meta_index, void *buff, size_t buff_sz) size_t exif_get_data(int sensor_port, unsigned short meta_index, void *buff, size_t buff_sz)
{ {
size_t count = exif_template_size; size_t count = exif_template_size;
...@@ -818,7 +894,7 @@ size_t exif_get_data(int sensor_port, unsigned short meta_index, void *buff, siz ...@@ -818,7 +894,7 @@ size_t exif_get_data(int sensor_port, unsigned short meta_index, void *buff, siz
memcpy(exif_tmp_buff, exif_template, exif_template_size); memcpy(exif_tmp_buff, exif_template, exif_template_size);
D(printk("%s: count= 0x%x, pos= 0x%x, start_p=0x%x, page_p=0x%x\n", __func__, (int) count, (int) off, (int)start_p, (int)page_p)); D(printk("%s: count= 0x%x, pos= 0x%x, start_p=0x%x, page_p=0x%x\n", __func__, (int) count, (int) off, (int)start_p, (int)page_p));
for (i = 0; i < exif_fields; i++) { for (i = 0; i < exif_fields; i++) {
memcpy(&exif_tmp_buff[dir_table[i].dst], &metap[dir_table[i].src], dir_table[i].len); if (dir_table[i].dst_exif > 0) memcpy(&exif_tmp_buff[dir_table[i].dst_exif], &metap[dir_table[i].src], dir_table[i].len);
} }
memcpy(buff, &exif_tmp_buff[page_p], count); memcpy(buff, &exif_tmp_buff[page_p], count);
return count; return count;
......
...@@ -1354,14 +1354,14 @@ int multisensor_pgm_multisens (int sensor_port, ///< sensor port n ...@@ -1354,14 +1354,14 @@ int multisensor_pgm_multisens (int sensor_port, ///< sensor port n
// int old_sensor=prev_selected-1; // may be <0 // int old_sensor=prev_selected-1; // may be <0
// int new_sensor=selected-1; // >=0 // int new_sensor=selected-1; // >=0
if (multi_unitialized[sensor_port] && (!prev_composite) && (old_sensor>=0)) { // was single-sensor mode, copy P_WOI_* to individual sensor WOI and FLIPS if (multi_unitialized[sensor_port] && (!prev_composite) && (old_sensor>=0)) { // was single-sensor mode, copy P_WOI_* to individual sensor WOI and FLIPS
dev_dbg(g_dev_ptr,"multi_unitialized=%d old_sensor=%x, multi_fliph=%x multi_flipv=%x\n", multi_unitialized, old_sensor, multi_fliph,multi_flipv); dev_dbg(g_dev_ptr,"multi_unitialized=%d old_sensor=%x, multi_fliph=%x multi_flipv=%x\n", multi_unitialized[old_sensor], old_sensor, multi_fliph,multi_flipv);
wois[(P_MULTI_WIDTH1- P_MULTI_WOI)+old_sensor]= prevpars->pars[P_WOI_WIDTH]; wois[(P_MULTI_WIDTH1- P_MULTI_WOI)+old_sensor]= prevpars->pars[P_WOI_WIDTH];
wois[(P_MULTI_HEIGHT1-P_MULTI_WOI)+old_sensor]= prevpars->pars[P_WOI_HEIGHT]; wois[(P_MULTI_HEIGHT1-P_MULTI_WOI)+old_sensor]= prevpars->pars[P_WOI_HEIGHT];
wois[(P_MULTI_LEFT1- P_MULTI_WOI)+old_sensor]= prevpars->pars[P_WOI_LEFT]; wois[(P_MULTI_LEFT1- P_MULTI_WOI)+old_sensor]= prevpars->pars[P_WOI_LEFT];
wois[(P_MULTI_TOP1- P_MULTI_WOI)+old_sensor]= prevpars->pars[P_WOI_TOP]; wois[(P_MULTI_TOP1- P_MULTI_WOI)+old_sensor]= prevpars->pars[P_WOI_TOP];
multi_fliph= (multi_fliph & (~(1<<old_sensor))) | ((prevpars->pars[P_FLIPH] & 1) << old_sensor); multi_fliph= (multi_fliph & (~(1<<old_sensor))) | ((prevpars->pars[P_FLIPH] & 1) << old_sensor);
multi_flipv= (multi_flipv & (~(1<<old_sensor))) | ((prevpars->pars[P_FLIPV] & 1) << old_sensor); multi_flipv= (multi_flipv & (~(1<<old_sensor))) | ((prevpars->pars[P_FLIPV] & 1) << old_sensor);
dev_dbg(g_dev_ptr,"multi_unitialized=%d old_sensor=%x, multi_fliph=%x multi_flipv=%x\n", multi_unitialized, old_sensor, multi_fliph,multi_flipv); dev_dbg(g_dev_ptr,"multi_unitialized=%d old_sensor=%x, multi_fliph=%x multi_flipv=%x\n", multi_unitialized[old_sensor], old_sensor, multi_fliph,multi_flipv);
} }
if (multi_unitialized[sensor_port] && (!composite) && (prev_composite || ((new_sensor>=0) && (old_sensor!=new_sensor)))) { // now single-sensor mode, set P_WOI* from saved parameters if (multi_unitialized[sensor_port] && (!composite) && (prev_composite || ((new_sensor>=0) && (old_sensor!=new_sensor)))) { // now single-sensor mode, set P_WOI* from saved parameters
if ((wois[(P_MULTI_WIDTH1- P_MULTI_WOI)+new_sensor]==0) || (wois[(P_MULTI_HEIGHT1- P_MULTI_WOI)+new_sensor]==0)) { if ((wois[(P_MULTI_WIDTH1- P_MULTI_WOI)+new_sensor]==0) || (wois[(P_MULTI_HEIGHT1- P_MULTI_WOI)+new_sensor]==0)) {
...@@ -2181,9 +2181,11 @@ int multisensor_memphase_debug (int sensor_port, ///< Sesnor port number (0..3) ...@@ -2181,9 +2181,11 @@ int multisensor_memphase_debug (int sensor_port, ///< Sesnor port number (0..3)
#endif #endif
} }
for (i=0; i<8;i++) printk (" %02x ",i); printk("\n"); for (i=0; i<8;i++) printk (" %02x ",i);
printk("\n");
for (n=0;n<64;n+=8) { for (n=0;n<64;n+=8) {
for (i=0; i<8;i++) printk ("%04lx ", data[n+i]); printk("\n"); for (i=0; i<8;i++) printk ("%04lx ", data[n+i]);
printk("\n");
} }
for (i=0;i<8;i++) setbits[i]=0; for (i=0;i<8;i++) setbits[i]=0;
for (n=0;n<64;n++) { for (n=0;n<64;n++) {
...@@ -2198,7 +2200,8 @@ int multisensor_memphase_debug (int sensor_port, ///< Sesnor port number (0..3) ...@@ -2198,7 +2200,8 @@ int multisensor_memphase_debug (int sensor_port, ///< Sesnor port number (0..3)
} }
} }
OK=(setbits[0]==0) && (setbits[1]==0) && (setbits[2]==0) && (setbits[3]==0x80) && (setbits[4]==0x80) && (setbits[5]==0x80) && (setbits[6]==0) && (setbits[7]==0); OK=(setbits[0]==0) && (setbits[1]==0) && (setbits[2]==0) && (setbits[3]==0x80) && (setbits[4]==0x80) && (setbits[5]==0x80) && (setbits[6]==0) && (setbits[7]==0);
for (i=0; i<8;i++) printk (" %03x ",setbits[i]); printk("\n"); for (i=0; i<8;i++) printk (" %03x ",setbits[i]);
printk("\n");
n=(0x10000*sx)/s; n=(0x10000*sx)/s;
printk ("Centroid - 0x%x, sx=0x%x, s=0x%x. OK=%d\n",n, sx,s,OK); printk ("Centroid - 0x%x, sx=0x%x, s=0x%x. OK=%d\n",n, sx,s,OK);
return n; return n;
......
...@@ -450,6 +450,7 @@ extern struct sensor_port_config_t *pSensorPortConfig; ...@@ -450,6 +450,7 @@ extern struct sensor_port_config_t *pSensorPortConfig;
#define SET_SENSOR_MIBPAR_COND_LUT(p,f,i,r,v) {\ #define SET_SENSOR_MIBPAR_COND_LUT(p,f,i,r,v) {\
int _MINDEX= MULTIREG(p,P_SENSOR_REGS+(r),(i));\ int _MINDEX= MULTIREG(p,P_SENSOR_REGS+(r),(i));\
int _I = (i);\ int _I = (i);\
int _ADDR;\
if (_MINDEX) { \ if (_MINDEX) { \
if ((v) != thispars->pars[_MINDEX]) { \ if ((v) != thispars->pars[_MINDEX]) { \
pars_to_update[nupdate ].num= _MINDEX ;\ pars_to_update[nupdate ].num= _MINDEX ;\
...@@ -462,7 +463,7 @@ extern struct sensor_port_config_t *pSensorPortConfig; ...@@ -462,7 +463,7 @@ extern struct sensor_port_config_t *pSensorPortConfig;
_I = pSensorPortConfig[(p)].broadcast_addr;\ _I = pSensorPortConfig[(p)].broadcast_addr;\
} \ } \
} \ } \
int _ADDR = pSensorPortConfig[(p)].par2addr[_I][(r)];\ _ADDR = pSensorPortConfig[(p)].par2addr[_I][(r)];\
if (!(_ADDR&0xffff0000)) {\ if (!(_ADDR&0xffff0000)) {\
X3X3_I2C_SEND2_LUT((p), (f), _I, _ADDR, (v));\ X3X3_I2C_SEND2_LUT((p), (f), _I, _ADDR, (v));\
}\ }\
......
...@@ -160,14 +160,21 @@ u32 get_compressor_frame(unsigned int chn) ///< Sensor port number (0..3) ...@@ -160,14 +160,21 @@ u32 get_compressor_frame(unsigned int chn) ///< Sensor port number (0..3)
* will have offset of the Exif_Image_DateTime data in meta page (Exif_Photo_SubSecTime should go immediately after in meta page) * will have offset of the Exif_Image_DateTime data in meta page (Exif_Photo_SubSecTime should go immediately after in meta page)
*/ */
static struct meta_offsets_t { // static struct meta_offsets_t { //
int Image_DateTime; ///< EXIF Date/Time offset int Image_DateTime; ///< EXIF Date/Time offset
///< Has offset of the Exif_Image_DateTime data in meta page (Exif_Photo_SubSecTime should go immediately after in meta page) ///< Has offset of the Exif_Image_DateTime data in meta page (Exif_Photo_SubSecTime should go immediately after in meta page)
int Photo_DateTimeOriginal; ///< EXIF Date/Time Original offset int Photo_DateTimeOriginal; ///< EXIF Date/Time Original offset
int Photo_ExposureTime; ///< EXIF exposure offset int Photo_ExposureTime; ///< EXIF exposure offset
int Image_ImageNumber; ///< EXIF image number offset int Image_ImageNumber; ///< EXIF image number offset
int Image_Orientation; ///< EXIF image orientation offset int Image_Orientation; ///< EXIF image orientation offset
int Photo_MakerNote; ///< EXIF maker note (custom data for multi-frame composite images) offset int Photo_MakerNote; ///< EXIF maker note (custom data for multi-frame composite images) offset
int PageNumber; ///< EXIF subchannel (0..3) number offset int PageNumber; ///< EXIF subchannel (0..3) number offset
int ImageWidth; ///< TIFF image width (long, 1)
int ImageLength; ///< TIFF image height (long,1)
int Image_BitsPerSample; ///< TIFF bits per sample, now 8 or 16 (short, 1)
int Image_SamplesPerPixel; ///< TIFF samples per pixel, now always 1 (short, 1)
int RowsPerStrip; ///< TIFF now image height (short, 1)
int StripByteCounts ; ///< TIFF with single strip - byte size of the image (W*H*Image_SamplesPerPixel*ceil(Image_BitsPerSample/8)
} meta_offsets; } meta_offsets;
#ifdef TEST_DISABLE_CODE #ifdef TEST_DISABLE_CODE
...@@ -498,11 +505,12 @@ inline void updateIRQ_Exif(struct jpeg_ptr_t *jptr, ///< pointer ...@@ -498,11 +505,12 @@ inline void updateIRQ_Exif(struct jpeg_ptr_t *jptr, ///< pointer
int index_time = jptr->jpeg_wp - 11; int index_time = jptr->jpeg_wp - 11;
char time_buff[27]; char time_buff[27];
char * exif_meta_time_string; char * exif_meta_time_string;
// calcualte bayer without flips - extra xor // calculate bayer without flips - extra xor
int global_flips, extra_flips, bayer; int global_flips, extra_flips, bayer;
unsigned char orientations[]="1638274545273816"; unsigned char orientations[]="1638274545273816";
unsigned char orientation_short[2]; unsigned char orientation_short[2];
int maker_offset; int maker_offset;
unsigned long width, height, bits;
u32 frame = jptr->frame; u32 frame = jptr->frame;
// int frame_index = frame & PASTPARS_SAVE_ENTRIES_MASK; // int frame_index = frame & PASTPARS_SAVE_ENTRIES_MASK;
// NC393: current parameters are valid at compressor done interrupt (after frame sync interrupts latest valid is new frame number - 2 // NC393: current parameters are valid at compressor done interrupt (after frame sync interrupts latest valid is new frame number - 2
...@@ -523,7 +531,7 @@ inline void updateIRQ_Exif(struct jpeg_ptr_t *jptr, ///< pointer ...@@ -523,7 +531,7 @@ inline void updateIRQ_Exif(struct jpeg_ptr_t *jptr, ///< pointer
global_flips=extra_flips & 3; global_flips=extra_flips & 3;
} }
// calculate bayer without flips // calculate Bayer without flips
bayer = get_imageParamsFrame(sensor_port, P_COMP_BAYER, frame); bayer = get_imageParamsFrame(sensor_port, P_COMP_BAYER, frame);
bayer ^= get_imageParamsFrame(sensor_port, P_COMPMOD_BYRSH, frame); bayer ^= get_imageParamsFrame(sensor_port, P_COMPMOD_BYRSH, frame);
// subtract flips // subtract flips
...@@ -577,6 +585,22 @@ inline void updateIRQ_Exif(struct jpeg_ptr_t *jptr, ///< pointer ...@@ -577,6 +585,22 @@ inline void updateIRQ_Exif(struct jpeg_ptr_t *jptr, ///< pointer
//get_globalParam(G_TASKLET_CTL) //get_globalParam(G_TASKLET_CTL)
// left 1 long spare (+44) // left 1 long spare (+44)
} }
// Tiff-related data:
width = get_imageParamsFrame(sensor_port, P_WOI_WIDTH, frame);
height = get_imageParamsFrame(sensor_port, P_WOI_HEIGHT, frame);
bits = get_imageParamsFrame(sensor_port, P_BITS, frame);
putlong_meta_irq(sensor_port, width, &meta_offsets.ImageWidth, Exif_Image_ImageWidth);
putlong_meta_irq(sensor_port, height, &meta_offsets.ImageLength, Exif_Image_ImageLength);
short_buff[0] = 0;
short_buff[1] = bits; // assuming non 8/16 (10, 12) are OK?
write_meta_irq(sensor_port, short_buff, &meta_offsets.Image_BitsPerSample, Exif_Image_BitsPerSample, 2);
short_buff[1] = 1;
write_meta_irq(sensor_port, short_buff, &meta_offsets.Image_SamplesPerPixel, Exif_Image_SamplesPerPixel, 2);
short_buff[0] = height >> 8;
short_buff[1] = height & 0xff;
write_meta_irq(sensor_port, short_buff, &meta_offsets.RowsPerStrip, Exif_Image_RowsPerStrip, 2);
putlong_meta_irq(sensor_port, height * width * ((bits + 7) >> 3), &meta_offsets.StripByteCounts, Exif_Image_StripByteCounts);
interframe->meta_index=store_meta(sensor_port); interframe->meta_index=store_meta(sensor_port);
} }
......
...@@ -51,9 +51,11 @@ struct __attribute__((__packed__)) exif_dir_table_t { ...@@ -51,9 +51,11 @@ struct __attribute__((__packed__)) exif_dir_table_t {
unsigned short tag; // Exif tag as defined in the standard unsigned short tag; // Exif tag as defined in the standard
}; };
}; };
unsigned long len; // Number of bytes to be copied from metadata to Exif unsigned long len; // Number of bytes to be copied from metadata to Exif
unsigned long src; // offset in meta data page unsigned long src; // offset in meta data page
unsigned long dst; // offset in output Exif page // unsigned long dst; // offset in output Exif page
unsigned short dst_exif; // offset in output Exif page, 0 - not in file
unsigned short dst_tiff; // offset in output Tiff page, 0 - not in file
}; };
#define MAX_EXIF_FIELDS 256 // number of Exif tags in the header #define MAX_EXIF_FIELDS 256 // number of Exif tags in the header
#define MAX_EXIF_SIZE 4096 // Exif data size #define MAX_EXIF_SIZE 4096 // Exif data size
...@@ -77,8 +79,20 @@ struct __attribute__((__packed__)) exif_dir_table_t { ...@@ -77,8 +79,20 @@ struct __attribute__((__packed__)) exif_dir_table_t {
#define Exif_Image_ExifTag 0x08769 #define Exif_Image_ExifTag 0x08769
#define Exif_Image_GPSTag 0x08825 #define Exif_Image_GPSTag 0x08825
// used for Tiff
#define Exif_Image_NewSubfileType 0x000fe // static: long, count = 1, value = 0 (not reduced, not multipage, not mask)
#define Exif_Image_ImageWidth 0x00100 // long, count = 1
#define Exif_Image_ImageLength 0x00101 // long, count = 1
#define Exif_Image_BitsPerSample 0x00102 // short, count = 1 (8/16)
#define Exif_Image_PhotometricInterpretation 0x00106 // static, short, count = 1, value = 1 (black is zero)
#define Exif_Image_StripOffsets 0x00111 // static long, count = 1 for a single strip (otherwise 1 long for each strip
#define Exif_Image_SamplesPerPixel 0x00115 // short, count = 1. Value = 1 for mono (static?)
#define Exif_Image_RowsPerStrip 0x00116 // short, count = 1. Same as height for a single strip
#define Exif_Image_StripByteCounts 0x00117 // long, count = 1 for a single strip (otherwise 1 long for each strip) = width*height*components*(bits/8)
//Sub IFD //Sub IFD
#define Exif_Photo_ExposureTime 0x1829a #define Exif_Photo_ExposureTime 0x1829a // rational, fixed denominator=1,000,000
#define Exif_Photo_DateTimeOriginal 0x19003 #define Exif_Photo_DateTimeOriginal 0x19003
#define Exif_Photo_MakerNote 0x1927c #define Exif_Photo_MakerNote 0x1927c
#define Exif_Photo_SubSecTime 0x19290 #define Exif_Photo_SubSecTime 0x19290
...@@ -164,8 +178,8 @@ struct __attribute__((__packed__)) meta_CompassInfo_t { ...@@ -164,8 +178,8 @@ struct __attribute__((__packed__)) meta_CompassInfo_t {
#define EXIF_COMPASS_ROLL_ASCII "EW" // use for roll +/- #define EXIF_COMPASS_ROLL_ASCII "EW" // use for roll +/-
/// Exif data (variable, stored with each frame) used for KML (not only) /// Exif data (variable, stored with each frame) used for KML (not only)
#define Exif_Image_ImageDescription_Index 0x00 #define Exif_Image_ImageDescription_Index 0x00 // -
#define Exif_Photo_DateTimeOriginal_Index 0x01 #define Exif_Photo_DateTimeOriginal_Index 0x01 //
#define Exif_Photo_SubSecTimeOriginal_Index 0x02 #define Exif_Photo_SubSecTimeOriginal_Index 0x02
#define Exif_Photo_ExposureTime_Index 0x03 #define Exif_Photo_ExposureTime_Index 0x03
#define Exif_GPSInfo_GPSLatitudeRef_Index 0x04 #define Exif_GPSInfo_GPSLatitudeRef_Index 0x04
...@@ -185,32 +199,24 @@ struct __attribute__((__packed__)) meta_CompassInfo_t { ...@@ -185,32 +199,24 @@ struct __attribute__((__packed__)) meta_CompassInfo_t {
#define Exif_GPSInfo_CompassRoll_Index 0x12 #define Exif_GPSInfo_CompassRoll_Index 0x12
#define Exif_Image_ImageNumber_Index 0x13 #define Exif_Image_ImageNumber_Index 0x13
#define Exif_Image_Orientation_Index 0x14 #define Exif_Image_Orientation_Index 0x14
#define Exif_Image_PageNumber_Index 0x15 #define Exif_Image_PageNumber_Index 0x15 // -
#define Exif_Photo_MakerNote_Index 0x16 #define Exif_Photo_MakerNote_Index 0x16
#define Exif_Image_ImageWidth_Index 0x17 // long, count = 1
#define Exif_Image_ImageLength_Index 0x18 // long, count = 1
#define Exif_Image_BitsPerSample_Index 0x19 // short, count = 1 (8/16)
#define Exif_Image_SamplesPerPixel_Index 0x1a // short, count = 1. Value = 1 for mono (static?) keep for future, don't change from 1
#define Exif_Image_RowsPerStrip_Index 0x1b // short, count = 1. Same as height for a single strip
#define Exif_Image_StripByteCounts_Index 0x1c // long, count = 1 for a single strip (otherwise 1 long for each strip) = width*height*components*(bits/8)
/// update ExifKmlNumber to be total number of *_Index entries /// update ExifKmlNumber to be total number of *_Index entries
#define ExifKmlNumber Exif_Photo_MakerNote_Index+1 //#define ExifKmlNumber Exif_Photo_MakerNote_Index+1
#define ExifKmlNumber Exif_Image_StripByteCounts_Index+1
//#define EXIF_DEV_NAME "/dev/exif_exif" //#define EXIF_DEV_NAME "/dev/exif_exif"
#define EXIFDIR_DEV_NAME "/dev/exif_metadir" #define EXIFDIR_DEV_NAME "/dev/exif_metadir"
//#define EXIFMETA_DEV_NAME "/dev/exif_meta" //#define EXIFMETA_DEV_NAME "/dev/exif_meta"
/**
* @brief This macro is used to construct file names in user space applications. Example
* of usage: <e>const char *exif_file_names[SENSOR_PORTS] = { EXIF_DEV_NAMES };</e>. Then the
* sensor port number can be used to access file name.
*/
#define EXIF_DEV_NAMES "/dev/exif_exif0", \
"/dev/exif_exif1", \
"/dev/exif_exif2", \
"/dev/exif_exif3"
/**
* @brief This macro is used to construct file names in user space applications. Example
* of usage: <e>const char *exifmeta_file_names[SENSOR_PORTS] = { EXIFMETA_DEV_NAMES };</e>. Then
* the sensor port number can be used to access file name.
*/
#define EXIFMETA_DEV_NAMES "/dev/exif_meta0", \
"/dev/exif_meta1", \
"/dev/exif_meta2", \
"/dev/exif_meta3"
#endif /* _ASM_EXIF_H */ #endif /* _ASM_EXIF_H */
...@@ -26,6 +26,9 @@ ...@@ -26,6 +26,9 @@
#define DEV393_EXIF_METADIR ("exif_metadir", "exif_elphel", 125, 3, "0666", "c") ///< write metadata to Exif header translation (dir_table[MAX_EXIF_FIELDS]) #define DEV393_EXIF_METADIR ("exif_metadir", "exif_elphel", 125, 3, "0666", "c") ///< write metadata to Exif header translation (dir_table[MAX_EXIF_FIELDS])
#define DEV393_EXIF_TIME ("exif_time", "exif_elphel", 125, 4, "0666", "c") ///< write today/tomorrow date (YYYY:MM:DD) and number of seconds at today/tomorrow #define DEV393_EXIF_TIME ("exif_time", "exif_elphel", 125, 4, "0666", "c") ///< write today/tomorrow date (YYYY:MM:DD) and number of seconds at today/tomorrow
///< midnight (00:00:00) in seconds from epoch (long, starting from LSB) ///< midnight (00:00:00) in seconds from epoch (long, starting from LSB)
#define DEV393_TIFF_TEMPLATE ("tiff_template", "exif_elphel", 125, 5, "0666", "c") ///< write Tiff template
//#define DEV393_TIFF_METADIR ("tiff_metadir", "exif_elphel", 125, 6, "0666", "c") ///< write metadata to Tiff header translation (dir_table[MAX_EXIF_FIELDS])
#define DEV393_EXIF0 ("exif_exif0", "exif_elphel", 125, 16, "0666", "c") ///< sensor port 0: read encoded Exif data (SEEK_END) #define DEV393_EXIF0 ("exif_exif0", "exif_elphel", 125, 16, "0666", "c") ///< sensor port 0: read encoded Exif data (SEEK_END)
#define DEV393_EXIF1 ("exif_exif1", "exif_elphel", 125, 17, "0666", "c") ///< sensor port 1: read encoded Exif data (SEEK_END) #define DEV393_EXIF1 ("exif_exif1", "exif_elphel", 125, 17, "0666", "c") ///< sensor port 1: read encoded Exif data (SEEK_END)
...@@ -37,6 +40,18 @@ ...@@ -37,6 +40,18 @@
#define DEV393_EXIF_META2 ("exif_meta2", "exif_elphel", 125, 34, "0666", "c") ///< sensor port 2: write metadata, concurrently opened files. All writes are atomic #define DEV393_EXIF_META2 ("exif_meta2", "exif_elphel", 125, 34, "0666", "c") ///< sensor port 2: write metadata, concurrently opened files. All writes are atomic
#define DEV393_EXIF_META3 ("exif_meta3", "exif_elphel", 125, 35, "0666", "c") ///< sensor port 3: write metadata, concurrently opened files. All writes are atomic #define DEV393_EXIF_META3 ("exif_meta3", "exif_elphel", 125, 35, "0666", "c") ///< sensor port 3: write metadata, concurrently opened files. All writes are atomic
#define DEV393_TIFF0 ("tiff_tiff0", "exif_elphel", 125, 24, "0666", "c") ///< sensor port 0: read encoded Tiff data (SEEK_END)
#define DEV393_TIFF1 ("tiff_tiff1", "exif_elphel", 125, 25, "0666", "c") ///< sensor port 1: read encoded Tiff data (SEEK_END)
#define DEV393_TIFF2 ("tiff_tiff2", "exif_elphel", 125, 26, "0666", "c") ///< sensor port 2: read encoded Tiff data (SEEK_END)
#define DEV393_TIFF3 ("tiff_tiff3", "exif_elphel", 125, 27, "0666", "c") ///< sensor port 3: read encoded Tiff data (SEEK_END)
// Meta data common for Exif and Tiff
//#define DEV393_TIFF_META0 ("tiff_meta0", "exif_elphel", 125, 40, "0666", "c") ///< sensor port 0: write metadata, concurrently opened files. All writes are atomic
//#define DEV393_TIFF_META1 ("tiff_meta1", "exif_elphel", 125, 41, "0666", "c") ///< sensor port 1: write metadata, concurrently opened files. All writes are atomic
//#define DEV393_TIFF_META2 ("tiff_meta2", "exif_elphel", 125, 42, "0666", "c") ///< sensor port 2: write metadata, concurrently opened files. All writes are atomic
//#define DEV393_TIFF_META3 ("tiff_meta3", "exif_elphel", 125, 43, "0666", "c") ///< sensor port 3: write metadata, concurrently opened files. All writes are atomic
#define DEV393_FRAMEPARS0 ("frameparsall0","framepars_operations",130,80, "0666", "c") ///< Access frame parameters for channel 0 (schedule modification, read with mmap) #define DEV393_FRAMEPARS0 ("frameparsall0","framepars_operations",130,80, "0666", "c") ///< Access frame parameters for channel 0 (schedule modification, read with mmap)
#define DEV393_FRAMEPARS1 ("frameparsall1","framepars_operations",130,81, "0666", "c") ///< Access frame parameters for channel 1 (schedule modification, read with mmap) #define DEV393_FRAMEPARS1 ("frameparsall1","framepars_operations",130,81, "0666", "c") ///< Access frame parameters for channel 1 (schedule modification, read with mmap)
#define DEV393_FRAMEPARS2 ("frameparsall2","framepars_operations",130,82, "0666", "c") ///< Access frame parameters for channel 2 (schedule modification, read with mmap) #define DEV393_FRAMEPARS2 ("frameparsall2","framepars_operations",130,82, "0666", "c") ///< Access frame parameters for channel 2 (schedule modification, read with mmap)
......
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