Module: Mesa
Branch: main
Commit: 7046a9e280f7ded13865c70a2577a489787fa016
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=7046a9e280f7ded13865c70a2577a489787fa016

Author: José Roberto de Souza <jose.so...@intel.com>
Date:   Mon Sep 18 09:22:58 2023 -0700

intel: Rename PAT entries

Here renaming the PAT entries to a name that better express each
entry.

Signed-off-by: José Roberto de Souza <jose.so...@intel.com>
Reviewed-by: Kenneth Graunke <kenn...@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25447>

---

 src/gallium/drivers/iris/iris_bufmgr.c |  2 +-
 src/intel/dev/intel_device_info.c      | 10 ++++++----
 src/intel/dev/intel_device_info.h      |  7 +++++--
 src/intel/vulkan/anv_device.c          |  2 +-
 4 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/src/gallium/drivers/iris/iris_bufmgr.c 
b/src/gallium/drivers/iris/iris_bufmgr.c
index 32477f11db4..0e53276c973 100644
--- a/src/gallium/drivers/iris/iris_bufmgr.c
+++ b/src/gallium/drivers/iris/iris_bufmgr.c
@@ -2628,7 +2628,7 @@ iris_bufmgr_get_pat_entry_for_bo_flags(const struct 
iris_bufmgr *bufmgr,
    const struct intel_device_info *devinfo = &bufmgr->devinfo;
 
    if (alloc_flags & BO_ALLOC_COHERENT)
-      return &devinfo->pat.coherent;
+      return &devinfo->pat.cached_coherent;
 
    if (alloc_flags & (BO_ALLOC_SHARED | BO_ALLOC_SCANOUT))
       return &devinfo->pat.scanout;
diff --git a/src/intel/dev/intel_device_info.c 
b/src/intel/dev/intel_device_info.c
index e06456f1057..de3e3949313 100644
--- a/src/intel/dev/intel_device_info.c
+++ b/src/intel/dev/intel_device_info.c
@@ -1136,10 +1136,12 @@ static const struct intel_device_info 
intel_device_info_atsm_g11 = {
    .has_coarse_pixel_primitive_and_cb = true,                   \
    .has_mesh_shading = true,                                    \
    .has_ray_tracing = true,                                     \
-   .pat.coherent = PAT_ENTRY(3, WB, 1WAY),                      \
-   .pat.scanout = PAT_ENTRY(1, WC, NONE),                       \
-   .pat.writeback = PAT_ENTRY(0, WB, NONE),                     \
-   .pat.writecombining = PAT_ENTRY(1, WC, NONE)
+   .pat = {                                                     \
+         .cached_coherent = PAT_ENTRY(3, WB, 1WAY),             \
+         .scanout = PAT_ENTRY(1, WC, NONE),                     \
+         .writeback_incoherent = PAT_ENTRY(0, WB, NONE),        \
+         .writecombining = PAT_ENTRY(1, WC, NONE),              \
+   }
 
 static const struct intel_device_info intel_device_info_mtl_u = {
    MTL_FEATURES,
diff --git a/src/intel/dev/intel_device_info.h 
b/src/intel/dev/intel_device_info.h
index 757cdf938cb..1ece5258aa9 100644
--- a/src/intel/dev/intel_device_info.h
+++ b/src/intel/dev/intel_device_info.h
@@ -487,9 +487,12 @@ struct intel_device_info
    } mem;
 
    struct {
-      struct intel_device_info_pat_entry coherent;
+      /* To be used when CPU access is frequent, WB + 1 or 2 way coherent */
+      struct intel_device_info_pat_entry cached_coherent;
+      /* scanout and external BOs */
       struct intel_device_info_pat_entry scanout;
-      struct intel_device_info_pat_entry writeback;
+      /* BOs without special needs, can be WB not coherent or WC it depends on 
the platforms and KMD */
+      struct intel_device_info_pat_entry writeback_incoherent;
       struct intel_device_info_pat_entry writecombining;
    } pat;
 
diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c
index a2bcbe647f0..9d52cf016e8 100644
--- a/src/intel/vulkan/anv_device.c
+++ b/src/intel/vulkan/anv_device.c
@@ -5184,7 +5184,7 @@ anv_device_get_pat_entry(struct anv_device *device,
                          enum anv_bo_alloc_flags alloc_flags)
 {
    if (alloc_flags & (ANV_BO_ALLOC_SNOOPED))
-      return &device->info->pat.coherent;
+      return &device->info->pat.cached_coherent;
    else if (alloc_flags & (ANV_BO_ALLOC_EXTERNAL | ANV_BO_ALLOC_SCANOUT))
       return &device->info->pat.scanout;
    else

Reply via email to