@@ -1714,6 +1714,12 @@ struct drm_i915_gem_object {
unsigned int has_global_gtt_mapping:1;
unsigned int has_dma_mapping:1;
+ /*
+ * Is the object not required to be accessed from CPU
+ */
+ unsigned int cpu_map_not_needed:1;
+
+
struct sg_table *pages;
int pages_pin_count;
@@ -224,7 +224,9 @@ static int
i915_gem_create(struct drm_file *file,
struct drm_device *dev,
uint64_t size,
- uint32_t *handle_p)
+ uint32_t *handle_p,
+ uint32_t flags)
+
{
struct drm_i915_gem_object *obj;
int ret;
@@ -245,6 +247,10 @@ i915_gem_create(struct drm_file *file,
if (ret)
return ret;
+ if (flags & I915_CPU_MAP_NOT_NEEDED)
+ obj->cpu_map_not_needed = 1;
+
+
*handle_p = handle;
return 0;
}
@@ -258,7 +264,7 @@ i915_gem_dumb_create(struct drm_file *file,
args->pitch = ALIGN(args->width * DIV_ROUND_UP(args->bpp, 8), 64);
args->size = args->pitch * args->height;
return i915_gem_create(file, dev,
- args->size, &args->handle);
+ args->size, &args->handle, args->flags);
}
/**
@@ -271,7 +277,7 @@ i915_gem_create_ioctl(struct drm_device *dev, void *data,
struct drm_i915_gem_create *args = data;
return i915_gem_create(file, dev,
- args->size, &args->handle);
+ args->size, &args->handle, args->flags);
}
static inline int
@@ -431,7 +431,8 @@ struct drm_i915_gem_create {
* Object handles are nonzero.
*/
__u32 handle;
- __u32 pad;
+ __u32 flags;
+#define I915_CPU_MAP_NOT_NEEDED 0x1
};
struct drm_i915_gem_pread {