mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-04-18 08:10:37 +02:00
tu: Pass real size of prime buffers to allocator
The msm driver reserves the actual DMABUF size in the memory map, while TU can request smaller memory chunk to be allocated. This potentially can lead to a situation when next allocation IOVA will be in the middle of the address space which is reserved for the DMABUF. Pass the `real_size' to TU allocator instead, so that kernel and userspace have the same picture of memory allocations. Cc: mesa-stable Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24861>
This commit is contained in:
parent
cda1961835
commit
2fdcc00b01
1 changed files with 3 additions and 0 deletions
|
|
@ -580,6 +580,9 @@ msm_bo_init_dmabuf(struct tu_device *dev,
|
|||
if (real_size < 0 || (uint64_t) real_size < size)
|
||||
return vk_error(dev, VK_ERROR_INVALID_EXTERNAL_HANDLE);
|
||||
|
||||
/* iova allocation needs to consider the object's *real* size: */
|
||||
size = real_size;
|
||||
|
||||
/* Importing the same dmabuf several times would yield the same
|
||||
* gem_handle. Thus there could be a race when destroying
|
||||
* BO and importing the same dmabuf from different threads.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue