Skip to content
  1. Oct 16, 2021
  2. Oct 15, 2021
  3. Oct 13, 2021
  4. Oct 12, 2021
  5. Oct 08, 2021
    • Lucas De Marchi's avatar
      drm/i915: remove IS_ACTIVE · 1a839e01
      Lucas De Marchi authored
      When trying to bring IS_ACTIVE to linux/kconfig.h I thought it wouldn't
      provide much value just encapsulating it in a boolean context. So I also
      added the support for handling undefined macros as the IS_ENABLED()
      counterpart. However the feedback received from Masahiro Yamada was that
      it is too ugly, not providing much value. And just wrapping in a boolean
      context is too dumb - we could simply open code it.
      
      As detailed in commit babaab2f
      
       ("drm/i915: Encapsulate kconfig
      constant values inside boolean predicates"), the IS_ACTIVE macro was
      added to workaround a compilation warning. However after checking again
      our current uses of IS_ACTIVE it turned out there is only
      1 case in which it triggers a warning in clang (due
      -Wconstant-logical-operand) and 2 in smatch. All the others
      can simply use the shorter version, without wrapping it in any macro.
      
      So here I'm dialing all the way back to simply removing the macro. That
      single case hit by clang can be changed to make the constant come first,
      so it doesn't think it's mask:
      
      	-       if (context && CONFIG_DRM_I915_FENCE_TIMEOUT)
      	+       if (CONFIG_DRM_I915_FENCE_TIMEOUT && context)
      
      As talked with Dan Carpenter, that logic will be added in smatch as
      well, so it will also stop warning about it.
      
      Signed-off-by: default avatarLucas De Marchi <lucas.demarchi@intel.com>
      Reviewed-by: default avatarJani Nikula <jani.nikula@intel.com>
      Reviewed-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      Link: https://patchwork.freedesktop.org/patch/msgid/20211005171728.3147094-1-lucas.demarchi@intel.com
      1a839e01
  6. Oct 06, 2021
  7. Oct 05, 2021
  8. Oct 02, 2021
  9. 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
  10. Sep 30, 2021
  11. Sep 29, 2021