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

Author: Jordan Justen <jordan.l.jus...@intel.com>
Date:   Fri Sep 29 01:08:30 2023 -0700

intel/l3: Use devinfo->urb.size when cfg urb-size is 0.

Signed-off-by: Jordan Justen <jordan.l.jus...@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwer...@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25493>

---

 src/intel/common/intel_l3_config.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/intel/common/intel_l3_config.c 
b/src/intel/common/intel_l3_config.c
index fbeedaf50fa..1f1c2008aab 100644
--- a/src/intel/common/intel_l3_config.c
+++ b/src/intel/common/intel_l3_config.c
@@ -350,15 +350,22 @@ unsigned
 intel_get_l3_config_urb_size(const struct intel_device_info *devinfo,
                              const struct intel_l3_config *cfg)
 {
+   unsigned urb_size;
+
    /* We don't have to program the URB size for some platforms. It's a fixed
     * value.
     */
    if (cfg == NULL) {
       ASSERTED const struct intel_l3_list *const list = get_l3_list(devinfo);
       assert(list->length == 0);
-      return devinfo->urb.size;
+      urb_size = 0;
+   } else {
+      urb_size = intel_get_l3_partition_size(devinfo, cfg, INTEL_L3P_URB);
    }
 
+   if (urb_size == 0)
+      return devinfo->urb.size;
+
    /* From the SKL "L3 Allocation and Programming" documentation:
     *
     * "URB is limited to 1008KB due to programming restrictions.  This is not
@@ -368,8 +375,7 @@ intel_get_l3_config_urb_size(const struct intel_device_info 
*devinfo,
     * only 1008KB of this will be used."
     */
    const unsigned max = (devinfo->ver == 9 ? 1008 : ~0);
-   return MIN2(max, intel_get_l3_partition_size(devinfo, cfg, INTEL_L3P_URB)) /
-          get_urb_size_scale(devinfo);
+   return MIN2(max, urb_size) / get_urb_size_scale(devinfo);
 }
 
 /**

Reply via email to