summaryrefslogtreecommitdiff
path: root/lib/mesa/src/loader
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2020-08-26 05:30:39 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2020-08-26 05:30:39 +0000
commit27c93456b58343162f7c4ad20ca6bea0c9a91646 (patch)
tree945c20b63e0b9975ee40f114c5312f8d8f1a2d0b /lib/mesa/src/loader
parent875b83a3ee95e248388fbf72271acc80f6f97987 (diff)
Import Mesa 20.1.6
Diffstat (limited to 'lib/mesa/src/loader')
-rw-r--r--lib/mesa/src/loader/meson.build20
-rw-r--r--lib/mesa/src/loader/pci_id_driver_map.c8
-rw-r--r--lib/mesa/src/loader/pci_id_driver_map.h31
3 files changed, 25 insertions, 34 deletions
diff --git a/lib/mesa/src/loader/meson.build b/lib/mesa/src/loader/meson.build
index 69c81688b..e7dce88d4 100644
--- a/lib/mesa/src/loader/meson.build
+++ b/lib/mesa/src/loader/meson.build
@@ -23,7 +23,7 @@ inc_loader = include_directories('.')
if with_platform_x11 and with_dri3
libloader_dri3_helper = static_library(
'loader_dri3_helper',
- ['loader_dri3_helper.c', 'loader_dri3_helper.h'],
+ 'loader_dri3_helper.c',
c_args : c_vis_args,
include_directories : [inc_include, inc_src],
dependencies : [
@@ -35,14 +35,20 @@ else
libloader_dri3_helper = []
endif
+loader_c_args = [
+ c_vis_args, '-DUSE_DRICONF',
+ '-DDEFAULT_DRIVER_DIR="@0@"'.format(dri_search_path),
+]
+
+if with_gallium_iris and get_option('prefer-iris')
+ loader_c_args += ['-DPREFER_IRIS']
+endif
+
libloader = static_library(
'loader',
- ['loader.c', 'loader.h', 'pci_id_driver_map.c', 'pci_id_driver_map.h',
- xmlpool_options_h],
- c_args : [c_vis_args, '-DUSE_DRICONF',
- '-DDEFAULT_DRIVER_DIR="@0@"'.format(dri_search_path),
-],
+ ['loader.c', 'pci_id_driver_map.c'],
+ c_args : loader_c_args,
include_directories : [inc_include, inc_src, inc_util],
- dependencies : [dep_libdrm, dep_thread],
+ dependencies : [dep_libdrm, dep_thread, idep_xmlconfig_headers],
build_by_default : false,
)
diff --git a/lib/mesa/src/loader/pci_id_driver_map.c b/lib/mesa/src/loader/pci_id_driver_map.c
index 8b2079e43..d599abf78 100644
--- a/lib/mesa/src/loader/pci_id_driver_map.c
+++ b/lib/mesa/src/loader/pci_id_driver_map.c
@@ -21,7 +21,9 @@
* SOFTWARE.
*/
-int is_nouveau_vieux(int fd);
+#include <stdbool.h>
+
+bool is_nouveau_vieux(int fd);
#ifdef HAVE_LIBDRM
@@ -42,7 +44,7 @@ nouveau_chipset(int fd)
return gp.value;
}
-int
+bool
is_nouveau_vieux(int fd)
{
int chipset = nouveau_chipset(fd);
@@ -52,6 +54,6 @@ is_nouveau_vieux(int fd)
#else
-int is_nouveau_vieux(int fd) { return 0; }
+bool is_nouveau_vieux(int fd) { return false; }
#endif
diff --git a/lib/mesa/src/loader/pci_id_driver_map.h b/lib/mesa/src/loader/pci_id_driver_map.h
index 99fe4ad21..1dc07be39 100644
--- a/lib/mesa/src/loader/pci_id_driver_map.h
+++ b/lib/mesa/src/loader/pci_id_driver_map.h
@@ -1,12 +1,9 @@
#ifndef _PCI_ID_DRIVER_MAP_H_
#define _PCI_ID_DRIVER_MAP_H_
+#include <stdbool.h>
#include <stddef.h>
-#ifndef ARRAY_SIZE
-#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
-#endif
-
#ifndef __IS_LOADER
# error "Only include from loader.c"
#endif
@@ -18,19 +15,11 @@ static const int i915_chip_ids[] = {
};
static const int i965_chip_ids[] = {
-#define CHIPSET(chip, family, name) chip,
+#define CHIPSET(chip, family, family_str, name) chip,
#include "pci_ids/i965_pci_ids.h"
#undef CHIPSET
};
-static const int iris_chip_ids[] = {
-#define CHIPSET(chip, family, name) chip,
-#define IRIS 1
-#include "pci_ids/i965_pci_ids.h"
-#undef IRIS
-#undef CHIPSET
-};
-
static const int r100_chip_ids[] = {
#define CHIPSET(chip, name, family) chip,
#include "pci_ids/radeon_pci_ids.h"
@@ -55,12 +44,6 @@ static const int r600_chip_ids[] = {
#undef CHIPSET
};
-static const int radeonsi_chip_ids[] = {
-#define CHIPSET(chip, family) chip,
-#include "pci_ids/radeonsi_pci_ids.h"
-#undef CHIPSET
-};
-
static const int virtio_gpu_chip_ids[] = {
#define CHIPSET(chip, name, family) chip,
#include "pci_ids/virtio_gpu_pci_ids.h"
@@ -73,28 +56,28 @@ static const int vmwgfx_chip_ids[] = {
#undef CHIPSET
};
-int is_nouveau_vieux(int fd);
+bool is_nouveau_vieux(int fd);
+bool is_kernel_i915(int fd);
static const struct {
int vendor_id;
const char *driver;
const int *chip_ids;
int num_chips_ids;
- int (*predicate)(int fd);
+ bool (*predicate)(int fd);
} driver_map[] = {
{ 0x8086, "i915", i915_chip_ids, ARRAY_SIZE(i915_chip_ids) },
{ 0x8086, "i965", i965_chip_ids, ARRAY_SIZE(i965_chip_ids) },
- { 0x8086, "iris", iris_chip_ids, ARRAY_SIZE(iris_chip_ids) },
+ { 0x8086, "iris", NULL, -1, is_kernel_i915 },
{ 0x1002, "radeon", r100_chip_ids, ARRAY_SIZE(r100_chip_ids) },
{ 0x1002, "r200", r200_chip_ids, ARRAY_SIZE(r200_chip_ids) },
{ 0x1002, "r300", r300_chip_ids, ARRAY_SIZE(r300_chip_ids) },
{ 0x1002, "r600", r600_chip_ids, ARRAY_SIZE(r600_chip_ids) },
- { 0x1002, "radeonsi", radeonsi_chip_ids, ARRAY_SIZE(radeonsi_chip_ids) },
+ { 0x1002, "radeonsi", NULL, -1 },
{ 0x10de, "nouveau_vieux", NULL, -1, is_nouveau_vieux },
{ 0x10de, "nouveau", NULL, -1, },
{ 0x1af4, "virtio_gpu", virtio_gpu_chip_ids, ARRAY_SIZE(virtio_gpu_chip_ids) },
{ 0x15ad, "vmwgfx", vmwgfx_chip_ids, ARRAY_SIZE(vmwgfx_chip_ids) },
- { 0x0000, NULL, NULL, 0 },
};
#endif /* _PCI_ID_DRIVER_MAP_H_ */