<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p><br>
    </p>
    <div class="moz-cite-prefix">On 4/28/23 17:19, Yang, Fei wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:BYAPR11MB25676E1468DEEB827E889DA39A6B9@BYAPR11MB2567.namprd11.prod.outlook.com">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <style type="text/css" style="display:none;">P {margin-top:0;margin-bottom:0;}</style>
      <div style="font-family: Calibri, Arial, Helvetica, sans-serif;
        font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof
        ContentPasted0 ContentPasted2">
        > On 4/28/23 07:47, <a class="moz-txt-link-abbreviated" href="mailto:fei.yang@intel.com">fei.yang@intel.com</a> wrote:
        <div class="ContentPasted0">>> From: Fei Yang
          <a class="moz-txt-link-rfc2396E" href="mailto:fei.yang@intel.com"><fei.yang@intel.com></a></div>
        <div class="ContentPasted0">>></div>
        <div class="ContentPasted0">>> The first three patches in
          this series are taken from</div>
        <div class="ContentPasted0">>>
          <a class="moz-txt-link-freetext" href="https://patchwork.freedesktop.org/series/116868/">https://patchwork.freedesktop.org/series/116868/</a></div>
        <div class="ContentPasted0">>> These patches are included
          here because the last patch</div>
        <div class="ContentPasted0">>> has dependency on the
          pat_index refactor.</div>
        <div class="ContentPasted0">>></div>
        <div class="ContentPasted0">>> This series is focusing on
          uAPI changes,</div>
        <div class="ContentPasted0">>> 1. end support for set
          caching ioctl [PATCH 4/5]</div>
        <div class="ContentPasted0">>> 2. add set_pat extension
          for gem_create [PATCH 5/5]</div>
        <div class="ContentPasted0">>></div>
        <div class="ContentPasted0">>> v2: drop one patch that was
          merged separately</div>
        <div class="ContentPasted0">>>      341ad0e8e254
          drm/i915/mtl: Add PTE encode function</div>
        <div class="ContentPasted0">>> v3: rebase on
          <a class="moz-txt-link-freetext" href="https://patchwork.freedesktop.org/series/117082/">https://patchwork.freedesktop.org/series/117082/</a></div>
        <div class="ContentPasted0">></div>
        <div class="ContentPasted0">> Hi, Fei.</div>
        <div class="ContentPasted0">></div>
        <div class="ContentPasted0">> Does this uAPI update also
          affect any discrete GPUs supported by i915,</div>
        <div><br class="ContentPasted0">
        </div>
        <div class="ContentPasted0">It does.</div>
        <div><br class="ContentPasted0">
        </div>
        <div class="ContentPasted0">> And in that case, does it allow
          setting non-snooping PAT indices on</div>
        <div class="ContentPasted0">> those devices?</div>
        <div><br class="ContentPasted0">
        </div>
        <div class="ContentPasted0">It allows setting PAT indices
          specified in <br>
        </div>
        <div class="ContentPasted0">KMD does a sanity check so that it
          won't go over the max recommended</div>
        <div class="ContentPasted0">by bspec.</div>
        <div><br class="ContentPasted0">
        </div>
        <div class="ContentPasted0">> If so, since the uAPI for
          discrete GPU devices doesn't allow incoherency</div>
        <div class="ContentPasted0">> between GPU and CPU (apart from
          write-combining buffering), the correct</div>
        <div class="ContentPasted0">> CPU caching mode matching the
          PAT index needs to be selected for the</div>
        <div class="ContentPasted0">> buffer object in
          i915_ttm_select_tt_caching().</div>
        <div><br class="ContentPasted0">
        </div>
        <div class="ContentPasted0">The patch doesn't affect the CPU
          caching mode setting logic though.</div>
        <div class="ContentPasted0">And the caching settings for objects
          created by kernel should remain</div>
        <div class="ContentPasted0">the same for both CPU and GPU,
          objects created by userspace are</div>
        <div class="ContentPasted0">managed completely by userspace.</div>
        <div><br class="ContentPasted0">
        </div>
        <div class="ContentPasted0">One question though, what do you
          mean by non-snooping PAT indices?</div>
        <div class="ContentPasted0">The PAT index registers don't really
          control coherency mode in the past,</div>
        <div class="ContentPasted0">I believe MTL is the first one that
          has COH_MODE in the PAT registers.</div>
        <div class="ContentPasted0">Aren't discrete GPUs snooping CPU
          cache automatically?</div>
      </div>
    </blockquote>
    <p>Yes, that was actually the bottom question: What do these PAT
      settings allow you to do WRT the snooping on supported discrete
      devices (DG2) on i915?</p>
    <p>If they indeed don't allow disabling snooping, then that's not a
      problem. If they do, the ttm code there needs some modification.<br>
    </p>
    <p><br>
    </p>
    <p>Thanks,</p>
    <p>Thomas</p>
    <p><br>
    </p>
    <p><br>
    </p>
    <blockquote type="cite"
cite="mid:BYAPR11MB25676E1468DEEB827E889DA39A6B9@BYAPR11MB2567.namprd11.prod.outlook.com">
      <div style="font-family: Calibri, Arial, Helvetica, sans-serif;
        font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof
        ContentPasted0 ContentPasted2">
        <div class="ContentPasted1"><br>
        </div>
        <div class="ContentPasted1">-Fei</div>
        <div class="ContentPasted1"><br>
        </div>
        <div class="ContentPasted1">> Thanks,</div>
        <div class="ContentPasted1">> Thomas</div>
        <div class="ContentPasted1">></div>
        <div class="ContentPasted1">>></div>
        <div class="ContentPasted1">>> Fei Yang (5):</div>
        <div class="ContentPasted1">>>    drm/i915: preparation
          for using PAT index</div>
        <div class="ContentPasted1">>>    drm/i915: use pat_index
          instead of cache_level</div>
        <div class="ContentPasted1">>>    drm/i915: make sure
          correct pte encode is used</div>
        <div class="ContentPasted1">>>    drm/i915/mtl: end
          support for set caching ioctl</div>
        <div class="ContentPasted1">>>    drm/i915: Allow user to
          set cache at BO creation</div>
        <div class="ContentPasted1">>></div>
        <div class="ContentPasted1">>>  
          drivers/gpu/drm/i915/display/intel_dpt.c      | 12 +--</div>
        <div class="ContentPasted1">>>  
          drivers/gpu/drm/i915/gem/i915_gem_create.c    | 36 +++++++++</div>
        <div class="ContentPasted1">>>  
          drivers/gpu/drm/i915/gem/i915_gem_domain.c    | 46 ++++++-----</div>
        <div class="ContentPasted1">>>  
          .../gpu/drm/i915/gem/i915_gem_execbuffer.c    | 10 ++-</div>
        <div class="ContentPasted1">>>  
          drivers/gpu/drm/i915/gem/i915_gem_mman.c      |  3 +-</div>
        <div class="ContentPasted1">>>  
          drivers/gpu/drm/i915/gem/i915_gem_object.c    | 67
          +++++++++++++++-</div>
        <div class="ContentPasted1">>>  
          drivers/gpu/drm/i915/gem/i915_gem_object.h    |  8 ++</div>
        <div class="ContentPasted1">>>  
          .../gpu/drm/i915/gem/i915_gem_object_types.h  | 26 +++++-</div>
        <div class="ContentPasted1">>>  
          drivers/gpu/drm/i915/gem/i915_gem_shmem.c     |  9 ++-</div>
        <div class="ContentPasted1">>>  
          drivers/gpu/drm/i915/gem/i915_gem_shrinker.c  |  2 -</div>
        <div class="ContentPasted1">>>  
          drivers/gpu/drm/i915/gem/i915_gem_stolen.c    |  4 +-</div>
        <div class="ContentPasted1">>>  
          drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c  | 16 ++--</div>
        <div class="ContentPasted1">>>  
          .../gpu/drm/i915/gem/selftests/huge_pages.c   |  2 +-</div>
        <div class="ContentPasted1">>>  
          .../drm/i915/gem/selftests/i915_gem_migrate.c |  2 +-</div>
        <div class="ContentPasted1">>>  
          .../drm/i915/gem/selftests/i915_gem_mman.c    |  2 +-</div>
        <div class="ContentPasted1">>>  
          drivers/gpu/drm/i915/gt/gen6_ppgtt.c          | 10 ++-</div>
        <div class="ContentPasted1">>>  
          drivers/gpu/drm/i915/gt/gen8_ppgtt.c          | 73
          +++++++++--------</div>
        <div class="ContentPasted1">>>  
          drivers/gpu/drm/i915/gt/gen8_ppgtt.h          |  3 +-</div>
        <div class="ContentPasted1">>>  
          drivers/gpu/drm/i915/gt/intel_ggtt.c          | 76
          +++++++++---------</div>
        <div class="ContentPasted1">>>  
          drivers/gpu/drm/i915/gt/intel_gtt.h           | 20 +++--</div>
        >>   drivers/gpu/drm/i915/gt/intel_migrate.c       | 47
        ++++++-----
        <div class="ContentPasted2">>>  
          drivers/gpu/drm/i915/gt/intel_migrate.h       | 13 ++-</div>
        <div class="ContentPasted2">>>  
          drivers/gpu/drm/i915/gt/intel_ppgtt.c         |  6 +-</div>
        <div class="ContentPasted2">>>  
          drivers/gpu/drm/i915/gt/selftest_migrate.c    | 47 +++++------</div>
        <div class="ContentPasted2">>>  
          drivers/gpu/drm/i915/gt/selftest_reset.c      |  8 +-</div>
        <div class="ContentPasted2">>>  
          drivers/gpu/drm/i915/gt/selftest_timeline.c   |  2 +-</div>
        <div class="ContentPasted2">>>  
          drivers/gpu/drm/i915/gt/selftest_tlb.c        |  4 +-</div>
        <div class="ContentPasted2">>>  
          drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c      | 10 ++-</div>
        <div class="ContentPasted2">>>  
          drivers/gpu/drm/i915/i915_debugfs.c           | 55
          ++++++++++---</div>
        <div class="ContentPasted2">>>  
          drivers/gpu/drm/i915/i915_gem.c               | 16 +++-</div>
        <div class="ContentPasted2">>>  
          drivers/gpu/drm/i915/i915_gpu_error.c         |  8 +-</div>
        <div class="ContentPasted2">>>  
          drivers/gpu/drm/i915/i915_pci.c               | 79
          ++++++++++++++++---</div>
        <div class="ContentPasted2">>>  
          drivers/gpu/drm/i915/i915_vma.c               | 16 ++--</div>
        <div class="ContentPasted2">>>  
          drivers/gpu/drm/i915/i915_vma.h               |  2 +-</div>
        <div class="ContentPasted2">>>  
          drivers/gpu/drm/i915/i915_vma_types.h         |  2 -</div>
        <div class="ContentPasted2">>>  
          drivers/gpu/drm/i915/intel_device_info.h      |  5 ++</div>
        <div class="ContentPasted2">>>  
          drivers/gpu/drm/i915/selftests/i915_gem.c     |  5 +-</div>
        <div class="ContentPasted2">>>  
          .../gpu/drm/i915/selftests/i915_gem_evict.c   |  4 +-</div>
        <div class="ContentPasted2">>>  
          drivers/gpu/drm/i915/selftests/i915_gem_gtt.c | 15 ++--</div>
        <div class="ContentPasted2">>>  
          .../drm/i915/selftests/intel_memory_region.c  |  4 +-</div>
        <div class="ContentPasted2">>>  
          .../gpu/drm/i915/selftests/mock_gem_device.c  |  9 +++</div>
        <div class="ContentPasted2">>>  
          drivers/gpu/drm/i915/selftests/mock_gtt.c     |  8 +-</div>
        <div class="ContentPasted2">>>  
          include/uapi/drm/i915_drm.h                   | 36 +++++++++</div>
        <div class="ContentPasted2">>>  
          tools/include/uapi/drm/i915_drm.h             | 36 +++++++++</div>
        <div class="ContentPasted2">>>   44 files changed, 621
          insertions(+), 243 deletions(-)</div>
        <div class="ContentPasted2">>></div>
        <br>
      </div>
    </blockquote>
  </body>
</html>