diff options
author | Sumit Semwal <sumit.semwal@linaro.org> | 2015-01-23 02:23:43 -0500 |
---|---|---|
committer | Sumit Semwal <sumit.semwal@linaro.org> | 2015-04-21 05:17:16 -0400 |
commit | d8fbe341beb617ebb22b98fb893e4aa32ae2d864 (patch) | |
tree | 2e19c951d2b6ffef2319d87ec8a6c39e4e1ab8ee /drivers/gpu/drm/armada | |
parent | 646da63172f660ba84f195c1165360a9b73583ee (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/armada')
-rw-r--r-- | drivers/gpu/drm/armada/armada_gem.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/gpu/drm/armada/armada_gem.c b/drivers/gpu/drm/armada/armada_gem.c index ef5feeecec84..580e10acaa3a 100644 --- a/drivers/gpu/drm/armada/armada_gem.c +++ b/drivers/gpu/drm/armada/armada_gem.c | |||
@@ -538,8 +538,14 @@ struct dma_buf * | |||
538 | armada_gem_prime_export(struct drm_device *dev, struct drm_gem_object *obj, | 538 | armada_gem_prime_export(struct drm_device *dev, struct drm_gem_object *obj, |
539 | int flags) | 539 | int flags) |
540 | { | 540 | { |
541 | return dma_buf_export(obj, &armada_gem_prime_dmabuf_ops, obj->size, | 541 | DEFINE_DMA_BUF_EXPORT_INFO(exp_info); |
542 | O_RDWR, NULL); | 542 | |
543 | exp_info.ops = &armada_gem_prime_dmabuf_ops; | ||
544 | exp_info.size = obj->size; | ||
545 | exp_info.flags = O_RDWR; | ||
546 | exp_info.priv = obj; | ||
547 | |||
548 | return dma_buf_export(&exp_info); | ||
543 | } | 549 | } |
544 | 550 | ||
545 | struct drm_gem_object * | 551 | struct drm_gem_object * |