void
drm_shim_driver_init(void)
{
+ shim_device.bus_type = DRM_BUS_PLATFORM;
shim_device.driver_name = "v3d";
drm_shim_override_file("OF_FULLNAME=/rdb/v3d\n"
void
drm_shim_driver_init(void)
{
+ shim_device.bus_type = DRM_BUS_PLATFORM;
shim_device.driver_name = "v3d";
shim_device.driver_ioctls = driver_ioctls;
shim_device.driver_ioctl_count = ARRAY_SIZE(driver_ioctls);
if (strcmp(path, subsystem_path) != 0)
return real_readlink(path, buf, size);
- strncpy(buf, "/platform", size);
- buf[size - 1] = 0;
+
+ static const struct {
+ const char *name;
+ int bus_type;
+ } bus_types[] = {
+ { "/pci", DRM_BUS_PCI },
+ { "/usb", DRM_BUS_USB },
+ { "/platform", DRM_BUS_PLATFORM },
+ { "/spi", DRM_BUS_PLATFORM },
+ { "/host1x", DRM_BUS_HOST1X },
+ };
+
+ for (uint32_t i = 0; i < ARRAY_SIZE(bus_types); i++) {
+ if (bus_types[i].bus_type != shim_device.bus_type)
+ continue;
+
+ strncpy(buf, bus_types[i].name, size);
+ buf[size - 1] = 0;
+ break;
+ }
return strlen(buf) + 1;
}
#include "util/macros.h"
#include "util/hash_table.h"
+#include <xf86drm.h>
+
#ifdef __linux__
#define DRM_MAJOR 226
#endif
/* Returned by drmGetVersion(). */
const char *driver_name;
int version_major, version_minor, version_patchlevel;
+ int bus_type;
};
extern struct shim_device shim_device;
'drm_shim.c',
],
include_directories: [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux],
- dependencies: [idep_mesautil, dep_dl],
+ dependencies: [dep_libdrm, idep_mesautil, dep_dl],
c_args : [c_vis_args, '-std=gnu99'],
)
dep_drm_shim = declare_dependency(
- link_with: drm_shim
+ link_with: drm_shim,
+ dependencies: dep_libdrm,
)
void
drm_shim_driver_init(void)
{
+ shim_device.bus_type = DRM_BUS_PLATFORM;
shim_device.driver_name = "etnaviv";
shim_device.driver_ioctls = driver_ioctls;
shim_device.driver_ioctl_count = ARRAY_SIZE(driver_ioctls);
void
drm_shim_driver_init(void)
{
+ shim_device.bus_type = DRM_BUS_PLATFORM;
shim_device.driver_name = "msm";
shim_device.driver_ioctls = driver_ioctls;
shim_device.driver_ioctl_count = ARRAY_SIZE(driver_ioctls);