On Tue, Jan 26, 2016 at 01:13:31AM +0530, ankitprasad.r.sharma@xxxxxxxxx wrote: > static int > i915_gem_create(struct drm_file *file, > struct drm_device *dev, > uint64_t size, > + uint64_t flags, > uint32_t *handle_p) > { > struct drm_i915_gem_object *obj; > int ret; > u32 handle; > + u32 placement = flags & I915_CREATE_PLACEMENT_MASK; > > size = roundup(size, PAGE_SIZE); > if (size == 0) > return -EINVAL; > > + if (flags & __I915_CREATE_UNKNOWN_FLAGS) > + return -EINVAL; > + > /* Allocate the new object */ > - obj = i915_gem_alloc_object(dev, size); > + switch (placement) { switch (flags & I915_CREATE_PLACEMENT_MASK) { is just as descriptive as switch(placement) and we don't use the placement variable anywhere else. > + case I915_CREATE_PLACEMENT_NORMAL: > + obj = i915_gem_alloc_object(dev, size); > + break; > + case I915_CREATE_PLACEMENT_STOLEN: > + obj = i915_gem_alloc_object_stolen(dev, size); > + break; > + default: > + return -EINVAL; > + } > + > if (obj == NULL) > return -ENOMEM; -- Chris Wilson, Intel Open Source Technology Centre _______________________________________________ Intel-gfx mailing list Intel-gfx@xxxxxxxxxxxxxxxxxxxxx http://lists.freedesktop.org/mailman/listinfo/intel-gfx