@@ -392,11 +392,17 @@ static Bool has_kernel_mode_setting(struct pci_device *dev)
ret = FALSE;
fd = drmOpen(NULL, id);
if (fd != -1) {
- struct drm_i915_getparam gp;
+ drmVersionPtr v;
- gp.param = I915_PARAM_HAS_GEM;
- gp.value = &ret;
- (void)drmIoctl(fd, DRM_IOCTL_I915_GETPARAM, &gp);
+ v = drmGetVersion(fd);
+ if (v && !strcmp(v->name, "i915")) {
+ struct drm_i915_getparam gp;
+
+ gp.param = I915_PARAM_HAS_GEM;
+ gp.value = &ret;
+ (void)drmIoctl(fd, DRM_IOCTL_I915_GETPARAM, &gp);
+ }
+ drmFreeVersion(v);
close(fd);
}
Signed-off-by: Adam Jackson <ajax@redhat.com> --- src/intel_module.c | 14 ++++++++++---- 1 files changed, 10 insertions(+), 4 deletions(-)