linux-4.4.1/vb2_dc_map_dmabuf()
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
*参照元 [#oa09b28d]
#backlinks
*説明 [#wa99c8f4]
-パス: [[linux-4.4.1/drivers/media/v4l2-core/videobuf2-dm...
-FIXME: これは何?
--説明
**引数 [#o73f0d74]
-void *mem_priv
--
**返り値 [#y016afee]
-int
--
**参考 [#p33f815a]
*実装 [#vd4c7cb9]
static int vb2_dc_map_dmabuf(void *mem_priv)
{
struct vb2_dc_buf *buf = mem_priv;
struct sg_table *sgt;
unsigned long contig_size;
-
--[[linux-4.4.1/vb2_dc_buf]]
--[[linux-4.4.1/sg_table()]]
if (WARN_ON(!buf->db_attach)) {
pr_err("trying to pin a non attached buf...
return -EINVAL;
}
if (WARN_ON(buf->dma_sgt)) {
pr_err("dmabuf buffer is already pinned\...
return 0;
}
-
--[[linux-4.4.1/WARN_ON()]]
--[[linux-4.4.1/pr_err()]]
/* get the associated scatterlist for this buffe...
sgt = dma_buf_map_attachment(buf->db_attach, buf...
if (IS_ERR(sgt)) {
pr_err("Error getting dmabuf scatterlist...
return -EINVAL;
}
-
--[[linux-4.4.1/dma_buf_map_attachment()]]
/* checking if dmabuf is big enough to store con...
contig_size = vb2_dc_get_contiguous_size(sgt);
if (contig_size < buf->size) {
pr_err("contiguous chunk is too small %l...
contig_size, buf->size);
dma_buf_unmap_attachment(buf->db_attach,...
return -EFAULT;
}
-
--[[linux-4.4.1/vb2_dc_get_contiguous_size()]]
--[[linux-4.4.1/dma_buf_unmap_attachment()]]
buf->dma_addr = sg_dma_address(sgt->sgl);
buf->dma_sgt = sgt;
buf->vaddr = NULL;
-
--[[linux-4.4.1/sg_dma_address()]]
return 0;
}
*コメント [#df44be5a]
終了行:
*参照元 [#oa09b28d]
#backlinks
*説明 [#wa99c8f4]
-パス: [[linux-4.4.1/drivers/media/v4l2-core/videobuf2-dm...
-FIXME: これは何?
--説明
**引数 [#o73f0d74]
-void *mem_priv
--
**返り値 [#y016afee]
-int
--
**参考 [#p33f815a]
*実装 [#vd4c7cb9]
static int vb2_dc_map_dmabuf(void *mem_priv)
{
struct vb2_dc_buf *buf = mem_priv;
struct sg_table *sgt;
unsigned long contig_size;
-
--[[linux-4.4.1/vb2_dc_buf]]
--[[linux-4.4.1/sg_table()]]
if (WARN_ON(!buf->db_attach)) {
pr_err("trying to pin a non attached buf...
return -EINVAL;
}
if (WARN_ON(buf->dma_sgt)) {
pr_err("dmabuf buffer is already pinned\...
return 0;
}
-
--[[linux-4.4.1/WARN_ON()]]
--[[linux-4.4.1/pr_err()]]
/* get the associated scatterlist for this buffe...
sgt = dma_buf_map_attachment(buf->db_attach, buf...
if (IS_ERR(sgt)) {
pr_err("Error getting dmabuf scatterlist...
return -EINVAL;
}
-
--[[linux-4.4.1/dma_buf_map_attachment()]]
/* checking if dmabuf is big enough to store con...
contig_size = vb2_dc_get_contiguous_size(sgt);
if (contig_size < buf->size) {
pr_err("contiguous chunk is too small %l...
contig_size, buf->size);
dma_buf_unmap_attachment(buf->db_attach,...
return -EFAULT;
}
-
--[[linux-4.4.1/vb2_dc_get_contiguous_size()]]
--[[linux-4.4.1/dma_buf_unmap_attachment()]]
buf->dma_addr = sg_dma_address(sgt->sgl);
buf->dma_sgt = sgt;
buf->vaddr = NULL;
-
--[[linux-4.4.1/sg_dma_address()]]
return 0;
}
*コメント [#df44be5a]
ページ名: