Skip to content
  1. Oct 05, 2021
  2. Oct 02, 2021
  3. Oct 01, 2021
    • Thomas Hellström's avatar
      drm/i915/ttm: Rework object initialization slightly · 068396bb
      Thomas Hellström authored
      We may end up in i915_ttm_bo_destroy() in an error path before the
      object is fully initialized. In that case it's not correct to call
      __i915_gem_free_object(), because that function
      a) Assumes the gem object refcount is 0, which it isn't.
      b) frees the placements which are owned by the caller until the
      init_object() region ops returns successfully. Fix this by providing
      a lightweight cleanup function __i915_gem_object_fini() which is also
      called by __i915_gem_free_object().
      
      While doing this, also make sure we call dma_resv_fini() as part of
      ordinary object destruction and not from the RCU callback that frees
      the object. This will help track down bugs where the object is incorrectly
      locked from an RCU lookup.
      
      Finally, make sure the object isn't put on the region list until it's
      either locked or fully initialized in order to block list processing of
      partially initialized objects.
      
      v2:
      - The TTM object backend memory was freed before the gem pages were
        put. Separate this functionality into __i915_gem_object_pages_fini()
        and call it from the TTM delete_mem_notify() callback.
      v3:
      - Include i915_gem_object_free_mmaps() in __i915_gem_object_pages_fini()
        to make sure we don't inadvertedly introduce a race.
      
      Fixes: 48b09612
      
       ("drm/i915: Move __i915_gem_free_object to ttm_bo_destroy")
      Signed-off-by: default avatarThomas Hellström <thomas.hellstrom@linux.intel.com>
      Reviewed-by: Matthew Auld <matthew.auld@intel.com> #v1
      Link: https://patchwork.freedesktop.org/patch/msgid/20210930113236.583531-1-thomas.hellstrom@linux.intel.com
      068396bb
  4. Sep 30, 2021
  5. Sep 29, 2021
  6. Sep 27, 2021
  7. Sep 25, 2021
    • Janusz Krzysztofik's avatar
      drm/i915: Flush buffer pools on driver remove · 74af1e2c
      Janusz Krzysztofik authored
      
      
      We currently do an explicit flush of the buffer pools within the call path
      of drm_driver.release(); this removes all buffers, regardless of their age,
      freeing the buffers' associated resources (objects, address space areas).
      However there is other code that runs within the drm_driver.release() call
      chain that expects objects and their associated address space areas have
      already been flushed.
      
      Since buffer pools auto-flush old buffers once per second in a worker
      thread, there's a small window where if we remove the driver while there
      are still objects in buffers with an age of less than one second, the
      assumptions of the other release code may be violated.
      
      By moving the flush to driver remove (which executes earlier via the
      pci_driver.remove() flow) we're ensuring that all buffers are flushed and
      their associated objects freed before some other code in
      pci_driver.remove() flushes those objects so they are released before
      _any_ code in drm_driver.release() that check completness of those
      flushes executes.
      
      v2: Reword commit description as suggested by Matt.
      
      Signed-off-by: default avatarJanusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Matt Roper <matthew.d.roper@intel.com>
      Signed-off-by: default avatarMatt Roper <matthew.d.roper@intel.com>
      Reviewed-by: default avatarMatt Roper <matthew.d.roper@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210924163825.634606-1-janusz.krzysztofik@linux.intel.com
      74af1e2c
  8. Sep 24, 2021
  9. Sep 23, 2021
  10. Sep 22, 2021