diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2009-09-14 11:50:26 -0400 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2009-09-17 17:43:29 -0400 |
commit | e67b8ce1b59006ba41245838db60b6fcda365ba8 (patch) | |
tree | ea28aac9dc6468cf3fe2d76d045ce86c0a4baa97 /drivers/gpu | |
parent | 4960aaca14010b9ff92e5726dd178cbd6805d412 (diff) |
drm/i915: Remove stored gtt_alignment
There is no need to store the gtt_alignment as it is either explicitly
set according to the hardware requirements (e.g. scanout) or the
minimum alignment is computed on demand.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/i915/i915_drv.h | 5 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem.c | 14 |
2 files changed, 3 insertions, 16 deletions
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index a9c671529885..07214694b14f 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h | |||
@@ -510,10 +510,7 @@ struct drm_i915_gem_object { | |||
510 | * This is the same as gtt_space->start | 510 | * This is the same as gtt_space->start |
511 | */ | 511 | */ |
512 | uint32_t gtt_offset; | 512 | uint32_t gtt_offset; |
513 | /** | 513 | |
514 | * Required alignment for the object | ||
515 | */ | ||
516 | uint32_t gtt_alignment; | ||
517 | /** | 514 | /** |
518 | * Fake offset for use by mmap(2) | 515 | * Fake offset for use by mmap(2) |
519 | */ | 516 | */ |
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 441088b37d9f..77cc6f57166c 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c | |||
@@ -1155,7 +1155,7 @@ int i915_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf) | |||
1155 | /* Now bind it into the GTT if needed */ | 1155 | /* Now bind it into the GTT if needed */ |
1156 | mutex_lock(&dev->struct_mutex); | 1156 | mutex_lock(&dev->struct_mutex); |
1157 | if (!obj_priv->gtt_space) { | 1157 | if (!obj_priv->gtt_space) { |
1158 | ret = i915_gem_object_bind_to_gtt(obj, obj_priv->gtt_alignment); | 1158 | ret = i915_gem_object_bind_to_gtt(obj, 0); |
1159 | if (ret) { | 1159 | if (ret) { |
1160 | mutex_unlock(&dev->struct_mutex); | 1160 | mutex_unlock(&dev->struct_mutex); |
1161 | return VM_FAULT_SIGBUS; | 1161 | return VM_FAULT_SIGBUS; |
@@ -1398,22 +1398,12 @@ i915_gem_mmap_gtt_ioctl(struct drm_device *dev, void *data, | |||
1398 | 1398 | ||
1399 | args->offset = obj_priv->mmap_offset; | 1399 | args->offset = obj_priv->mmap_offset; |
1400 | 1400 | ||
1401 | obj_priv->gtt_alignment = i915_gem_get_gtt_alignment(obj); | ||
1402 | |||
1403 | /* Make sure the alignment is correct for fence regs etc */ | ||
1404 | if (obj_priv->agp_mem && | ||
1405 | (obj_priv->gtt_offset & (obj_priv->gtt_alignment - 1))) { | ||
1406 | drm_gem_object_unreference(obj); | ||
1407 | mutex_unlock(&dev->struct_mutex); | ||
1408 | return -EINVAL; | ||
1409 | } | ||
1410 | |||
1411 | /* | 1401 | /* |
1412 | * Pull it into the GTT so that we have a page list (makes the | 1402 | * Pull it into the GTT so that we have a page list (makes the |
1413 | * initial fault faster and any subsequent flushing possible). | 1403 | * initial fault faster and any subsequent flushing possible). |
1414 | */ | 1404 | */ |
1415 | if (!obj_priv->agp_mem) { | 1405 | if (!obj_priv->agp_mem) { |
1416 | ret = i915_gem_object_bind_to_gtt(obj, obj_priv->gtt_alignment); | 1406 | ret = i915_gem_object_bind_to_gtt(obj, 0); |
1417 | if (ret) { | 1407 | if (ret) { |
1418 | drm_gem_object_unreference(obj); | 1408 | drm_gem_object_unreference(obj); |
1419 | mutex_unlock(&dev->struct_mutex); | 1409 | mutex_unlock(&dev->struct_mutex); |