• Chris Wilson's avatar
    drm/i915: Disallow preallocation of requests · acb868d3
    Chris Wilson authored
    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 3bb73aba
    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: default avatarChris Wilson <chris@chris-wilson.co.uk>
    Reviewed-by: default avatarJani Nikula <jani.nikula@intel.com>
    Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
    acb868d3
i915_gem.c 110 KB