diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2011-03-01 10:24:41 -0500 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2011-03-01 11:01:02 -0500 |
commit | 271d81b84171d84723357ae6d172ec16b0d8139c (patch) | |
tree | ca4d1952f3e47e69706be5609143ae4d1b8e291a | |
parent | 5d9faa16a73f3317177ec42d5b5d826947458eb9 (diff) |
drm/i915: Allow relocation deltas outside of target bo
Userspace has a legitimate requirement to use a delta that points to
outside of the target bo, and so we need to enable this. (As this is an
abi break, albeit a relaxation of the current restrictions, mark the change
with a new flag.)
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | drivers/gpu/drm/i915/i915_dma.c | 3 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem_execbuffer.c | 10 | ||||
-rw-r--r-- | include/drm/i915_drm.h | 1 |
3 files changed, 4 insertions, 10 deletions
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c index ffa2196eb3b9..51150692af2d 100644 --- a/drivers/gpu/drm/i915/i915_dma.c +++ b/drivers/gpu/drm/i915/i915_dma.c | |||
@@ -772,6 +772,9 @@ static int i915_getparam(struct drm_device *dev, void *data, | |||
772 | case I915_PARAM_HAS_EXEC_CONSTANTS: | 772 | case I915_PARAM_HAS_EXEC_CONSTANTS: |
773 | value = INTEL_INFO(dev)->gen >= 4; | 773 | value = INTEL_INFO(dev)->gen >= 4; |
774 | break; | 774 | break; |
775 | case I915_PARAM_HAS_RELAXED_DELTA: | ||
776 | value = 1; | ||
777 | break; | ||
775 | default: | 778 | default: |
776 | DRM_DEBUG_DRIVER("Unknown parameter %d\n", | 779 | DRM_DEBUG_DRIVER("Unknown parameter %d\n", |
777 | param->param); | 780 | param->param); |
diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c index 71a4a3b69158..1c3b76a8a6fb 100644 --- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c +++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c | |||
@@ -350,16 +350,6 @@ i915_gem_execbuffer_relocate_entry(struct drm_i915_gem_object *obj, | |||
350 | return ret; | 350 | return ret; |
351 | } | 351 | } |
352 | 352 | ||
353 | /* and points to somewhere within the target object. */ | ||
354 | if (unlikely(reloc->delta >= target_obj->size)) { | ||
355 | DRM_ERROR("Relocation beyond target object bounds: " | ||
356 | "obj %p target %d delta %d size %d.\n", | ||
357 | obj, reloc->target_handle, | ||
358 | (int) reloc->delta, | ||
359 | (int) target_obj->size); | ||
360 | return ret; | ||
361 | } | ||
362 | |||
363 | reloc->delta += target_offset; | 353 | reloc->delta += target_offset; |
364 | if (obj->base.write_domain == I915_GEM_DOMAIN_CPU) { | 354 | if (obj->base.write_domain == I915_GEM_DOMAIN_CPU) { |
365 | uint32_t page_offset = reloc->offset & ~PAGE_MASK; | 355 | uint32_t page_offset = reloc->offset & ~PAGE_MASK; |
diff --git a/include/drm/i915_drm.h b/include/drm/i915_drm.h index 0039f1f97ad8..c4d6dbfa3ff4 100644 --- a/include/drm/i915_drm.h +++ b/include/drm/i915_drm.h | |||
@@ -290,6 +290,7 @@ typedef struct drm_i915_irq_wait { | |||
290 | #define I915_PARAM_HAS_RELAXED_FENCING 12 | 290 | #define I915_PARAM_HAS_RELAXED_FENCING 12 |
291 | #define I915_PARAM_HAS_COHERENT_RINGS 13 | 291 | #define I915_PARAM_HAS_COHERENT_RINGS 13 |
292 | #define I915_PARAM_HAS_EXEC_CONSTANTS 14 | 292 | #define I915_PARAM_HAS_EXEC_CONSTANTS 14 |
293 | #define I915_PARAM_HAS_RELAXED_DELTA 15 | ||
293 | 294 | ||
294 | typedef struct drm_i915_getparam { | 295 | typedef struct drm_i915_getparam { |
295 | int param; | 296 | int param; |