Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
e2c9500d
Commit
e2c9500d
authored
Sep 19, 2007
by
Mauro Carvalho Chehab
Committed by
Mauro Carvalho Chehab
May 18, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
V4L/DVB (12798): tm6000: Split header processing from header find
Signed-off-by:
Mauro Carvalho Chehab
<
mchehab@redhat.com
>
parent
c13dd704
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
87 additions
and
76 deletions
+87
-76
drivers/staging/tm6000/tm6000-video.c
drivers/staging/tm6000/tm6000-video.c
+87
-76
No files found.
drivers/staging/tm6000/tm6000-video.c
View file @
e2c9500d
...
@@ -185,16 +185,14 @@ static void inline buffer_filled (struct tm6000_core *dev,
...
@@ -185,16 +185,14 @@ static void inline buffer_filled (struct tm6000_core *dev,
/*
/*
* Identify the tm5600/6000 buffer header type and properly handles
* Identify the tm5600/6000 buffer header type and properly handles
*/
*/
static
int
copy_streams
(
u8
*
data
,
u8
*
out_p
,
unsigned
long
len
,
static
u8
*
copy_packet
(
struct
urb
*
urb
,
u32
header
,
u8
*
data
,
u8
*
endp
,
struct
urb
*
urb
,
struct
tm6000_buffer
**
buf
)
u8
*
out_p
,
struct
tm6000_buffer
**
buf
)
{
{
struct
tm6000_dmaqueue
*
dma_q
=
urb
->
context
;
struct
tm6000_dmaqueue
*
dma_q
=
urb
->
context
;
struct
tm6000_core
*
dev
=
container_of
(
dma_q
,
struct
tm6000_core
,
vidq
);
struct
tm6000_core
*
dev
=
container_of
(
dma_q
,
struct
tm6000_core
,
vidq
);
u8
*
ptr
=
data
,
*
endp
=
data
+
len
;
u8
*
ptr
=
data
;
u8
c
;
u8
c
;
unsigned
int
cmd
,
cpysize
,
pktsize
,
size
,
field
,
block
,
line
,
pos
=
0
;
unsigned
int
cmd
,
cpysize
,
pktsize
,
size
,
field
,
block
,
line
,
pos
=
0
;
unsigned
long
header
;
int
rc
=
0
;
/* FIXME: this is the hardcoded window size
/* FIXME: this is the hardcoded window size
*/
*/
...
@@ -202,21 +200,7 @@ static int copy_streams(u8 *data, u8 *out_p, unsigned long len,
...
@@ -202,21 +200,7 @@ static int copy_streams(u8 *data, u8 *out_p, unsigned long len,
//static int last_line=-2;
//static int last_line=-2;
for
(
ptr
=
data
;
ptr
<
endp
;)
{
if
(
!
dev
->
isoc_ctl
.
cmd
)
{
if
(
!
dev
->
isoc_ctl
.
cmd
)
{
/* Seek for sync */
for
(
ptr
+=
3
;
ptr
<
endp
;
ptr
++
)
{
if
(
*
ptr
==
0x47
)
{
ptr
-=
3
;
break
;
}
}
if
(
ptr
>=
endp
)
return
rc
;
/* Get message header */
header
=*
(
unsigned
long
*
)
ptr
;
ptr
+=
4
;
c
=
(
header
>>
24
)
&
0xff
;
c
=
(
header
>>
24
)
&
0xff
;
/* split the header fields */
/* split the header fields */
...
@@ -226,10 +210,6 @@ static int copy_streams(u8 *data, u8 *out_p, unsigned long len,
...
@@ -226,10 +210,6 @@ static int copy_streams(u8 *data, u8 *out_p, unsigned long len,
line
=
(
header
>>
12
)
&
0x1ff
;
line
=
(
header
>>
12
)
&
0x1ff
;
cmd
=
(
header
>>
21
)
&
0x7
;
cmd
=
(
header
>>
21
)
&
0x7
;
/* FIXME: Maximum possible line is 511.
* This doesn't seem to be enough for PAL standards
*/
/* Validates header fields */
/* Validates header fields */
if
(
size
>
TM6000_URB_MSG_LEN
)
if
(
size
>
TM6000_URB_MSG_LEN
)
size
=
TM6000_URB_MSG_LEN
;
size
=
TM6000_URB_MSG_LEN
;
...
@@ -243,8 +223,6 @@ static int copy_streams(u8 *data, u8 *out_p, unsigned long len,
...
@@ -243,8 +223,6 @@ static int copy_streams(u8 *data, u8 *out_p, unsigned long len,
pos
=
((
line
<<
1
)
+
field
)
*
linesize
+
pos
=
((
line
<<
1
)
+
field
)
*
linesize
+
block
*
TM6000_URB_MSG_LEN
;
block
*
TM6000_URB_MSG_LEN
;
/* Don't allow to write out of the buffer */
/* Don't allow to write out of the buffer */
if
(
pos
+
TM6000_URB_MSG_LEN
>
(
*
buf
)
->
vb
.
size
)
if
(
pos
+
TM6000_URB_MSG_LEN
>
(
*
buf
)
->
vb
.
size
)
cmd
=
TM6000_URB_MSG_ERR
;
cmd
=
TM6000_URB_MSG_ERR
;
...
@@ -254,16 +232,18 @@ static int copy_streams(u8 *data, u8 *out_p, unsigned long len,
...
@@ -254,16 +232,18 @@ static int copy_streams(u8 *data, u8 *out_p, unsigned long len,
" line=%d, field=%d
\n
"
,
" line=%d, field=%d
\n
"
,
size
,
block
,
line
,
field
);
size
,
block
,
line
,
field
);
dev
->
isoc_ctl
.
cmd
=
cmd
;
pktsize
=
TM6000_URB_MSG_LEN
;
dev
->
isoc_ctl
.
size
=
size
;
/////////////////////////////
dev
->
isoc_ctl
.
pos
=
pos
;
/// nao seria size???
dev
->
isoc_ctl
.
pktsize
=
pktsize
=
TM6000_URB_MSG_LEN
;
}
else
{
}
else
{
/* Continue the last copy */
cmd
=
dev
->
isoc_ctl
.
cmd
;
cmd
=
dev
->
isoc_ctl
.
cmd
;
size
=
dev
->
isoc_ctl
.
size
;
size
=
dev
->
isoc_ctl
.
size
;
pos
=
dev
->
isoc_ctl
.
pos
;
pos
=
dev
->
isoc_ctl
.
pos
;
pktsize
=
dev
->
isoc_ctl
.
pktsize
;
pktsize
=
dev
->
isoc_ctl
.
pktsize
;
}
}
cpysize
=
(
endp
-
ptr
>
size
)
?
size
:
endp
-
ptr
;
cpysize
=
(
endp
-
ptr
>
size
)
?
size
:
endp
-
ptr
;
if
(
cpysize
)
{
if
(
cpysize
)
{
...
@@ -288,6 +268,38 @@ static int copy_streams(u8 *data, u8 *out_p, unsigned long len,
...
@@ -288,6 +268,38 @@ static int copy_streams(u8 *data, u8 *out_p, unsigned long len,
dev
->
isoc_ctl
.
cmd
=
0
;
dev
->
isoc_ctl
.
cmd
=
0
;
ptr
+=
pktsize
;
ptr
+=
pktsize
;
}
}
return
ptr
;
}
static
int
copy_streams
(
u8
*
data
,
u8
*
out_p
,
unsigned
long
len
,
struct
urb
*
urb
,
struct
tm6000_buffer
**
buf
)
{
struct
tm6000_dmaqueue
*
dma_q
=
urb
->
context
;
struct
tm6000_core
*
dev
=
container_of
(
dma_q
,
struct
tm6000_core
,
vidq
);
u8
*
ptr
=
data
,
*
endp
=
data
+
len
;
u32
header
=
0
;
int
rc
=
0
;
for
(
ptr
=
data
;
ptr
<
endp
;)
{
if
(
!
dev
->
isoc_ctl
.
cmd
)
{
/* Seek for sync */
for
(
ptr
+=
3
;
ptr
<
endp
;
ptr
++
)
{
if
(
*
ptr
==
0x47
)
{
ptr
-=
3
;
break
;
}
}
if
(
ptr
>=
endp
)
return
rc
;
/* Get message header */
header
=*
(
unsigned
long
*
)
ptr
;
ptr
+=
4
;
}
/* Copy or continue last copy */
ptr
=
copy_packet
(
urb
,
header
,
ptr
,
endp
,
out_p
,
buf
);
}
}
return
rc
;
return
rc
;
...
@@ -810,7 +822,6 @@ buffer_prepare(struct videobuf_queue *vq, struct videobuf_buffer *vb,
...
@@ -810,7 +822,6 @@ buffer_prepare(struct videobuf_queue *vq, struct videobuf_buffer *vb,
/* Round to an enough number of URBs */
/* Round to an enough number of URBs */
urbsize
=
(
urbsize
+
dev
->
max_isoc_in
-
1
)
/
dev
->
max_isoc_in
;
urbsize
=
(
urbsize
+
dev
->
max_isoc_in
-
1
)
/
dev
->
max_isoc_in
;
printk
(
"Allocating %d packets to handle %lu size
\n
"
,
urbsize
,
buf
->
vb
.
size
);
printk
(
"Allocating %d packets to handle %lu size
\n
"
,
urbsize
,
buf
->
vb
.
size
);
dprintk
(
dev
,
V4L2_DEBUG_QUEUE
,
"Allocating %d packets to handle "
dprintk
(
dev
,
V4L2_DEBUG_QUEUE
,
"Allocating %d packets to handle "
...
...
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