mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 04:48:08 +02:00
anv: put private binding BOs into execlists
Not doing so all the reads/writes go to the scratch page on i915. Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Fixes:f9fa09ec92("anv/image: Add ANV_IMAGE_MEMORY_BINDING_PRIVATE") Reviewed-by: Tapani Pälli <tapani.palli@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22957> (cherry picked from commit7f7b2fc53a)
This commit is contained in:
parent
196ea99520
commit
754e0e2176
5 changed files with 35 additions and 5 deletions
|
|
@ -1606,7 +1606,7 @@
|
|||
"description": "anv: put private binding BOs into execlists",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "f9fa09ec92f68a5c05a7019bde6e620d25e8ba48"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -3131,6 +3131,7 @@ VkResult anv_CreateDevice(
|
|||
HIGH_HEAP_MIN_ADDRESS);
|
||||
|
||||
list_inithead(&device->memory_objects);
|
||||
list_inithead(&device->image_private_objects);
|
||||
|
||||
if (pthread_mutex_init(&device->mutex, NULL) != 0) {
|
||||
result = vk_error(device, VK_ERROR_INITIALIZATION_FAILED);
|
||||
|
|
|
|||
|
|
@ -1328,9 +1328,16 @@ alloc_private_binding(struct anv_device *device,
|
|||
return VK_SUCCESS;
|
||||
}
|
||||
|
||||
return anv_device_alloc_bo(device, "image-binding-private",
|
||||
binding->memory_range.size, 0, 0,
|
||||
&binding->address.bo);
|
||||
VkResult result = anv_device_alloc_bo(device, "image-binding-private",
|
||||
binding->memory_range.size, 0, 0,
|
||||
&binding->address.bo);
|
||||
if (result == VK_SUCCESS) {
|
||||
pthread_mutex_lock(&device->mutex);
|
||||
list_addtail(&image->link, &device->image_private_objects);
|
||||
pthread_mutex_unlock(&device->mutex);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
VkResult
|
||||
|
|
@ -1470,8 +1477,12 @@ anv_image_finish(struct anv_image *image)
|
|||
}
|
||||
|
||||
struct anv_bo *private_bo = image->bindings[ANV_IMAGE_MEMORY_BINDING_PRIVATE].address.bo;
|
||||
if (private_bo)
|
||||
if (private_bo) {
|
||||
pthread_mutex_lock(&device->mutex);
|
||||
list_del(&image->link);
|
||||
pthread_mutex_unlock(&device->mutex);
|
||||
anv_device_release_bo(device, private_bo);
|
||||
}
|
||||
|
||||
vk_image_finish(&image->vk);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1134,6 +1134,9 @@ struct anv_device {
|
|||
/** List of all anv_device_memory objects */
|
||||
struct list_head memory_objects;
|
||||
|
||||
/** List of anv_image objects with a private binding for implicit CCS */
|
||||
struct list_head image_private_objects;
|
||||
|
||||
struct anv_bo_pool batch_bo_pool;
|
||||
struct anv_bo_pool utrace_bo_pool;
|
||||
|
||||
|
|
@ -3641,6 +3644,9 @@ struct anv_image {
|
|||
} planes[3];
|
||||
|
||||
struct anv_image_memory_range vid_dmv_top_surface;
|
||||
|
||||
/* Link in the anv_device.image_private_objects list */
|
||||
struct list_head link;
|
||||
};
|
||||
|
||||
static inline bool
|
||||
|
|
|
|||
|
|
@ -378,6 +378,18 @@ setup_execbuf_for_cmd_buffers(struct anv_execbuf *execbuf,
|
|||
return result;
|
||||
}
|
||||
|
||||
/* Add all the private BOs from images because we can't track after binding
|
||||
* updates of VK_EXT_descriptor_indexing.
|
||||
*/
|
||||
list_for_each_entry(struct anv_image, image,
|
||||
&device->image_private_objects, link) {
|
||||
struct anv_bo *private_bo =
|
||||
image->bindings[ANV_IMAGE_MEMORY_BINDING_PRIVATE].address.bo;
|
||||
result = anv_execbuf_add_bo(device, execbuf, private_bo, NULL, 0);
|
||||
if (result != VK_SUCCESS)
|
||||
return result;
|
||||
}
|
||||
|
||||
struct anv_batch_bo *first_batch_bo =
|
||||
list_first_entry(&cmd_buffers[0]->batch_bos, struct anv_batch_bo, link);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue