linux-4.4.1/vb2_dc_dmabuf_ops_map()
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
*参照元 [#m3fff147]
#backlinks
*説明 [#m6254a45]
-パス: [[linux-4.4.1/drivers/media/v4l2-core/videobuf2-dm...
-FIXME: これは何?
--説明
**引数 [#t7f7ae62]
-struct dma_buf_attachment *db_attach
--
--[[linux-4.4.1/dma_buf_attachment]]
-enum dma_data_direction dma_dir
--
--[[linux-4.4.1/dma_data_direction]]
**返り値 [#d9e5acdb]
-struct sg_table *
--
--[[linux-4.4.1/sg_table]]
**参考 [#tc149c20]
*実装 [#z85554e8]
static struct sg_table *vb2_dc_dmabuf_ops_map(
struct dma_buf_attachment *db_attach, enum dma_d...
{
struct vb2_dc_attachment *attach = db_attach->pr...
/* stealing dmabuf mutex to serialize map/unmap ...
struct mutex *lock = &db_attach->dmabuf->lock;
struct sg_table *sgt;
-
--[[linux-4.4.1/vb2_dc_attachment]]
--[[linux-4.4.1/mutex]]
--[[linux-4.4.1/sg_table]]
mutex_lock(lock);
-
--[[linux-4.4.1/mutex_lock()]]
sgt = &attach->sgt;
/* return previously mapped sg table */
if (attach->dma_dir == dma_dir) {
mutex_unlock(lock);
return sgt;
}
-
--[[linux-4.4.1/mutex_unlock()]]
/* release any previous cache */
if (attach->dma_dir != DMA_NONE) {
dma_unmap_sg(db_attach->dev, sgt->sgl, s...
attach->dma_dir);
attach->dma_dir = DMA_NONE;
}
-
--[[linux-4.4.1/dma_unmap_sg()]]
/* mapping to the client with new direction */
sgt->nents = dma_map_sg(db_attach->dev, sgt->sgl...
dma_dir);
if (!sgt->nents) {
pr_err("failed to map scatterlist\n");
mutex_unlock(lock);
return ERR_PTR(-EIO);
}
-
--[[linux-4.4.1/dma_map_sg()]]
--[[linux-4.4.1/ERR_PTR()]]
attach->dma_dir = dma_dir;
mutex_unlock(lock);
return sgt;
}
*コメント [#be02b8da]
終了行:
*参照元 [#m3fff147]
#backlinks
*説明 [#m6254a45]
-パス: [[linux-4.4.1/drivers/media/v4l2-core/videobuf2-dm...
-FIXME: これは何?
--説明
**引数 [#t7f7ae62]
-struct dma_buf_attachment *db_attach
--
--[[linux-4.4.1/dma_buf_attachment]]
-enum dma_data_direction dma_dir
--
--[[linux-4.4.1/dma_data_direction]]
**返り値 [#d9e5acdb]
-struct sg_table *
--
--[[linux-4.4.1/sg_table]]
**参考 [#tc149c20]
*実装 [#z85554e8]
static struct sg_table *vb2_dc_dmabuf_ops_map(
struct dma_buf_attachment *db_attach, enum dma_d...
{
struct vb2_dc_attachment *attach = db_attach->pr...
/* stealing dmabuf mutex to serialize map/unmap ...
struct mutex *lock = &db_attach->dmabuf->lock;
struct sg_table *sgt;
-
--[[linux-4.4.1/vb2_dc_attachment]]
--[[linux-4.4.1/mutex]]
--[[linux-4.4.1/sg_table]]
mutex_lock(lock);
-
--[[linux-4.4.1/mutex_lock()]]
sgt = &attach->sgt;
/* return previously mapped sg table */
if (attach->dma_dir == dma_dir) {
mutex_unlock(lock);
return sgt;
}
-
--[[linux-4.4.1/mutex_unlock()]]
/* release any previous cache */
if (attach->dma_dir != DMA_NONE) {
dma_unmap_sg(db_attach->dev, sgt->sgl, s...
attach->dma_dir);
attach->dma_dir = DMA_NONE;
}
-
--[[linux-4.4.1/dma_unmap_sg()]]
/* mapping to the client with new direction */
sgt->nents = dma_map_sg(db_attach->dev, sgt->sgl...
dma_dir);
if (!sgt->nents) {
pr_err("failed to map scatterlist\n");
mutex_unlock(lock);
return ERR_PTR(-EIO);
}
-
--[[linux-4.4.1/dma_map_sg()]]
--[[linux-4.4.1/ERR_PTR()]]
attach->dma_dir = dma_dir;
mutex_unlock(lock);
return sgt;
}
*コメント [#be02b8da]
ページ名: