@@ -3040,7 +3040,7 @@ static struct drm_driver driver = {
.gem_prime_import = i915_gem_prime_import,
.dumb_create = i915_gem_dumb_create,
- .dumb_map_offset = i915_gem_mmap_gtt,
+ .dumb_map_offset = i915_gem_mmap_dumb,
.ioctls = i915_ioctls,
.num_ioctls = ARRAY_SIZE(i915_ioctls),
.fops = &i915_driver_fops,
@@ -3030,7 +3030,7 @@ i915_mutex_lock_interruptible(struct drm_device *dev)
int i915_gem_dumb_create(struct drm_file *file_priv,
struct drm_device *dev,
struct drm_mode_create_dumb *args);
-int i915_gem_mmap_gtt(struct drm_file *file_priv, struct drm_device *dev,
+int i915_gem_mmap_dumb(struct drm_file *file_priv, struct drm_device *dev,
u32 handle, u64 *offset);
int i915_gem_mmap_gtt_version(void);
@@ -2157,12 +2157,16 @@ __assign_gem_object_mmap_data(struct drm_file *file,
}
int
-i915_gem_mmap_gtt(struct drm_file *file,
+i915_gem_mmap_dumb(struct drm_file *file,
struct drm_device *dev,
u32 handle,
u64 *offset)
{
- return __assign_gem_object_mmap_data(file, handle, I915_MMAP_ORIGIN_GTT,
+ struct drm_i915_private *i915 = dev->dev_private;
+ enum i915_cpu_mmap_origin_type mmap_type = HAS_MAPPABLE_APERTURE(i915) ?
+ I915_MMAP_ORIGIN_GTT : I915_MMAP_ORIGIN_DUMB;
+
+ return __assign_gem_object_mmap_data(file, handle, mmap_type,
0, offset);
}
@@ -90,6 +90,7 @@ enum i915_cpu_mmap_origin_type {
I915_MMAP_ORIGIN_NONE = 0,
I915_MMAP_ORIGIN_GTT,
I915_MMAP_ORIGIN_OFFSET,
+ I915_MMAP_ORIGIN_DUMB,
};
struct drm_i915_gem_object {