summaryrefslogtreecommitdiff
path: root/drivers/video/tegra/nvmap/nvmap_ioctl.c
diff options
context:
space:
mode:
authorAlex Waterman <alexw@nvidia.com>2012-08-01 11:02:30 -0700
committerSimone Willett <swillett@nvidia.com>2012-08-15 12:49:57 -0700
commitce2daefbdf5eeb371e1aae15e6dc1928e2c1c627 (patch)
treebf5bcad37a081b9bfbb20cdfc64f93522eebc194 /drivers/video/tegra/nvmap/nvmap_ioctl.c
parent18156565232996364bbeef583db5fee07940ca7d (diff)
video: tegra: nvmap: Add support for zeroed pages
Add support to alloc zeroed pages for user space alloc requests. Also define a config option to force userspace allocation requests to be zeroed. Change-Id: I75d3b2bc36e808f1470b423578ec4cba99e0f967 Signed-off-by: Alex Waterman <alexw@nvidia.com> Reviewed-on: http://git-master/r/122549 Reviewed-by: Simone Willett <swillett@nvidia.com> Tested-by: Simone Willett <swillett@nvidia.com>
Diffstat (limited to 'drivers/video/tegra/nvmap/nvmap_ioctl.c')
-rw-r--r--drivers/video/tegra/nvmap/nvmap_ioctl.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/video/tegra/nvmap/nvmap_ioctl.c b/drivers/video/tegra/nvmap/nvmap_ioctl.c
index 5bfbbf60f8ff..bb15699ad855 100644
--- a/drivers/video/tegra/nvmap/nvmap_ioctl.c
+++ b/drivers/video/tegra/nvmap/nvmap_ioctl.c
@@ -3,7 +3,7 @@
*
* User-space interface to nvmap
*
- * Copyright (c) 2011, NVIDIA Corporation.
+ * Copyright (c) 2011-2012, 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
@@ -175,6 +175,9 @@ int nvmap_ioctl_alloc(struct file *filp, void __user *arg)
/* user-space handles are aligned to page boundaries, to prevent
* data leakage. */
op.align = max_t(size_t, op.align, PAGE_SIZE);
+#if defined(CONFIG_NVMAP_FORCE_ZEROED_USER_PAGES)
+ op.flags |= NVMAP_HANDLE_ZEROED_PAGES;
+#endif
return nvmap_alloc_handle_id(client, op.handle, op.heap_mask,
op.align, op.flags);