[magma] Switch to magma_buffer_export,magma_semaphore_export

Run-All-Tests: True

Bug:108279
Change-Id: I2a97cfeb7aefac9d076f38952da51699410bcca9
Reviewed-on: https://fuchsia-review.googlesource.com/c/third_party/mesa/+/807570
Reviewed-by: John Bauman <jbauman@google.com>
diff --git a/src/gbm/backends/magma/gbm_magma.c b/src/gbm/backends/magma/gbm_magma.c
index 5d0c581..abc41f7 100644
--- a/src/gbm/backends/magma/gbm_magma.c
+++ b/src/gbm/backends/magma/gbm_magma.c
@@ -303,10 +303,9 @@
    }
 
    magma_handle_t handle;
-   magma_status_t status =
-       magma_connection_export_buffer(magma_device(bo->gbm)->connection, magma_bo(bo)->image, &handle);
+   magma_status_t status = magma_buffer_export(magma_bo(bo)->image, &handle);
    if (status != MAGMA_STATUS_OK) {
-      LOG_VERBOSE("magma_export failed: %d\n", status);
+      LOG_VERBOSE("magma_buffer_export failed: %d\n", status);
       return -1;
    }
    int fd = handle;
diff --git a/src/intel/vulkan/anv_magma.c b/src/intel/vulkan/anv_magma.c
index 7b6e640..0f6757a 100644
--- a/src/intel/vulkan/anv_magma.c
+++ b/src/intel/vulkan/anv_magma.c
@@ -351,8 +351,7 @@
    }
 
    uint32_t handle = 0;
-   magma_status_t result = magma_connection_export_buffer(
-      magma_connection(device), buffer_object->buffer, &handle);
+   magma_status_t result = magma_buffer_export(buffer_object->buffer, &handle);
 
    assert(result == MAGMA_STATUS_OK);
 
@@ -431,8 +430,7 @@
       get_anv_connection(device->vk.magma_connection)->buffer_map, gem_handle);
    assert(buffer_object);
 
-   magma_status_t result = magma_connection_export_buffer(magma_connection(device),
-      buffer_object->buffer, pHandle);
+   magma_status_t result = magma_buffer_export(buffer_object->buffer, pHandle);
    assert(result == MAGMA_STATUS_OK);
 
    return VK_SUCCESS;
diff --git a/src/vulkan/runtime/vk_magma_syncobj.c b/src/vulkan/runtime/vk_magma_syncobj.c
index 15291cf..d1903a7 100644
--- a/src/vulkan/runtime/vk_magma_syncobj.c
+++ b/src/vulkan/runtime/vk_magma_syncobj.c
@@ -188,15 +188,12 @@
 {
    struct vk_magma_syncobj *sobj = to_magma_syncobj(sync);
 
-   assert(device->magma_connection);
    magma_handle_t handle;
-
-   magma_status_t status = magma_connection_export_semaphore(
-      device->magma_connection->connection, sobj->semaphore, &handle);
+   magma_status_t status = magma_semaphore_export(sobj->semaphore, &handle);
 
    if (status != MAGMA_STATUS_OK) {
       return vk_errorf(device, VK_ERROR_UNKNOWN,
-                       "magma_export_semaphore failed: %m");
+                       "magma_semaphore_export failed: %m");
    }
 
    *handle_out = handle;