15db71995Sopenharmony_ci/* 25db71995Sopenharmony_ci * 35db71995Sopenharmony_ci * Copyright (c) 2021-2022 The Khronos Group Inc. 45db71995Sopenharmony_ci * Copyright (c) 2021-2022 Valve Corporation 55db71995Sopenharmony_ci * Copyright (c) 2021-2022 LunarG, Inc. 65db71995Sopenharmony_ci * 75db71995Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 85db71995Sopenharmony_ci * you may not use this file except in compliance with the License. 95db71995Sopenharmony_ci * You may obtain a copy of the License at 105db71995Sopenharmony_ci * 115db71995Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 125db71995Sopenharmony_ci * 135db71995Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software 145db71995Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 155db71995Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 165db71995Sopenharmony_ci * See the License for the specific language governing permissions and 175db71995Sopenharmony_ci * limitations under the License. 185db71995Sopenharmony_ci * 195db71995Sopenharmony_ci * Author: Mark Young <marky@lunarg.com> 205db71995Sopenharmony_ci * 215db71995Sopenharmony_ci */ 225db71995Sopenharmony_ci 235db71995Sopenharmony_ci#pragma once 245db71995Sopenharmony_ci 255db71995Sopenharmony_ci#if defined(LOADER_ENABLE_LINUX_SORT) 265db71995Sopenharmony_ci 275db71995Sopenharmony_ci#include "loader_common.h" 285db71995Sopenharmony_ci 295db71995Sopenharmony_ci// This function allocates an array in sorted_devices which must be freed by the caller if not null 305db71995Sopenharmony_ciVkResult linux_read_sorted_physical_devices(struct loader_instance *inst, uint32_t icd_count, 315db71995Sopenharmony_ci struct loader_icd_physical_devices *icd_devices, uint32_t phys_dev_count, 325db71995Sopenharmony_ci struct loader_physical_device_term **sorted_device_term); 335db71995Sopenharmony_ci 345db71995Sopenharmony_ci// This function sorts an array in physical device groups 355db71995Sopenharmony_ciVkResult linux_sort_physical_device_groups(struct loader_instance *inst, uint32_t group_count, 365db71995Sopenharmony_ci struct loader_physical_device_group_term *sorted_group_term); 375db71995Sopenharmony_ci 385db71995Sopenharmony_ci#endif // LOADER_ENABLE_LINUX_SORT 39