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
d72b8ecc
Commit
d72b8ecc
authored
Sep 09, 2016
by
Mikhail Karpenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Process errors during new frame reception
parent
7630393b
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
3 deletions
+29
-3
ahci_elphel.c
src/drivers/ata/ahci_elphel.c
+27
-1
circbuf.c
src/drivers/elphel/circbuf.c
+1
-1
circbuf.h
src/drivers/elphel/circbuf.h
+1
-1
No files found.
src/drivers/ata/ahci_elphel.c
View file @
d72b8ecc
...
@@ -1034,7 +1034,7 @@ static ssize_t rawdev_write(struct device *dev, ///<
...
@@ -1034,7 +1034,7 @@ static ssize_t rawdev_write(struct device *dev, ///<
const
char
*
buff
,
///<
const
char
*
buff
,
///<
size_t
buff_sz
)
///<
size_t
buff_sz
)
///<
{
{
size_t
rcvd
=
0
;
s
s
ize_t
rcvd
=
0
;
bool
proceed
=
false
;
bool
proceed
=
false
;
unsigned
long
irq_flags
;
unsigned
long
irq_flags
;
struct
elphel_ahci_priv
*
dpriv
=
dev_get_dpriv
(
dev
);
struct
elphel_ahci_priv
*
dpriv
=
dev_get_dpriv
(
dev
);
...
@@ -1081,11 +1081,37 @@ static ssize_t rawdev_write(struct device *dev, ///<
...
@@ -1081,11 +1081,37 @@ static ssize_t rawdev_write(struct device *dev, ///<
}
}
rcvd
=
jpeghead_get_data
(
fdata
.
sensor_port
,
buffs
->
jpheader_buff
.
iov_base
,
buffs
->
jpheader_buff
.
iov_len
,
0
);
rcvd
=
jpeghead_get_data
(
fdata
.
sensor_port
,
buffs
->
jpheader_buff
.
iov_base
,
buffs
->
jpheader_buff
.
iov_len
,
0
);
if
(
rcvd
<
0
)
{
/* free resource lock and current command slot */
if
(
proceed
)
{
spin_lock_irqsave
(
&
dpriv
->
flags_lock
,
irq_flags
);
dpriv
->
flags
&=
~
DISK_BUSY
;
spin_unlock_irqrestore
(
&
dpriv
->
flags_lock
,
irq_flags
);
}
reset_chunks
(
chunks
,
0
);
dpriv
->
tail_ptr
=
get_prev_slot
(
dpriv
);
dpriv
->
flags
&=
~
LOCK_TAIL
;
dev_err
(
dev
,
"could not get JPEG header, error %d
\n
"
,
rcvd
);
return
-
EINVAL
;
}
chunks
[
CHUNK_LEADER
].
iov_len
=
JPEG_MARKER_LEN
;
chunks
[
CHUNK_LEADER
].
iov_len
=
JPEG_MARKER_LEN
;
chunks
[
CHUNK_TRAILER
].
iov_len
=
JPEG_MARKER_LEN
;
chunks
[
CHUNK_TRAILER
].
iov_len
=
JPEG_MARKER_LEN
;
chunks
[
CHUNK_HEADER
].
iov_len
=
rcvd
-
chunks
[
CHUNK_LEADER
].
iov_len
;
chunks
[
CHUNK_HEADER
].
iov_len
=
rcvd
-
chunks
[
CHUNK_LEADER
].
iov_len
;
rcvd
=
circbuf_get_ptr
(
fdata
.
sensor_port
,
fdata
.
cirbuf_ptr
,
fdata
.
jpeg_len
,
&
chunks
[
CHUNK_DATA_0
],
&
chunks
[
CHUNK_DATA_1
]);
rcvd
=
circbuf_get_ptr
(
fdata
.
sensor_port
,
fdata
.
cirbuf_ptr
,
fdata
.
jpeg_len
,
&
chunks
[
CHUNK_DATA_0
],
&
chunks
[
CHUNK_DATA_1
]);
if
(
rcvd
<
0
)
{
/* free resource lock and current command slot */
if
(
proceed
)
{
spin_lock_irqsave
(
&
dpriv
->
flags_lock
,
irq_flags
);
dpriv
->
flags
&=
~
DISK_BUSY
;
spin_unlock_irqrestore
(
&
dpriv
->
flags_lock
,
irq_flags
);
}
reset_chunks
(
chunks
,
0
);
dpriv
->
tail_ptr
=
get_prev_slot
(
dpriv
);
dpriv
->
flags
&=
~
LOCK_TAIL
;
dev_err
(
dev
,
"could not get JPEG data, error %d
\n
"
,
rcvd
);
return
-
EINVAL
;
}
align_frame
(
dpriv
);
align_frame
(
dpriv
);
/* new command slot is ready now and can be unlocked */
/* new command slot is ready now and can be unlocked */
dpriv
->
flags
&=
~
LOCK_TAIL
;
dpriv
->
flags
&=
~
LOCK_TAIL
;
...
...
src/drivers/elphel/circbuf.c
View file @
d72b8ecc
...
@@ -100,7 +100,7 @@ int init_ccam_dma_buf_ptr(struct platform_device *pdev)
...
@@ -100,7 +100,7 @@ int init_ccam_dma_buf_ptr(struct platform_device *pdev)
return
0
;
return
0
;
}
}
in
t
circbuf_get_ptr
(
int
sensor_port
,
size_t
offset
,
size_t
len
,
struct
fvec
*
vect_0
,
struct
fvec
*
vect_1
)
ssize_
t
circbuf_get_ptr
(
int
sensor_port
,
size_t
offset
,
size_t
len
,
struct
fvec
*
vect_0
,
struct
fvec
*
vect_1
)
{
{
int
ret
=
1
;
int
ret
=
1
;
...
...
src/drivers/elphel/circbuf.h
View file @
d72b8ecc
...
@@ -56,6 +56,6 @@ extern unsigned short circbuf_width;
...
@@ -56,6 +56,6 @@ extern unsigned short circbuf_width;
extern
unsigned
char
circbuf_byrshift
;
extern
unsigned
char
circbuf_byrshift
;
/* end of debug code */
/* end of debug code */
in
t
circbuf_get_ptr
(
int
sensor_port
,
size_t
offset
,
size_t
len
,
struct
fvec
*
vect_0
,
struct
fvec
*
vect_1
);
ssize_
t
circbuf_get_ptr
(
int
sensor_port
,
size_t
offset
,
size_t
len
,
struct
fvec
*
vect_0
,
struct
fvec
*
vect_1
);
#endif
/* _CIRCBUF_H */
#endif
/* _CIRCBUF_H */
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