diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-09-26 08:47:30 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-10-12 04:59:09 -0400 |
commit | acb868d3d710b09a356d848e0cd44d9713a9e274 (patch) | |
tree | ace446247ba28f770c8be9493e8be7f16852dbf8 /drivers/gpu/drm/i915/i915_drv.h | |
parent | 26b6e44afb58432a5e998da0343757404f9de9ee (diff) |
drm/i915: Disallow preallocation of requests
The intention was to allow the caller to avoid a failure to queue a
request having already written commands to the ring. However, this is a
moot point as the i915_add_request() can fail for other reasons than a
mere allocation failure and those failure cases are more likely than
ENOMEM. So the overlay code already had to handle i915_add_request()
failures, and due to
commit 3bb73aba1ed5198a2c1dfaac4f3c95459930d84a
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Fri Jul 20 12:40:59 2012 +0100
drm/i915: Allow late allocation of request for i915_add_request()
the error handling code in intel_overlay.c was subject to causing
double-frees, as found by coverity.
Rather than further complicate i915_add_request() and callers, realise
the battle is lost and adapt intel_overlay.c to take advantage of the
late allocation of requests.
v2: Handle callers passing in a NULL seqno.
v3: Ditto. This time for sure.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_drv.h')
-rw-r--r-- | drivers/gpu/drm/i915/i915_drv.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 4f2831aa5fed..d5138c3a156b 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h | |||
@@ -1427,7 +1427,7 @@ int __must_check i915_gpu_idle(struct drm_device *dev); | |||
1427 | int __must_check i915_gem_idle(struct drm_device *dev); | 1427 | int __must_check i915_gem_idle(struct drm_device *dev); |
1428 | int i915_add_request(struct intel_ring_buffer *ring, | 1428 | int i915_add_request(struct intel_ring_buffer *ring, |
1429 | struct drm_file *file, | 1429 | struct drm_file *file, |
1430 | struct drm_i915_gem_request *request); | 1430 | u32 *seqno); |
1431 | int __must_check i915_wait_seqno(struct intel_ring_buffer *ring, | 1431 | int __must_check i915_wait_seqno(struct intel_ring_buffer *ring, |
1432 | uint32_t seqno); | 1432 | uint32_t seqno); |
1433 | int i915_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf); | 1433 | int i915_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf); |