Skip to content
  1. Oct 17, 2022
  2. Oct 15, 2022
    • Matthew Auld's avatar
      drm/i915/uapi: expose GTT alignment · d54576a0
      Matthew Auld authored
      
      
      On some platforms we potentially have different alignment restrictions
      depending on the memory type. We also now have different alignment
      restrictions for the same region across different kernel versions.
      Extend the region query to return the minimum required GTT alignment.
      
      Testcase: igt@gem_create@create-ext-placement-alignment
      Testcase: igt@i915_query@query-regions-sanity-check
      Suggested-by: default avatarLionel Landwerlin <lionel.g.landwerlin@intel.com>
      Signed-off-by: default avatarMatthew Auld <matthew.auld@intel.com>
      Cc: Michal Mrozek <michal.mrozek@intel.com>
      Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
      Cc: Stuart Summers <stuart.summers@intel.com>
      Cc: Jordan Justen <jordan.l.justen@intel.com>
      Cc: Yang A Shi <yang.a.shi@intel.com>
      Cc: Nirmoy Das <nirmoy.das@intel.com>
      Cc: Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>
      Reviewed-by: default avatarNirmoy Das <nirmoy.das@intel.com>
      Acked-by: default avatarJordan Justen <jordan.l.justen@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20221004114915.221708-2-matthew.auld@intel.com
      d54576a0
    • Matthew Auld's avatar
      drm/i915: enable PS64 support for DG2 · 8133a6da
      Matthew Auld authored
      It turns out that on production DG2/ATS HW we should have support for
      PS64. This feature allows to provide a 64K TLB hint at the PTE level,
      which is a lot more flexible than the current method of enabling 64K GTT
      pages for the entire page-table, since that leads to all kinds of
      annoying restrictions, as documented in:
      
      commit caa574ff
      
      
      Author: Matthew Auld <matthew.auld@intel.com>
      Date:   Sat Feb 19 00:17:49 2022 +0530
      
          drm/i915/uapi: document behaviour for DG2 64K support
      
          On discrete platforms like DG2, we need to support a minimum page size
          of 64K when dealing with device local-memory. This is quite tricky for
          various reasons, so try to document the new implicit uapi for this.
      
      With PS64, we can now drop the 2M GTT alignment restriction, and instead
      only require 64K or larger when dealing with lmem. We still use the
      compact-pt layout when possible, but only when we are certain that this
      doesn't interfere with userspace.
      
      Note that this is a change in uAPI behaviour, but hopefully shouldn't be
      a concern (IGT is at least able to autodetect the alignment), since we
      are only making the GTT alignment constraint less restrictive.
      
      Based on a patch from CQ Tang.
      
      v2: update the comment wrt scratch page
      v3: (Nirmoy)
       - Fix the selftest to actually use the random size, plus some comment
         improvements, also drop the rem stuff.
      
      Reported-by: default avatarMichal Mrozek <michal.mrozek@intel.com>
      Signed-off-by: default avatarMatthew Auld <matthew.auld@intel.com>
      Cc: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
      Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
      Cc: Stuart Summers <stuart.summers@intel.com>
      Cc: Jordan Justen <jordan.l.justen@intel.com>
      Cc: Yang A Shi <yang.a.shi@intel.com>
      Cc: Nirmoy Das <nirmoy.das@intel.com>
      Cc: Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>
      Reviewed-by: default avatarNirmoy Das <nirmoy.das@intel.com>
      Acked-by: default avatarMichal Mrozek <michal.mrozek@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20221004114915.221708-1-matthew.auld@intel.com
      8133a6da
  3. Oct 12, 2022
  4. Oct 11, 2022
  5. Oct 10, 2022
  6. Oct 06, 2022
    • Matthew Auld's avatar
      drm/i915: restore stolen memory behaviour for DG2 · 0da9493e
      Matthew Auld authored
      Restore the previous behaviour here where we compare the
      pci_resource_len() with the actual lmem_size, and not the dsm size,
      since dsm here is just some subset snipped off the end of the lmem.
      Otherwise we will incorrectly report an io_size > 0 on small-bar
      systems.
      
      It doesn't looks like MTL is expecting small-bar with its stolen memory,
      based on:
      
        GEM_BUG_ON(pci_resource_len(pdev, GEN12_LMEM_BAR) != SZ_256M)
        GEM_BUG_ON((dsm_size + SZ_8M) > lmem_size)
      
      So just move the HAS_BAR2_SMEM_STOLEN() check first, which then ignores
      the small bar part, and we can go back to checking lmem_size against the
      BAR size.
      
      Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/7007
      Fixes: dbb2ffbf
      
       ("drm/i915/mtl: enable local stolen memory")
      Signed-off-by: default avatarMatthew Auld <matthew.auld@intel.com>
      Cc: Aravind Iddamsetty <aravind.iddamsetty@intel.com>
      Cc: Lucas De Marchi <lucas.demarchi@intel.com>
      Cc: Matt Roper <matthew.d.roper@intel.com>
      Reviewed-by: default avatarLucas De Marchi <lucas.demarchi@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20221005153148.758822-2-matthew.auld@intel.com
      0da9493e
    • Matthew Auld's avatar
      drm/i915: add back GEN12_BDSM_MASK · 49d1310a
      Matthew Auld authored
      The mask was added in commit e5f415bf ("drm/i915: Add missing mask
      when reading GEN12_DSMBASE"), but then looks to be dropped in some
      unrelated code movement in commit dbb2ffbf ("drm/i915/mtl: enable
      local stolen memory") without explanation. Add it back.
      
      Fixes: dbb2ffbf
      
       ("drm/i915/mtl: enable local stolen memory")
      Signed-off-by: default avatarMatthew Auld <matthew.auld@intel.com>
      Cc: Aravind Iddamsetty <aravind.iddamsetty@intel.com>
      Cc: Lucas De Marchi <lucas.demarchi@intel.com>
      Cc: Matt Roper <matthew.d.roper@intel.com>
      Reviewed-by: default avatarLucas De Marchi <lucas.demarchi@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20221005153148.758822-1-matthew.auld@intel.com
      49d1310a
  7. Oct 05, 2022
    • Matthew Auld's avatar
      drm/i915: check memory is mappable in read_from_page · 7024f80e
      Matthew Auld authored
      
      
      On small-bar systems we could be given something non-mappable here,
      which leads to nasty oops. Make this nicer by checking if the resource
      is mappable or not, and return an error otherwise.
      
      v2: drop GEM_BUG_ON(flags & I915_BO_ALLOC_GPU_ONLY)
      
      Signed-off-by: default avatarMatthew Auld <matthew.auld@intel.com>
      Cc: Jianshui Yu <jianshui.yu@intel.com>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: Nirmoy Das <nirmoy.das@intel.com>
      Reviewed-by: default avatarNirmoy Das <nirmoy.das@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20221004131916.233474-5-matthew.auld@intel.com
      7024f80e
    • Matthew Auld's avatar
      drm/i915/display: consider DG2_RC_CCS_CC when migrating buffers · e3afc690
      Matthew Auld authored
      For these types of display buffers, we need to able to CPU access some
      part of the backing memory in prepare_plane_clear_colors(). As a result
      we need to ensure we always place in the mappable part of lmem, which
      becomes necessary on small-bar systems.
      
      v2(Nirmoy & Ville):
       - Add some commentary for why we need to CPU access the buffer.
       - Split out the other changes, so we just consider the display change
         here.
      v3:
       - Handle this in the dpt path.
      v4(Ville):
       - Drop the intel_fb_rc_ccs_cc_plane() sanity check in
         pin_and_fence_fb_obj(), since we can also trigger this on DG1 it
         seems.
      
      Fixes: eb1c535f
      
       ("drm/i915: turn on small BAR support")
      Reported-by: default avatarJianshui Yu <jianshui.yu@intel.com>
      Signed-off-by: default avatarMatthew Auld <matthew.auld@intel.com>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: Nirmoy Das <nirmoy.das@intel.com>
      Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Acked-by: default avatarNirmoy Das <nirmoy.das@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20221004131916.233474-4-matthew.auld@intel.com
      e3afc690
    • Matthew Auld's avatar
      drm/i915: allow control over the flags when migrating · 999f4562
      Matthew Auld authored
      
      
      In the next patch we want to move the object (if the current resource is
      not compatible), to the mappable part of lmem for some display buffers.
      Currently that requires being able to unset the I915_BO_ALLOC_GPU_ONLY
      hint.
      
      Signed-off-by: default avatarMatthew Auld <matthew.auld@intel.com>
      Cc: Jianshui Yu <jianshui.yu@intel.com>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: Nirmoy Das <nirmoy.das@intel.com>
      Reviewed-by: default avatarNirmoy Das <nirmoy.das@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20221004131916.233474-3-matthew.auld@intel.com
      999f4562
    • Matthew Auld's avatar
      drm/i915/display: handle migration for dpt · 5769f64f
      Matthew Auld authored
      On platforms like DG2, it looks like the dpt path here is missing the
      migrate-to-lmem step on discrete platforms.
      
      v2:
        - Move the vma_pin() under the for_i915_gem_ww(), otherwise the
          object can be moved after dropping the lock and then doing the pin.
      
      Fixes: 33e7a975
      
       ("drm/i915/xelpd: First stab at DPT support")
      Signed-off-by: default avatarMatthew Auld <matthew.auld@intel.com>
      Cc: Jianshui Yu <jianshui.yu@intel.com>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: Nirmoy Das <nirmoy.das@intel.com>
      Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20221004131916.233474-2-matthew.auld@intel.com
      5769f64f
    • Matthew Auld's avatar
      drm/i915: remove the TODO in pin_and_fence_fb_obj · 3bce981f
      Matthew Auld authored
      
      
      The copy is async (if there even is one), but when later updating the
      GGTT we always sync against the binding, which will in turn sync against
      any moves.
      
      Signed-off-by: default avatarMatthew Auld <matthew.auld@intel.com>
      Cc: Jianshui Yu <jianshui.yu@intel.com>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: Nirmoy Das <nirmoy.das@intel.com>
      Reviewed-by: default avatarNirmoy Das <nirmoy.das@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20221004131916.233474-1-matthew.auld@intel.com
      3bce981f
    • Tvrtko Ursulin's avatar
      drm/i915/guc: Fix revocation of non-persistent contexts · 0add082c
      Tvrtko Ursulin authored
      
      
      Patch which added graceful exit for non-persistent contexts missed the
      fact it is not enough to set the exiting flag on a context and let the
      backend handle it from there.
      
      GuC backend cannot handle it because it runs independently in the
      firmware and driver might not see the requests ever again. Patch also
      missed the fact some usages of intel_context_is_banned in the GuC backend
      needed replacing with newly introduced intel_context_is_schedulable.
      
      Fix the first issue by calling into backend revoke when we know this is
      the last chance to do it. Fix the second issue by replacing
      intel_context_is_banned with intel_context_is_schedulable, which should
      always be safe since latter is a superset of the former.
      
      v2:
       * Just call ce->ops->revoke unconditionally. (Andrzej)
      
      Signed-off-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Fixes: 45c64ecf
      
       ("drm/i915: Improve user experience and driver robustness under SIGINT or similar")
      Cc: Andrzej Hajda <andrzej.hajda@intel.com>
      Cc: John Harrison <John.C.Harrison@Intel.com>
      Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
      Cc: <stable@vger.kernel.org> # v6.0+
      Reviewed-by: default avatarAndrzej Hajda <andrzej.hajda@intel.com>
      Acked-by: default avatarDaniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20221003121630.694249-1-tvrtko.ursulin@linux.intel.com
      0add082c
    • Matt Roper's avatar
      drm/i915: Document and future-proof preemption control policy · 42172b55
      Matt Roper authored
      
      
      Intel hardware allows some preemption settings to be controlled either
      by the kernel-mode driver exclusively, or placed under control of the
      user-mode drivers; on Linux we always select the userspace control
      option.  The various registers involved in this are not documented very
      clearly; let's add some clarifying comments to help explain how this all
      works and provide some history on why our Linux drivers take the
      approach they do (which I believe differs from the path taken by certain
      other operating systems' drivers).
      
      While we're at it, let's also remove the graphics version 12 upper bound
      on this programming.  As described, we don't have any plans to move away
      from UMD control of preemption settings on future platforms, and there's
      currently no reason to believe that the hardware will fundamentally
      change how these registers and settings work after version 12.
      
      Bspec: 45921, 45858, 45863
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Cc: Jordan Justen <jordan.l.justen@intel.com>
      Cc: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
      Suggested-by: default avatarJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Signed-off-by: default avatarMatt Roper <matthew.d.roper@intel.com>
      Reviewed-by: default avatarWayne Boyer <wayne.boyer@intel.com>
      Acked-by: default avatarTapani Pälli <tapani.palli@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20220907212410.22623-1-matthew.d.roper@intel.com
      42172b55
  8. Oct 04, 2022