Skip to content
  • Kenneth Graunke's avatar
    i965: Prepare batchbuffer module for softpin support. · 1c9053d0
    Kenneth Graunke authored
    
    
    If EXEC_OBJECT_PINNED is set, we don't want to emit any relocations.
    We simply want to add the BO to the validation list, and possibly mark
    it as writeable.  The new brw_use_pinned_bo() interface does just that.
    
    To avoid having to make every caller consider both the relocation and
    softpin cases, we make emit_reloc() call brw_use_pinned_bo() when given
    a softpinned buffer.
    
    We also can't grow buffers that are softpinned - the mechanism places a
    larger BO at the same offset as the original, which requires moving BOs
    around in the VMA.  With softpin, we only allocate enough VMA for the
    original size of the BO.
    
    v2: Assert that BOs aren't pinned if the kernel says we should move them
        (feedback from Chris Wilson)
    
    Reviewed-by: default avatarScott D Phillips <scott.d.phillips@intel.com>
    1c9053d0