diff options
author | Alex Waterman <alexw@nvidia.com> | 2012-08-01 11:02:30 -0700 |
---|---|---|
committer | Simone Willett <swillett@nvidia.com> | 2012-08-15 12:49:57 -0700 |
commit | ce2daefbdf5eeb371e1aae15e6dc1928e2c1c627 (patch) | |
tree | bf5bcad37a081b9bfbb20cdfc64f93522eebc194 /drivers/video/tegra/nvmap/nvmap_ioctl.c | |
parent | 18156565232996364bbeef583db5fee07940ca7d (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.c | 5 |
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); |