Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
mellanox
Bluefield Linux
提交
6bb2790f
B
Bluefield Linux
项目概览
mellanox
/
Bluefield Linux
大约 1 年 前同步成功
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
B
Bluefield Linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
6bb2790f
编写于
8月 23, 2007
作者:
M
Mauro Carvalho Chehab
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
V4L/DVB (6253): Convert vivi to use the newer videobuf-dma-sg module
Signed-off-by:
N
Mauro Carvalho Chehab
<
mchehab@infradead.org
>
上级
c1accaa2
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
20 addition
and
33 deletion
+20
-33
drivers/media/video/vivi.c
drivers/media/video/vivi.c
+20
-33
未找到文件。
drivers/media/video/vivi.c
浏览文件 @
6bb2790f
...
...
@@ -33,7 +33,7 @@
#include <linux/videodev.h>
#endif
#include <linux/interrupt.h>
#include <media/video
-buf
.h>
#include <media/video
buf-dma-sg
.h>
#include <media/v4l2-common.h>
#include <linux/kthread.h>
#include <linux/highmem.h>
...
...
@@ -327,19 +327,21 @@ static void vivi_fillbuff(struct vivi_dev *dev,struct vivi_buffer *buf)
int
wmax
=
buf
->
vb
.
width
;
struct
timeval
ts
;
char
*
tmpbuf
;
struct
videobuf_dmabuf
*
dma
=
videobuf_to_dma
(
&
buf
->
vb
);
if
(
buf
->
vb
.
dma
.
varea
)
{
if
(
dma
->
varea
)
{
tmpbuf
=
kmalloc
(
wmax
*
2
,
GFP_KERNEL
);
}
else
{
tmpbuf
=
buf
->
vb
.
dma
.
vmalloc
;
tmpbuf
=
dma
->
vmalloc
;
}
for
(
h
=
0
;
h
<
hmax
;
h
++
)
{
if
(
buf
->
vb
.
dma
.
varea
)
{
if
(
dma
->
varea
)
{
gen_line
(
tmpbuf
,
0
,
wmax
,
hmax
,
h
,
dev
->
timestr
);
/* FIXME: replacing to __copy_to_user */
if
(
copy_to_user
(
buf
->
vb
.
dma
.
varea
+
pos
,
tmpbuf
,
wmax
*
2
)
!=
0
)
if
(
copy_to_user
(
dma
->
varea
+
pos
,
tmpbuf
,
wmax
*
2
)
!=
0
)
dprintk
(
2
,
"vivifill copy_to_user failed.
\n
"
);
}
else
{
gen_line
(
tmpbuf
,
pos
,
wmax
,
hmax
,
h
,
dev
->
timestr
);
...
...
@@ -369,7 +371,7 @@ static void vivi_fillbuff(struct vivi_dev *dev,struct vivi_buffer *buf)
dev
->
h
,
dev
->
m
,
dev
->
s
,(
dev
->
us
+
500
)
/
1000
);
dprintk
(
2
,
"vivifill at %s: Buffer 0x%08lx size= %d
\n
"
,
dev
->
timestr
,
(
unsigned
long
)
buf
->
vb
.
dma
.
varea
,
pos
);
(
unsigned
long
)
dma
->
varea
,
pos
);
/* Advice that buffer was filled */
buf
->
vb
.
state
=
STATE_DONE
;
...
...
@@ -597,13 +599,19 @@ buffer_setup(struct videobuf_queue *vq, unsigned int *count, unsigned int *size)
if
(
0
==
*
count
)
*
count
=
32
;
while
(
*
size
*
*
count
>
vid_limit
*
1024
*
1024
)
(
*
count
)
--
;
dprintk
(
1
,
"%s, count=%d, size=%d
\n
"
,
__FUNCTION__
,
*
count
,
*
size
);
return
0
;
}
static
void
free_buffer
(
struct
videobuf_queue
*
vq
,
struct
vivi_buffer
*
buf
)
{
struct
videobuf_dmabuf
*
dma
=
videobuf_to_dma
(
&
buf
->
vb
);
dprintk
(
1
,
"%s
\n
"
,
__FUNCTION__
);
if
(
in_interrupt
())
...
...
@@ -611,8 +619,8 @@ static void free_buffer(struct videobuf_queue *vq, struct vivi_buffer *buf)
videobuf_waiton
(
&
buf
->
vb
,
0
,
0
);
videobuf_dma_unmap
(
vq
,
&
buf
->
vb
.
dma
);
videobuf_dma_free
(
&
buf
->
vb
.
dma
);
videobuf_dma_unmap
(
vq
,
dma
);
videobuf_dma_free
(
dma
);
buf
->
vb
.
state
=
STATE_NEEDS_INIT
;
}
...
...
@@ -626,7 +634,7 @@ buffer_prepare(struct videobuf_queue *vq, struct videobuf_buffer *vb,
struct
vivi_buffer
*
buf
=
container_of
(
vb
,
struct
vivi_buffer
,
vb
);
int
rc
,
init_buffer
=
0
;
//
dprintk(1,"%s, field=%d\n",__FUNCTION__,field);
dprintk
(
1
,
"%s, field=%d
\n
"
,
__FUNCTION__
,
field
);
BUG_ON
(
NULL
==
fh
->
fmt
);
if
(
fh
->
width
<
48
||
fh
->
width
>
norm_maxw
()
||
...
...
@@ -724,11 +732,6 @@ static struct videobuf_queue_ops vivi_video_qops = {
.
buf_prepare
=
buffer_prepare
,
.
buf_queue
=
buffer_queue
,
.
buf_release
=
buffer_release
,
/* Non-pci handling routines */
// .vb_map_sg = vivi_map_sg,
// .vb_dma_sync_sg = vivi_dma_sync_sg,
// .vb_unmap_sg = vivi_unmap_sg,
};
/* ------------------------------------------------------------------
...
...
@@ -904,25 +907,8 @@ static int vidioc_dqbuf (struct file *file, void *priv, struct v4l2_buffer *p)
static
int
vidiocgmbuf
(
struct
file
*
file
,
void
*
priv
,
struct
video_mbuf
*
mbuf
)
{
struct
vivi_fh
*
fh
=
priv
;
struct
videobuf_queue
*
q
=&
fh
->
vb_vidq
;
struct
v4l2_requestbuffers
req
;
unsigned
int
i
;
int
ret
;
req
.
type
=
q
->
type
;
req
.
count
=
8
;
req
.
memory
=
V4L2_MEMORY_MMAP
;
ret
=
videobuf_reqbufs
(
q
,
&
req
);
if
(
ret
<
0
)
return
(
ret
);
mbuf
->
frames
=
req
.
count
;
mbuf
->
size
=
0
;
for
(
i
=
0
;
i
<
mbuf
->
frames
;
i
++
)
{
mbuf
->
offsets
[
i
]
=
q
->
bufs
[
i
]
->
boff
;
mbuf
->
size
+=
q
->
bufs
[
i
]
->
bsize
;
}
return
(
0
);
return
videobuf_cgmbuf
(
&
fh
->
vb_vidq
,
mbuf
,
8
);
}
#endif
...
...
@@ -1106,12 +1092,13 @@ static int vivi_open(struct inode *inode, struct file *file)
sprintf
(
dev
->
timestr
,
"%02d:%02d:%02d:%03d"
,
dev
->
h
,
dev
->
m
,
dev
->
s
,(
dev
->
us
+
500
)
/
1000
);
videobuf_queue_init
(
&
fh
->
vb_vidq
,
&
vivi_video_qops
,
videobuf_queue_
pci_
init
(
&
fh
->
vb_vidq
,
&
vivi_video_qops
,
NULL
,
NULL
,
fh
->
type
,
V4L2_FIELD_INTERLACED
,
sizeof
(
struct
vivi_buffer
),
fh
);
return
0
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录