summaryrefslogtreecommitdiff
path: root/drivers/video/tegra/nvmap/nvmap.c
diff options
context:
space:
mode:
authorMarcel Ziswiler <marcel.ziswiler@toradex.com>2015-01-16 03:15:03 +0100
committerMarcel Ziswiler <marcel.ziswiler@toradex.com>2015-01-16 10:42:08 +0100
commit4e87f2dd9bc258c85b2f3bb1a100b49927fbe6f3 (patch)
tree96c82edf20e2c28e8fc4d97438d00e3b18b8afe9 /drivers/video/tegra/nvmap/nvmap.c
parentfe4c58c4b96a24aba8e27956e8158b3002723b17 (diff)
parentc7460e0d6afd754ebf5555477129579bc83c47b9 (diff)
Merge remote-tracking branch 'remotes/nvidia/l4t/l4t-r16-r2' into tegra-next
(tegra-l4t-r16-16.5) Conflicts: drivers/media/video/tegra_v4l2_camera.c drivers/mmc/host/sdhci.c drivers/watchdog/tegra_wdt.c include/media/tegra_v4l2_camera.h
Diffstat (limited to 'drivers/video/tegra/nvmap/nvmap.c')
-rw-r--r--drivers/video/tegra/nvmap/nvmap.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/drivers/video/tegra/nvmap/nvmap.c b/drivers/video/tegra/nvmap/nvmap.c
index e66ca982f2f3..3329153b2c1b 100644
--- a/drivers/video/tegra/nvmap/nvmap.c
+++ b/drivers/video/tegra/nvmap/nvmap.c
@@ -3,7 +3,7 @@
*
* Memory manager for Tegra GPU
*
- * Copyright (c) 2009-2012, NVIDIA Corporation.
+ * 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
@@ -366,7 +366,6 @@ phys_addr_t nvmap_pin(struct nvmap_client *client,
h = nvmap_handle_get(ref->handle);
if (WARN_ON(!h))
return -EINVAL;
-
atomic_inc(&ref->pin);
if (WARN_ON(mutex_lock_interruptible(&client->share->pin_lock))) {
@@ -384,7 +383,6 @@ phys_addr_t nvmap_pin(struct nvmap_client *client,
map_iovmm_area(h);
phys = handle_phys(h);
}
-
return ret ?: phys;
}
EXPORT_SYMBOL(nvmap_pin);
@@ -624,3 +622,15 @@ int nvmap_mark_global(struct nvmap_client *client, struct nvmap_handle_ref *r)
return 0;
}
+
+unsigned long nvmap_validate_ref(struct nvmap_client *client,
+ struct nvmap_handle_ref *r)
+{
+ struct nvmap_handle_ref *ref;
+ unsigned long id = nvmap_ref_to_id(r);
+
+ nvmap_ref_lock(client);
+ ref = _nvmap_validate_id_locked(client, id);
+ nvmap_ref_unlock(client);
+ return (unsigned long)ref;
+}