• Matthew Brost's avatar
    drm/i915: Multi-BB execbuf · 544460c3
    Matthew Brost authored
    Allow multiple batch buffers to be submitted in a single execbuf IOCTL
    after a context has been configured with the 'set_parallel' extension.
    The number batches is implicit based on the contexts configuration.
    
    This is implemented with a series of loops. First a loop is used to find
    all the batches, a loop to pin all the HW contexts, a loop to create all
    the requests, a loop to submit (emit BB start, etc...) all the requests,
    a loop to tie the requests to the VMAs they touch, and finally a loop to
    commit the requests to the backend.
    
    A composite fence is also created for the generated requests to return
    to the user and to stick in dma resv slots.
    
    No behavior from the existing IOCTL should be changed aside from when
    throttling because the ring for a context is full. In this situation,
    i915 will now wait while holding the object locks. This change was done
    because the code is much simpler to wait while holding the locks and we
    believe there isn't a huge benefit of dropping these locks. If this
    proves false we can restructure the code to drop the locks during the
    wait.
    
    IGT: https://patchwork.freedesktop.org/patch/447008/?series=93071&rev=1
    media UMD: https://github.com/intel/media-driver/pull/1252
    
    v2:
     (Matthew Brost)
      - Return proper error value if i915_request_create fails
    v3:
     (John Harrison)
      - Add comment explaining create / add order loops + locking
      - Update commit message explaining different in IOCTL behavior
      - Line wrap some comments
      - eb_add_request returns void
      - Return -EINVAL rather triggering BUG_ON if cmd parser used
     (Checkpatch)
      - Check eb->batch_len[*current_batch]
    v4:
     (CI)
      - Set batch len if passed if via execbuf args
      - Call __i915_request_skip after __i915_request_commit
     (Kernel test robot)
      - Initialize rq to NULL in eb_pin_timeline
    v5:
     (John Harrison)
      - Fix typo in comments near bb order loops
    Signed-off-by: default avatarMatthew Brost <matthew.brost@intel.com>
    Reviewed-by: default avatarJohn Harrison <John.C.Harrison@Intel.com>
    Signed-off-by: default avatarJohn Harrison <John.C.Harrison@Intel.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20211014172005.27155-21-matthew.brost@intel.com
    544460c3
i915_request.h 22.1 KB