v3dv: Move V3D_TFU_READAHEAD_SIZE to src/broadcom/common

We will use it in v3d.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36159>
This commit is contained in:
Jose Maria Casanova Crespo 2025-07-16 13:06:22 +02:00 committed by Marge Bot
parent 7ed9fdf85b
commit 310aa198f4
3 changed files with 6 additions and 6 deletions

View file

@ -71,6 +71,11 @@ struct v3d_device_info {
uint32_t cle_buffer_min_size;
};
/* TFU has a 64-bytes readhead. To avoid the unit reading unmaped memory
* we need to overallocate buffers that could be read by the TFU.
*/
#define V3D_TFU_READAHEAD_SIZE 64
typedef int (*v3d_ioctl_fun)(int fd, unsigned long request, void *arg);
bool

View file

@ -2183,7 +2183,7 @@ v3dv_AllocateMemory(VkDevice _device,
assert(pAllocateInfo->sType == VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO);
/* We always allocate device memory in multiples of a page, so round up
* requested size to that. We need to add a V3D_TFU_READHAEAD padding to
* requested size to that. We need to add a V3D_TFU_READAHEAD padding to
* avoid invalid reads done by the TFU unit after the end of the last page
* allocated.
*/

View file

@ -598,11 +598,6 @@ struct v3dv_device {
struct util_dynarray device_address_bo_list; /* Array of struct v3dv_bo * */
};
/* TFU has readhead of 64 bytes. So to avoid the unit reading unmaped memory
* it is needed to overallocate buffers that could be read by the TFU
*/
#define V3D_TFU_READAHEAD_SIZE 64
struct v3dv_device_memory {
struct vk_device_memory vk;