Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-elphel
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
linux-elphel
Commits
ac2238bd
Commit
ac2238bd
authored
Jun 03, 2016
by
Mikhail Karpenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename IMG_CHN_NUM to SENSOR_PORTS
parent
cd74a384
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
26 deletions
+23
-26
circbuf.c
src/drivers/elphel/circbuf.c
+5
-5
jpeghead.c
src/drivers/elphel/jpeghead.c
+3
-3
quantization_tables.c
src/drivers/elphel/quantization_tables.c
+1
-1
sensor_common.c
src/drivers/elphel/sensor_common.c
+13
-13
x393_macro.h
src/drivers/elphel/x393_macro.h
+1
-4
No files found.
src/drivers/elphel/circbuf.c
View file @
ac2238bd
...
...
@@ -77,7 +77,7 @@
/** Wait queue for the processes waiting for a new frame to appear in the circular buffer */
wait_queue_head_t
circbuf_wait_queue
;
struct
circbuf_priv_t
circbuf_priv
[
IMAGE_CHN_NUM
];
struct
circbuf_priv_t
circbuf_priv
[
SENSOR_PORTS
];
struct
circbuf_priv_t
*
circbuf_priv_ptr
=
circbuf_priv
;
static
struct
device
*
g_dev_ptr
;
...
...
@@ -113,7 +113,7 @@ int init_ccam_dma_buf_ptr(struct platform_device *pdev)
}
}
for
(
i
=
0
;
i
<
IMAGE_CHN_NUM
;
i
++
)
{
for
(
i
=
0
;
i
<
SENSOR_PORTS
;
i
++
)
{
circbuf_priv
[
i
].
buf_ptr
=
dma_buf_ptr
+
BYTE2DW
(
CIRCBUF_START_OFFSET
+
i
*
CCAM_DMA_SIZE
);
circbuf_priv
[
i
].
phys_addr
=
dma_handle
+
CIRCBUF_START_OFFSET
+
i
*
CCAM_DMA_SIZE
;
ccam_dma_buf_ptr
[
i
]
=
circbuf_priv
[
i
].
buf_ptr
;
...
...
@@ -525,7 +525,7 @@ loff_t circbuf_lseek(struct file *file, loff_t offset, int orig)
{
int
s
;
dev_dbg
(
g_dev_ptr
,
"stopping all compressors, current channel %d, fvld = %d, file->f_pos = 0x%llx
\n
"
,
chn
,
fvld
,
file
->
f_pos
);
for
(
s
=
0
;
s
<
IMAGE_CHN_NUM
;
s
++
)
for
(
s
=
0
;
s
<
SENSOR_PORTS
;
s
++
)
stop_compressor
(
s
);
dump_state
(
chn
);
}
...
...
@@ -731,7 +731,7 @@ ssize_t circbuf_write(struct file *file, const char *buf, size_t count, loff_t *
}
break
;
case
4
:
for
(
i
=
0
;
i
<
IMAGE_CHN_NUM
;
i
++
)
for
(
i
=
0
;
i
<
SENSOR_PORTS
;
i
++
)
stop_compressor
(
i
);
dump_state
(
chn
);
break
;
...
...
@@ -740,7 +740,7 @@ ssize_t circbuf_write(struct file *file, const char *buf, size_t count, loff_t *
{
int
j
,
cntr
;
long
long
res
;
for
(
i
=
0
;
i
<
IMAGE_CHN_NUM
;
i
++
)
{
for
(
i
=
0
;
i
<
SENSOR_PORTS
;
i
++
)
{
cntr
=
get_zero_counter
(
i
);
printk
(
KERN_DEBUG
"channel = %d, hw pointer = 0x%x, zero_counter = %d, corrected_offset = %d, frame_counter = %lld
\n
"
,
i
,
DW2BYTE
(
camseq_get_jpeg_wp
(
i
)),
cntr
,
get_corrected_offset
(
i
),
get_frame_counter
(
i
));
...
...
src/drivers/elphel/jpeghead.c
View file @
ac2238bd
...
...
@@ -90,7 +90,7 @@ static struct jpeghead_priv_t {
unsigned
int
fpga_programmed
;
unsigned
long
jpeg_h_sz
;
/// JPEG header size (no Exif)
unsigned
char
header
[
JPEG_HEADER_MAXSIZE
];
}
jpeghead_priv
[
IMAGE_CHN_NUM
];
}
jpeghead_priv
[
SENSOR_PORTS
];
#define HEADER_COPY_SOF(x) {buf[bpl] = sizeof( x ) + 8; \
buf[bp++] = sizeof( x ) / 3; \
...
...
@@ -748,7 +748,7 @@ int jpeghead_init(struct platform_device *pdev)
int
i
;
g_dev_ptr
=
&
pdev
->
dev
;
for
(
i
=
0
;
i
<
IMAGE_CHN_NUM
;
i
++
)
{
for
(
i
=
0
;
i
<
SENSOR_PORTS
;
i
++
)
{
jpeghead_priv
[
i
].
fpga_programmed
=
0
;
jpeg_htable_init
(
i
);
}
...
...
@@ -759,7 +759,7 @@ int jpeghead_init(struct platform_device *pdev)
if
(
get_cache_policy
()
==
COMMON_CACHE
)
{
reset_qtables
(
0
);
}
else
if
(
get_cache_policy
()
==
PER_CHN_CACHE
)
{
for
(
i
=
0
;
i
<
IMAGE_CHN_NUM
;
i
++
)
for
(
i
=
0
;
i
<
SENSOR_PORTS
;
i
++
)
reset_qtables
(
i
);
}
...
...
src/drivers/elphel/quantization_tables.c
View file @
ac2238bd
...
...
@@ -78,7 +78,7 @@
/** @brief Total number of quantization table pairs */
#define FPGA_NQTAB 8
#define CORING_SIZE 32 // longs
#define QTABLE_SETS_NUM (
IMAGE_CHN_NUM
+ 1)
#define QTABLE_SETS_NUM (
SENSOR_PORTS
+ 1)
#define COMMON_CACHE_INDEX 0
...
...
src/drivers/elphel/sensor_common.c
View file @
ac2238bd
...
...
@@ -117,13 +117,13 @@ struct jpeg_ptr_t {
*/
struct
image_acq_pd_t
{
int
minor
;
struct
jpeg_ptr_t
jpeg_ptr
[
IMAGE_CHN_NUM
];
struct
jpeg_ptr_t
jpeg_ptr
[
SENSOR_PORTS
];
};
/* debug code follows */
long
long
zero_counter
[
IMAGE_CHN_NUM
]
=
{
0
};
long
long
corrected_offset
[
IMAGE_CHN_NUM
]
=
{
0
};
long
long
frame_counter
[
IMAGE_CHN_NUM
]
=
{
0
};
long
long
frame_pos
[
IMAGE_CHN_NUM
][
1000
]
=
{
0
};
long
long
zero_counter
[
SENSOR_PORTS
]
=
{
0
};
long
long
corrected_offset
[
SENSOR_PORTS
]
=
{
0
};
long
long
frame_counter
[
SENSOR_PORTS
]
=
{
0
};
long
long
frame_pos
[
SENSOR_PORTS
][
1000
]
=
{
0
};
long
long
get_zero_counter
(
unsigned
int
chn
)
{
return
zero_counter
[
chn
];
...
...
@@ -138,7 +138,7 @@ long long get_frame_counter(unsigned int chn)
}
long
long
get_frame_pos
(
unsigned
int
chn
,
unsigned
int
pos
)
{
if
(
chn
<
IMAGE_CHN_NUM
&&
pos
<
1000
)
if
(
chn
<
SENSOR_PORTS
&&
pos
<
1000
)
return
frame_pos
[
chn
][
pos
];
return
0
;
}
...
...
@@ -174,17 +174,17 @@ void camSeqSetJPEG_rp(int p) {
int
camseq_get_jpeg_wp
(
unsigned
int
chn
)
{
return
(
chn
<
IMAGE_CHN_NUM
)
?
image_acq_priv
.
jpeg_ptr
[
chn
].
jpeg_wp
:
0
;
return
(
chn
<
SENSOR_PORTS
)
?
image_acq_priv
.
jpeg_ptr
[
chn
].
jpeg_wp
:
0
;
}
int
camseq_get_jpeg_rp
(
unsigned
int
chn
)
{
return
(
chn
<
IMAGE_CHN_NUM
)
?
image_acq_priv
.
jpeg_ptr
[
chn
].
jpeg_rp
:
0
;
return
(
chn
<
SENSOR_PORTS
)
?
image_acq_priv
.
jpeg_ptr
[
chn
].
jpeg_rp
:
0
;
}
void
camseq_set_jpeg_rp
(
unsigned
int
chn
,
int
ptr
)
{
if
(
chn
<
IMAGE_CHN_NUM
)
{
if
(
chn
<
SENSOR_PORTS
)
{
image_acq_priv
.
jpeg_ptr
[
chn
].
jpeg_rp
=
ptr
;
}
}
...
...
@@ -236,7 +236,7 @@ DECLARE_TASKLET(tasklet_fpga_0, tasklet_fpga_function, 0); /// 0 - no arguments
DECLARE_TASKLET
(
tasklet_fpga_1
,
tasklet_fpga_function
,
1
);
/// 0 - no arguments for now
DECLARE_TASKLET
(
tasklet_fpga_2
,
tasklet_fpga_function
,
2
);
/// 0 - no arguments for now
DECLARE_TASKLET
(
tasklet_fpga_3
,
tasklet_fpga_function
,
3
);
/// 0 - no arguments for now
static
struct
tasklet_struct
*
tasklets
[
IMAGE_CHN_NUM
]
=
{
&
tasklet_fpga_0
,
&
tasklet_fpga_1
,
&
tasklet_fpga_2
,
&
tasklet_fpga_3
};
static
struct
tasklet_struct
*
tasklets
[
SENSOR_PORTS
]
=
{
&
tasklet_fpga_0
,
&
tasklet_fpga_1
,
&
tasklet_fpga_2
,
&
tasklet_fpga_3
};
/**
...
...
@@ -788,7 +788,7 @@ void camera_interrupts (int on) {
#endif
/* TEST_DISABLE_CODE */
irq_ctrl
.
interrupt_cmd
=
on
?
IRQ_ENABLE
:
IRQ_DISABLE
;
for
(
i
=
0
;
i
<
IMAGE_CHN_NUM
;
i
++
)
{
for
(
i
=
0
;
i
<
SENSOR_PORTS
;
i
++
)
{
x393_cmprs_interrupts
(
irq_ctrl
,
i
);
}
}
...
...
@@ -820,7 +820,7 @@ int image_acq_init(struct platform_device *pdev)
//MDD1(printk("sensorproc=0x%x\n",(int) sensorproc));
dev_dbg
(
dev
,
"sensorproc address: 0x%x
\n
"
,
(
int
)
sensorproc
);
for
(
i
=
0
;
i
<
IMAGE_CHN_NUM
;
i
++
)
{
for
(
i
=
0
;
i
<
SENSOR_PORTS
;
i
++
)
{
irq
=
platform_get_irq_byname
(
pdev
,
frame_sync_irq_names
[
i
]);
if
(
request_irq
(
irq
,
frame_sync_irq_handler
,
...
...
@@ -866,7 +866,7 @@ int image_acq_init(struct platform_device *pdev)
dev_dbg
(
dev
,
"Elphel FPGA interrupts initialized
\n
"
);
dev_dbg
(
dev
,
"reset all compressors
\n
"
);
for
(
i
=
0
;
i
<
IMAGE_CHN_NUM
;
i
++
)
{
for
(
i
=
0
;
i
<
SENSOR_PORTS
;
i
++
)
{
reset_compressor
(
i
);
}
//reset_compressor(); /// reset compressor and buffer pointers
...
...
src/drivers/elphel/x393_macro.h
View file @
ac2238bd
...
...
@@ -7,9 +7,6 @@
#include <elphel/driver_numbers.h>
/** @brief Number of image channels */
#define IMAGE_CHN_NUM 4
/** @brief Resolution of current/OEF pointer in bits */
#define OFFSET256_CNTR_RES 26
...
...
@@ -62,7 +59,7 @@ static inline unsigned int minor_to_chn(unsigned int minor, unsigned int *dev_ty
else
*
dev_type
=
0
;
}
if
((
minor
&
0x0f
)
<
IMAGE_CHN_NUM
)
if
((
minor
&
0x0f
)
<
SENSOR_PORTS
)
return
minor
&
0x0f
;
else
return
0
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment