+ bo_data_array = calloc(*num_bos, sizeof(tbm_bo_data *));
+ TBM_RETURN_VAL_IF_FAIL(bo_data_array, NULL);
+
+ for (i = 0; i < *num_bos; i++) {
+ bo_data_array[i] = calloc(*num_bos, sizeof(struct _tbm_bo_data));
+ TBM_GOTO_VAL_SET_ERR_IF_FAIL(bo_data_array[i], failed, *error, TBM_ERROR_OUT_OF_MEMORY);
+ }
+
+ for (i = 0; i < *num_bos; i++) {
+ bo_data_array[i]->hal_bo = hal_bos[i];
+ bo_data_array[i]->module = surface_data->module;
+ }
+
+ // get memory_types(bo flags)
+ *memory_types = tbm_bo_data_get_memory_types(bo_data_array[0], error);
+ TBM_GOTO_VAL_IF_FAIL(*error == TBM_ERROR_NONE, failed);
+
+ return bo_data_array;
+
+/* LCOV_EXCL_START */
+failed:
+ for (i = 0; i < *num_bos; i++) {
+ if (bo_data_array[i])
+ free(bo_data_array[i]);
+ }
+ free(bo_data_array);
+
+ return NULL;
+/* LCOV_EXCL_STOP */