aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--xf86drm.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/xf86drm.c b/xf86drm.c
index f0fc4ee2..56353812 100644
--- a/xf86drm.c
+++ b/xf86drm.c
@@ -2947,6 +2947,30 @@ static int drmParsePciBusInfo(int maj, int min, drmPciBusInfoPtr info)
2947 info->func = func; 2947 info->func = func;
2948 2948
2949 return 0; 2949 return 0;
2950#elif defined(__OpenBSD__)
2951 struct drm_pciinfo pinfo;
2952 int fd, type;
2953
2954 type = drmGetMinorType(min);
2955 if (type == -1)
2956 return -ENODEV;
2957
2958 fd = drmOpenMinor(min, 0, type);
2959 if (fd < 0)
2960 return -errno;
2961
2962 if (drmIoctl(fd, DRM_IOCTL_GET_PCIINFO, &pinfo)) {
2963 close(fd);
2964 return -errno;
2965 }
2966 close(fd);
2967
2968 info->domain = pinfo.domain;
2969 info->bus = pinfo.bus;
2970 info->dev = pinfo.dev;
2971 info->func = pinfo.func;
2972
2973 return 0;
2950#else 2974#else
2951#warning "Missing implementation of drmParsePciBusInfo" 2975#warning "Missing implementation of drmParsePciBusInfo"
2952 return -EINVAL; 2976 return -EINVAL;