mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-09 17:00:13 +01:00
radv/android: Add android hardware buffer field to device memory.
You cannot go from BO to Android hardware buffer, so for export we have to remember it. Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
This commit is contained in:
parent
9ea72b5337
commit
a34e4dd0d2
2 changed files with 13 additions and 0 deletions
|
|
@ -3427,6 +3427,11 @@ static void radv_free_memory(struct radv_device *device,
|
|||
if (mem == NULL)
|
||||
return;
|
||||
|
||||
#if RADV_SUPPORT_ANDROID_HARDWARE_BUFFER
|
||||
if (mem->android_hardware_buffer)
|
||||
AHardwareBuffer_release(mem->android_hardware_buffer);
|
||||
#endif
|
||||
|
||||
if (mem->bo) {
|
||||
radv_bo_list_remove(device, mem->bo);
|
||||
device->ws->buffer_destroy(mem->bo);
|
||||
|
|
@ -3496,6 +3501,10 @@ static VkResult radv_alloc_memory(struct radv_device *device,
|
|||
mem->user_ptr = NULL;
|
||||
mem->bo = NULL;
|
||||
|
||||
#if RADV_SUPPORT_ANDROID_HARDWARE_BUFFER
|
||||
mem->android_hardware_buffer = NULL;
|
||||
#endif
|
||||
|
||||
if (import_info) {
|
||||
assert(import_info->handleType ==
|
||||
VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT ||
|
||||
|
|
|
|||
|
|
@ -787,6 +787,10 @@ struct radv_device_memory {
|
|||
VkDeviceSize map_size;
|
||||
void * map;
|
||||
void * user_ptr;
|
||||
|
||||
#if RADV_SUPPORT_ANDROID_HARDWARE_BUFFER
|
||||
struct AHardwareBuffer * android_hardware_buffer;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue