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

Author: Lionel Landwerlin <lionel.g.landwer...@intel.com>
Date:   Sun Jan 14 10:49:57 2024 +0200

intel/aux_map: fix fallback unmapping range on failure

Signed-off-by: Lionel Landwerlin <lionel.g.landwer...@intel.com>
Fixes: 7c6faa1efe ("intel/aux_map: introduce ref count of L1 entries")
Reviewed-by: Tapani Pälli <tapani.pa...@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27057>

---

 src/intel/common/intel_aux_map.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/intel/common/intel_aux_map.c b/src/intel/common/intel_aux_map.c
index 3040d25d6dc..2804e30ec77 100644
--- a/src/intel/common/intel_aux_map.c
+++ b/src/intel/common/intel_aux_map.c
@@ -728,7 +728,7 @@ intel_aux_map_add_mapping(struct intel_aux_map_context 
*ctx, uint64_t main_addre
    if (!success && (main_inc_addr - main_address) > 0) {
       /* If the mapping failed, remove the mapped portion. */
       remove_mapping_locked(ctx, main_address,
-                            main_size_B - (main_inc_addr - main_address),
+                            main_inc_addr - main_address,
                             false /* reset_refcount */, &state_changed);
    }
    pthread_mutex_unlock(&ctx->mutex);

Reply via email to