linux-4.4.1/ion_share_dma_buf()
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
*参照元 [#e628a0be]
#backlinks
*説明 [#l07da499]
-パス: [[linux-4.4.1/drivers/staging/android/ion/ion.c]]
-FIXME: これは何?
--説明
**引数 [#ida10d69]
-struct ion_client *client
--
--[[linux-4.4.1/ion_client]]
-struct ion_handle *handle
--
--[[linux-4.4.1/ion_handle]]
**返り値 [#jf9a3a27]
-struct dma_buf *
--
--[[linux-4.4.1/dma_buf]]
**参考 [#s3350c1d]
*実装 [#pddb7a9b]
struct dma_buf *ion_share_dma_buf(struct ion_client *cli...
struct i...
{
DEFINE_DMA_BUF_EXPORT_INFO(exp_info);
struct ion_buffer *buffer;
struct dma_buf *dmabuf;
bool valid_handle;
-
--[[linux-4.4.1/DEFINE_DMA_BUF_EXPORT_INFO()]]
--[[linux-4.4.1/ion_buffer]]
--[[linux-4.4.1/dma_buf]]
mutex_lock(&client->lock);
valid_handle = ion_handle_validate(client, handl...
if (!valid_handle) {
WARN(1, "%s: invalid handle passed to sh...
mutex_unlock(&client->lock);
return ERR_PTR(-EINVAL);
}
buffer = handle->buffer;
ion_buffer_get(buffer);
mutex_unlock(&client->lock);
-
--[[linux-4.4.1/mutex_lock()]]
--[[linux-4.4.1/ion_handle_validate()]]
--[[linux-4.4.1/WARN()]]
--[[linux-4.4.1/ERR_PTR()]]
--[[linux-4.4.1/ion_buffer_get()]]
--[[linux-4.4.1/mutex_unlock()]]
exp_info.ops = &dma_buf_ops;
exp_info.size = buffer->size;
exp_info.flags = O_RDWR;
exp_info.priv = buffer;
-
--[[linux-4.4.1/dma_buf_ops(global)]]
dmabuf = dma_buf_export(&exp_info);
if (IS_ERR(dmabuf)) {
ion_buffer_put(buffer);
return dmabuf;
}
-
--[[linux-4.4.1/dma_buf_export()]]
--[[linux-4.4.1/ion_buffer_put()]]
return dmabuf;
}
EXPORT_SYMBOL(ion_share_dma_buf);
-
--[[linux-4.4.1/EXPORT_SYMBOL()]]
*コメント [#d483e450]
終了行:
*参照元 [#e628a0be]
#backlinks
*説明 [#l07da499]
-パス: [[linux-4.4.1/drivers/staging/android/ion/ion.c]]
-FIXME: これは何?
--説明
**引数 [#ida10d69]
-struct ion_client *client
--
--[[linux-4.4.1/ion_client]]
-struct ion_handle *handle
--
--[[linux-4.4.1/ion_handle]]
**返り値 [#jf9a3a27]
-struct dma_buf *
--
--[[linux-4.4.1/dma_buf]]
**参考 [#s3350c1d]
*実装 [#pddb7a9b]
struct dma_buf *ion_share_dma_buf(struct ion_client *cli...
struct i...
{
DEFINE_DMA_BUF_EXPORT_INFO(exp_info);
struct ion_buffer *buffer;
struct dma_buf *dmabuf;
bool valid_handle;
-
--[[linux-4.4.1/DEFINE_DMA_BUF_EXPORT_INFO()]]
--[[linux-4.4.1/ion_buffer]]
--[[linux-4.4.1/dma_buf]]
mutex_lock(&client->lock);
valid_handle = ion_handle_validate(client, handl...
if (!valid_handle) {
WARN(1, "%s: invalid handle passed to sh...
mutex_unlock(&client->lock);
return ERR_PTR(-EINVAL);
}
buffer = handle->buffer;
ion_buffer_get(buffer);
mutex_unlock(&client->lock);
-
--[[linux-4.4.1/mutex_lock()]]
--[[linux-4.4.1/ion_handle_validate()]]
--[[linux-4.4.1/WARN()]]
--[[linux-4.4.1/ERR_PTR()]]
--[[linux-4.4.1/ion_buffer_get()]]
--[[linux-4.4.1/mutex_unlock()]]
exp_info.ops = &dma_buf_ops;
exp_info.size = buffer->size;
exp_info.flags = O_RDWR;
exp_info.priv = buffer;
-
--[[linux-4.4.1/dma_buf_ops(global)]]
dmabuf = dma_buf_export(&exp_info);
if (IS_ERR(dmabuf)) {
ion_buffer_put(buffer);
return dmabuf;
}
-
--[[linux-4.4.1/dma_buf_export()]]
--[[linux-4.4.1/ion_buffer_put()]]
return dmabuf;
}
EXPORT_SYMBOL(ion_share_dma_buf);
-
--[[linux-4.4.1/EXPORT_SYMBOL()]]
*コメント [#d483e450]
ページ名: