mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-29 18:28:14 +02:00
Allocating larger buffers allows KMD/HW to enable optimizations that makes access to memory faster, also because of minimum alignment required in some cases we allocate 4k or 64k long buffers for usages that only needs a few bytes, wasting a lot of memory. Memory pool takes care of both of those things and here I'm adding the base infrastruture to implement this feature. The next patch will implement the functions in anv_slab_bo.c, spliting it in two to make review easier. The idea here is take the same approach as Iris and use pb_slab.h. In 99% of the places it will be transparent that anv_bo is actually a slab of a larger and real anv_bo, the remaning 1% of the places are handled here. Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Signed-off-by: José Roberto de Souza <jose.souza@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33558>
15 lines
458 B
C
15 lines
458 B
C
/* Copyright © 2025 Intel Corporation
|
|
* SPDX-License-Identifier: MIT
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "anv_private.h"
|
|
|
|
bool anv_slab_bo_init(struct anv_device *device);
|
|
void anv_slab_bo_deinit(struct anv_device *device);
|
|
|
|
struct anv_bo *
|
|
anv_slab_bo_alloc(struct anv_device *device, const char *name, uint64_t size,
|
|
uint32_t alignment, enum anv_bo_alloc_flags alloc_flags);
|
|
void anv_slab_bo_free(struct anv_device *device, struct anv_bo *bo);
|