summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2015-12-14 22:39:36 +0200
committerTomi Valkeinen <tomi.valkeinen@ti.com>2015-12-31 11:25:44 +0200
commitef3f4e998240c33a9a424d5c1dbb045f2b919d43 (patch)
tree7ea0d298d822411f93ee56540a32c8f5febda2cb /drivers
parentf4302747af0275813922a9fd24e1718bae2f1142 (diff)
downloadtalos-op-linux-ef3f4e998240c33a9a424d5c1dbb045f2b919d43.tar.gz
talos-op-linux-ef3f4e998240c33a9a424d5c1dbb045f2b919d43.zip
drm: omapdrm: gem: Mask out private flags passed from userspace
The 8 high order bits of the buffer flags are reserved for internal use. Mask them out from the flags passed by userspace. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/omapdrm/omap_drv.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c
index 1e80b0243f9c..cc7905566228 100644
--- a/drivers/gpu/drm/omapdrm/omap_drv.c
+++ b/drivers/gpu/drm/omapdrm/omap_drv.c
@@ -547,14 +547,19 @@ static int ioctl_set_param(struct drm_device *dev, void *data,
return 0;
}
+#define OMAP_BO_USER_MASK 0x00ffffff /* flags settable by userspace */
+
static int ioctl_gem_new(struct drm_device *dev, void *data,
struct drm_file *file_priv)
{
struct drm_omap_gem_new *args = data;
+ u32 flags = args->flags & OMAP_BO_USER_MASK;
+
VERB("%p:%p: size=0x%08x, flags=%08x", dev, file_priv,
- args->size.bytes, args->flags);
- return omap_gem_new_handle(dev, file_priv, args->size,
- args->flags, &args->handle);
+ args->size.bytes, flags);
+
+ return omap_gem_new_handle(dev, file_priv, args->size, flags,
+ &args->handle);
}
static int ioctl_gem_cpu_prep(struct drm_device *dev, void *data,
OpenPOWER on IntegriCloud