summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorRahool Paliwal <rpaliwal@nvidia.com>2013-12-09 18:07:05 +0530
committerMatthew Pedro <mapedro@nvidia.com>2014-01-24 12:09:33 -0800
commitd283f029d9b971f93f6f4b0e62d3cacb2571a204 (patch)
tree5349c0e23b5d83dbb3b77348bf4fa996d2846b76 /drivers
parent95c7d5a8c9fc4c4d6326d608723237ed197b893a (diff)
media: nvmap: Allow access to videobuf2-dma-nvmap
Allow the "user" nvmap client to access the nvmap memory handle of "videobuf2-dma-nvmap" client. Bug 1421388 Change-Id: Id7a28c06214508d807098a6b258345023192a601 Signed-off-by: Rahool Paliwal <rpaliwal@nvidia.com> Reviewed-on: http://git-master/r/344620 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Matthew Pedro <mapedro@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/video/tegra/nvmap/nvmap_handle.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/video/tegra/nvmap/nvmap_handle.c b/drivers/video/tegra/nvmap/nvmap_handle.c
index 4b7760b22190..1c5e61ccd45d 100644
--- a/drivers/video/tegra/nvmap/nvmap_handle.c
+++ b/drivers/video/tegra/nvmap/nvmap_handle.c
@@ -3,7 +3,7 @@
*
* Handle allocation and freeing routines for nvmap
*
- * Copyright (c) 2009-2012, NVIDIA CORPORATION. All rights reserved.
+ * Copyright (c) 2009-2014, NVIDIA CORPORATION. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -988,6 +988,15 @@ struct nvmap_handle_ref *nvmap_duplicate_handle_id(struct nvmap_client *client,
BUG_ON(!client || client->dev != nvmap_dev);
/* on success, the reference count for the handle should be
* incremented, so the success paths will not call nvmap_handle_put */
+
+ /* Allow the handle to be accessed by other (non-owner)
+ clients only if the owner is "videobuf2-dma-nvmap
+ which is a V4L2 capture kernel module. This handle can
+ be accessed by the "user" client for rendering/encoding */
+ if (!strcmp(((struct nvmap_handle *)id)->owner->name,
+ "videobuf2-dma-nvmap"))
+ client = ((struct nvmap_handle *)id)->owner;
+
h = nvmap_validate_get(client, id);
if (!h) {