aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/ttm/ttm_object.c
diff options
context:
space:
mode:
authorSumit Semwal <sumit.semwal@linaro.org>2015-01-23 02:23:43 -0500
committerSumit Semwal <sumit.semwal@linaro.org>2015-04-21 05:17:16 -0400
commitd8fbe341beb617ebb22b98fb893e4aa32ae2d864 (patch)
tree2e19c951d2b6ffef2319d87ec8a6c39e4e1ab8ee /drivers/gpu/drm/ttm/ttm_object.c
parent646da63172f660ba84f195c1165360a9b73583ee (diff)
dma-buf: cleanup dma_buf_export() to make it easily extensible
At present, dma_buf_export() takes a series of parameters, which makes it difficult to add any new parameters for exporters, if required. Make it simpler by moving all these parameters into a struct, and pass the struct * as parameter to dma_buf_export(). While at it, unite dma_buf_export_named() with dma_buf_export(), and change all callers accordingly. Reviewed-by: Maarten Lankhorst <maarten.lankhorst@canonical.com> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Acked-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> Acked-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
Diffstat (limited to 'drivers/gpu/drm/ttm/ttm_object.c')
-rw-r--r--drivers/gpu/drm/ttm/ttm_object.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_object.c b/drivers/gpu/drm/ttm/ttm_object.c
index 12c87110db3a..4f5fa8d65fe9 100644
--- a/drivers/gpu/drm/ttm/ttm_object.c
+++ b/drivers/gpu/drm/ttm/ttm_object.c
@@ -683,6 +683,12 @@ int ttm_prime_handle_to_fd(struct ttm_object_file *tfile,
683 683
684 dma_buf = prime->dma_buf; 684 dma_buf = prime->dma_buf;
685 if (!dma_buf || !get_dma_buf_unless_doomed(dma_buf)) { 685 if (!dma_buf || !get_dma_buf_unless_doomed(dma_buf)) {
686 DEFINE_DMA_BUF_EXPORT_INFO(exp_info);
687
688 exp_info.ops = &tdev->ops;
689 exp_info.size = prime->size;
690 exp_info.flags = flags;
691 exp_info.priv = prime;
686 692
687 /* 693 /*
688 * Need to create a new dma_buf, with memory accounting. 694 * Need to create a new dma_buf, with memory accounting.
@@ -694,8 +700,7 @@ int ttm_prime_handle_to_fd(struct ttm_object_file *tfile,
694 goto out_unref; 700 goto out_unref;
695 } 701 }
696 702
697 dma_buf = dma_buf_export(prime, &tdev->ops, 703 dma_buf = dma_buf_export(&exp_info);
698 prime->size, flags, NULL);
699 if (IS_ERR(dma_buf)) { 704 if (IS_ERR(dma_buf)) {
700 ret = PTR_ERR(dma_buf); 705 ret = PTR_ERR(dma_buf);
701 ttm_mem_global_free(tdev->mem_glob, 706 ttm_mem_global_free(tdev->mem_glob,