• Ben Widawsky's avatar
    drm/i915: Clean up VMAs before freeing · 679845ed
    Ben Widawsky authored
    It's quite common for an object to simply be on the inactive list (and
    not unbound) when we want to free the context. This of course happens
    with lazy unbinding. Simply, this is needed when an object isn't fully
    unbound but we want to free one VMA of the object, for whatever reason.
    
    NOTE: The aliasing PPGTT is not a proper VM, so it needs special casing.
    
    This addresses the fixup requirement mentioned in:
    drm/915: Better reset handling for contexts
    
    In the flink, and dmabuf case, we can't assert that the object isn't
    still active. To keep it more generic, just check the vma's link in the
    object vma list. If we wanted to do a better job, we could track last
    seqno (and active) per VMA. It was decided not to do this in the last
    iteration. Unfortunately this means the assertion can miss real bugs
    when using flink/dmabuf.
    
    v2: Use the newer introduced i915_gem_evict_vm(). Note that handling the
    aliasing PPGTT is special.
    Signed-off-by: default avatarBen Widawsky <ben@bwidawsk.net>
    Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
    679845ed
i915_drv.h 80.3 KB