Skip to content
Snippets Groups Projects
Commit af22427b authored by Simon McVittie's avatar Simon McVittie
Browse files

runtime: Use the appropriate multiarch slot, even for VA-API


Using only the 0th slot doesn't actually save us any memory, and being
consistent about what the slots mean will make it easier to factor out
common code.

Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
parent 4a6b3122
No related branches found
No related tags found
No related merge requests found
...@@ -1466,11 +1466,8 @@ pv_runtime_use_host_graphics_stack (PvRuntime *self, ...@@ -1466,11 +1466,8 @@ pv_runtime_use_host_graphics_stack (PvRuntime *self,
g_assert (details->resolved_library != NULL); g_assert (details->resolved_library != NULL);
g_assert (g_path_is_absolute (details->resolved_library)); g_assert (g_path_is_absolute (details->resolved_library));
/* We don't reuse the same IcdDetails for different multiarch.
* So we pass zero as the multiarch_index parameter to always fill
* just the first element in the array. */
if (!bind_icd (self, if (!bind_icd (self,
0, arch->multiarch_index,
j, j,
arch->capsule_capture_libs, arch->capsule_capture_libs,
arch->libdir_on_host, arch->libdir_on_host,
...@@ -1957,22 +1954,29 @@ pv_runtime_use_host_graphics_stack (PvRuntime *self, ...@@ -1957,22 +1954,29 @@ pv_runtime_use_host_graphics_stack (PvRuntime *self,
} }
} }
for (i = 0; i < va_api_icd_details->len; i++) for (j = 0; j < va_api_icd_details->len; j++)
{ {
IcdDetails *details = g_ptr_array_index (va_api_icd_details, i); IcdDetails *details = g_ptr_array_index (va_api_icd_details, j);
G_STATIC_ASSERT (G_N_ELEMENTS (details->kinds) > 1); for (i = 0; i < G_N_ELEMENTS (multiarch_tuples) - 1; i++)
G_STATIC_ASSERT (G_N_ELEMENTS (details->paths_in_container) > 1); {
/* We add entries in va_api_icd_details only after a successful bind, g_assert (i < G_N_ELEMENTS (details->kinds));
* so we expect to always have ICD_KIND_ABSOLUTE. g_assert (i < G_N_ELEMENTS (details->paths_in_container));
* Also we use IcdDetails for a single multiarch always added as the first element.
* Because of that we expect the second element to be NONEXISTENT. */ if (details->kinds[i] == ICD_KIND_NONEXISTENT)
g_assert (details->kinds[0] == ICD_KIND_ABSOLUTE); {
g_assert (details->kinds[1] == ICD_KIND_NONEXISTENT); continue;
g_assert (details->paths_in_container[1] == NULL); }
else
g_autofree gchar *va_api_binded_path = g_path_get_dirname (details->paths_in_container[0]); {
pv_search_path_append (va_api_path, va_api_binded_path); g_autofree gchar *parent = NULL;
g_assert (details->kinds[i] == ICD_KIND_ABSOLUTE);
parent = g_path_get_dirname (details->paths_in_container[i]);
pv_search_path_append (va_api_path, parent);
}
}
} }
if (dri_path->len != 0) if (dri_path->len != 0)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment