1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
https://gitlab.freedesktop.org/mesa/mesa/-/issues/5737
--- src/gallium/winsys/amdgpu/drm/amdgpu_bo.c.orig 2025-04-21 22:23:33 UTC
+++ src/gallium/winsys/amdgpu/drm/amdgpu_bo.c
@@ -833,7 +833,7 @@ struct pb_slab *amdgpu_bo_slab_alloc(void *priv, unsig
slab_bo->slab.group_index = group_index;
slab_bo->slab.entry_size = entry_size;
slab_bo->entries = os_malloc_aligned(slab_bo->slab.num_entries * sizeof(*slab_bo->entries),
- CACHE_LINE_SIZE);
+ MESA_CACHE_LINE_SIZE);
if (!slab_bo->entries)
goto fail;
--- src/util/u_memory.h.orig 2025-04-21 22:23:33 UTC
+++ src/util/u_memory.h
@@ -84,7 +84,7 @@ mem_dup(const void *src, size_t size)
}
/* TODO: this could be different on non-x86 architectures. */
-#define CACHE_LINE_SIZE 64
+#define MESA_CACHE_LINE_SIZE 64
/**
* Declare a variable on its own cache line.
@@ -101,12 +101,12 @@ mem_dup(const void *src, size_t size)
* aligned, but we only want to align the field.
*/
#define EXCLUSIVE_CACHELINE(decl) \
- union { char __cl_space[CACHE_LINE_SIZE]; \
+ union { char __cl_space[MESA_CACHE_LINE_SIZE]; \
decl; }
/* Allocate a structure aligned to a cache line. (used to make atomic ops faster) */
-#define MALLOC_STRUCT_CL(T) (struct T *)align_malloc(sizeof(struct T), CACHE_LINE_SIZE)
-#define CALLOC_STRUCT_CL(T) (struct T *)align_calloc(sizeof(struct T), CACHE_LINE_SIZE)
+#define MALLOC_STRUCT_CL(T) (struct T *)align_malloc(sizeof(struct T), MESA_CACHE_LINE_SIZE)
+#define CALLOC_STRUCT_CL(T) (struct T *)align_calloc(sizeof(struct T), MESA_CACHE_LINE_SIZE)
#define FREE_CL(ptr) align_free(ptr)
#ifdef __cplusplus
--- src/vulkan/vram-report-limit-layer/vram_report_limit_layer.c.orig 2025-04-21 22:23:33 UTC
+++ src/vulkan/vram-report-limit-layer/vram_report_limit_layer.c
@@ -447,7 +447,7 @@ vram_report_limit_CreateInstance(const VkInstanceCreat
struct vram_report_limit_instance_data *instance_data = os_malloc_aligned(
sizeof(*instance_data) + sizeof(instance_data->active_pdevices_array[0]) *
active_pdevices_count,
- CACHE_LINE_SIZE);
+ MESA_CACHE_LINE_SIZE);
if (instance_data == NULL) {
result = VK_ERROR_OUT_OF_HOST_MEMORY;
goto err_free_is_pdevice_active_array;
|