mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-23 22:00:13 +01:00
radv/amdgpu: remove legacy code path for creating the BO list
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22521>
This commit is contained in:
parent
c920d676c0
commit
767a9324b9
1 changed files with 10 additions and 30 deletions
|
|
@ -1495,7 +1495,6 @@ radv_amdgpu_cs_submit(struct radv_amdgpu_ctx *ctx, struct radv_amdgpu_cs_request
|
||||||
int size;
|
int size;
|
||||||
struct drm_amdgpu_cs_chunk *chunks;
|
struct drm_amdgpu_cs_chunk *chunks;
|
||||||
struct drm_amdgpu_cs_chunk_data *chunk_data;
|
struct drm_amdgpu_cs_chunk_data *chunk_data;
|
||||||
bool use_bo_list_create = ctx->ws->info.drm_minor < 27;
|
|
||||||
struct drm_amdgpu_bo_list_in bo_list_in;
|
struct drm_amdgpu_bo_list_in bo_list_in;
|
||||||
void *wait_syncobj = NULL, *signal_syncobj = NULL;
|
void *wait_syncobj = NULL, *signal_syncobj = NULL;
|
||||||
int i;
|
int i;
|
||||||
|
|
@ -1508,7 +1507,7 @@ radv_amdgpu_cs_submit(struct radv_amdgpu_ctx *ctx, struct radv_amdgpu_cs_request
|
||||||
if (!queue_syncobj)
|
if (!queue_syncobj)
|
||||||
return VK_ERROR_OUT_OF_HOST_MEMORY;
|
return VK_ERROR_OUT_OF_HOST_MEMORY;
|
||||||
|
|
||||||
size = request->number_of_ibs + 1 + (has_user_fence ? 1 : 0) + (!use_bo_list_create ? 1 : 0) + 3;
|
size = request->number_of_ibs + 1 + (has_user_fence ? 1 : 0) + 1 /* bo list */ + 3;
|
||||||
|
|
||||||
chunks = malloc(sizeof(chunks[0]) * size);
|
chunks = malloc(sizeof(chunks[0]) * size);
|
||||||
if (!chunks)
|
if (!chunks)
|
||||||
|
|
@ -1599,35 +1598,16 @@ radv_amdgpu_cs_submit(struct radv_amdgpu_ctx *ctx, struct radv_amdgpu_cs_request
|
||||||
num_chunks++;
|
num_chunks++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (use_bo_list_create) {
|
bo_list_in.operation = ~0;
|
||||||
/* Legacy path creating the buffer list handle and passing it
|
bo_list_in.list_handle = ~0;
|
||||||
* to the CS ioctl.
|
bo_list_in.bo_number = request->num_handles;
|
||||||
*/
|
bo_list_in.bo_info_size = sizeof(struct drm_amdgpu_bo_list_entry);
|
||||||
r = amdgpu_bo_list_create_raw(ctx->ws->dev, request->num_handles,
|
bo_list_in.bo_info_ptr = (uint64_t)(uintptr_t)request->handles;
|
||||||
request->handles, &bo_list);
|
|
||||||
if (r) {
|
|
||||||
if (r == -ENOMEM) {
|
|
||||||
fprintf(stderr, "radv/amdgpu: Not enough memory for buffer list creation.\n");
|
|
||||||
result = VK_ERROR_OUT_OF_HOST_MEMORY;
|
|
||||||
} else {
|
|
||||||
fprintf(stderr, "radv/amdgpu: buffer list creation failed (%d).\n", r);
|
|
||||||
result = VK_ERROR_UNKNOWN;
|
|
||||||
}
|
|
||||||
goto error_out;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
/* Standard path passing the buffer list via the CS ioctl. */
|
|
||||||
bo_list_in.operation = ~0;
|
|
||||||
bo_list_in.list_handle = ~0;
|
|
||||||
bo_list_in.bo_number = request->num_handles;
|
|
||||||
bo_list_in.bo_info_size = sizeof(struct drm_amdgpu_bo_list_entry);
|
|
||||||
bo_list_in.bo_info_ptr = (uint64_t)(uintptr_t)request->handles;
|
|
||||||
|
|
||||||
chunks[num_chunks].chunk_id = AMDGPU_CHUNK_ID_BO_HANDLES;
|
chunks[num_chunks].chunk_id = AMDGPU_CHUNK_ID_BO_HANDLES;
|
||||||
chunks[num_chunks].length_dw = sizeof(struct drm_amdgpu_bo_list_in) / 4;
|
chunks[num_chunks].length_dw = sizeof(struct drm_amdgpu_bo_list_in) / 4;
|
||||||
chunks[num_chunks].chunk_data = (uintptr_t)&bo_list_in;
|
chunks[num_chunks].chunk_data = (uintptr_t)&bo_list_in;
|
||||||
num_chunks++;
|
num_chunks++;
|
||||||
}
|
|
||||||
|
|
||||||
/* The kernel returns -ENOMEM with many parallel processes using GDS such as test suites quite
|
/* The kernel returns -ENOMEM with many parallel processes using GDS such as test suites quite
|
||||||
* often, but it eventually succeeds after enough attempts. This happens frequently with dEQP
|
* often, but it eventually succeeds after enough attempts. This happens frequently with dEQP
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue