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
99dc26ff
Commit
99dc26ff
authored
Apr 10, 2016
by
Mikhail Karpenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WIP: rename X313_* macro
parent
0b49b265
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
9 deletions
+8
-9
circbuf.c
src/drivers/elphel/circbuf.c
+4
-4
sensor_common.c
src/drivers/elphel/sensor_common.c
+2
-2
x393_macro.h
src/drivers/elphel/x393_macro.h
+2
-3
No files found.
src/drivers/elphel/circbuf.c
View file @
99dc26ff
...
...
@@ -219,7 +219,7 @@ loff_t circbuf_all_lseek(struct file * file, loff_t offset, int orig)
if
(
orig
==
SEEK_END
&&
offset
>
0
)
{
rp
=
BYTE2DW
(
offset
)
&
(
~
7
);
// convert to index to long, align to 32-bytes
//fp = (struct interframe_params_t *) &ccam_dma_buf_ptr[X313_BUFFSUB(rp, 8)]; //! 32 bytes before the frame pointer, may roll-over to the end of ccam_dma_buf_ptr
fp
=
(
struct
interframe_params_t
*
)
&
circbuf_priv
[
minor_to_chn
(
minor
)].
buf_ptr
[
X3
1
3_BUFFSUB
(
rp
,
8
)];
fp
=
(
struct
interframe_params_t
*
)
&
circbuf_priv
[
minor_to_chn
(
minor
)].
buf_ptr
[
X3
9
3_BUFFSUB
(
rp
,
8
)];
}
return
jpeghead_lseek
(
file
,
offset
,
orig
,
fp
);
case
CMOSCAM_MINOR_HUFFMAN
:
...
...
@@ -360,7 +360,7 @@ unsigned long get_image_length(int offset, unsigned int chn, int *last_chunk_off
last_image_chunk
+=
CCAM_DMA_SIZE
;
len32
=
circbuf_priv
[
chn
].
buf_ptr
[
BYTE2DW
(
last_image_chunk
+
(
CHUNK_SIZE
-
CCAM_MMAP_META_LENGTH
))];
if
(
last_chunk_offset
!=
NULL
)
last_chunk_offset
=
last_image_chunk
;
*
last_chunk_offset
=
last_image_chunk
;
return
len32
;
}
...
...
@@ -380,7 +380,7 @@ int circbufValidPointer(int rp, struct interframe_params_t ** fpp, unsigned int
dev_dbg
(
g_dev_ptr
,
"misaligned pointer rp = 0x%x for channel %d
\n
"
,
rp
,
chn
);
return
-
2
;
}
fp
=
(
struct
interframe_params_t
*
)
&
circbuf_priv
[
chn
].
buf_ptr
[
X3
1
3_BUFFSUB
(
p
,
INTERFRAME_PARAMS_SZ
)];
fp
=
(
struct
interframe_params_t
*
)
&
circbuf_priv
[
chn
].
buf_ptr
[
X3
9
3_BUFFSUB
(
p
,
INTERFRAME_PARAMS_SZ
)];
*
fpp
=
fp
;
dump_interframe_params
(
fp
);
...
...
@@ -543,7 +543,7 @@ loff_t circbuf_lseek(struct file * file, loff_t offset, int orig) {
// calculate the full length of current frame and advance file pointer by this value
inserted_bytes
=
((
CHUNK_SIZE
-
(((
len32
%
CHUNK_SIZE
)
+
CCAM_MMAP_META
)
%
CHUNK_SIZE
)
-
ADJUSTMENT
)
%
CHUNK_SIZE
)
+
ADJUSTMENT
;
padded_frame
=
fp
->
len32
+
inserted_bytes
+
CHUNK_SIZE
+
CCAM_MMAP_META
;
file
->
f_pos
=
X3
1
3_BUFFADD
(
file
->
f_pos
>>
2
,
padded_frame
)
<<
2
;
// do it even if the next frame does not yet exist
file
->
f_pos
=
X3
9
3_BUFFADD
(
file
->
f_pos
>>
2
,
padded_frame
)
<<
2
;
// do it even if the next frame does not yet exist
dev_dbg
(
g_dev_ptr
,
"LSEEK_CIRC_NEXT: moving file->f_pos to 0x%x
\n
"
,
file
->
f_pos
);
break
;
case
LSEEK_CIRC_FIRST
:
...
...
src/drivers/elphel/sensor_common.c
View file @
99dc26ff
...
...
@@ -308,9 +308,9 @@ inline struct interframe_params_t* updateIRQ_interframe(struct jpeg_ptr_t *jptr)
struct
interframe_params_t
*
interframe
;
int
circbuf_size
=
BYTE2DW
(
get_globalParam
(
G_CIRCBUFSIZE
));
int
len_offset
=
X3
1
3_BUFFSUB
(
jptr
->
jpeg_wp
,
8
);
int
len_offset
=
X3
9
3_BUFFSUB
(
jptr
->
jpeg_wp
,
8
);
int
len32
=
circbuf_priv_ptr
[
jptr
->
chn_num
].
buf_ptr
[
len_offset
]
&
FRAME_LENGTH_MASK
;
int
frame_params_offset
=
X3
1
3_BUFFSUB
(
jptr
->
jpeg_wp
,
INTERFRAME_PARAMS_SZ
);
int
frame_params_offset
=
X3
9
3_BUFFSUB
(
jptr
->
jpeg_wp
,
INTERFRAME_PARAMS_SZ
);
interframe
=
(
struct
interframe_params_t
*
)
&
circbuf_priv_ptr
[
jptr
->
chn_num
].
buf_ptr
[
frame_params_offset
];
interframe
->
frame_length
=
len32
;
...
...
src/drivers/elphel/x393_macro.h
View file @
99dc26ff
...
...
@@ -30,8 +30,7 @@
/* These macro were removed from sensor_common.h*/
#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))))
#define X393_BUFFSUB(x, y) (((x) >= (y)) ? ((x)-(y)) : ((x) + (CCAM_DMA_SIZE -(y))))
#define X393_BUFFADD(x, y) ((((x) + (y)) <= CCAM_DMA_SIZE) ? ((x) + (y)) : ((x) - (CCAM_DMA_SIZE -(y))))
#endif
/* _X393_MACRO */
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