From 9fa6e4aa2daee99ff5f6efc11232de22100bac80 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sun, 21 Oct 2012 12:48:06 +0100 Subject: intel: Sanity check that the platform probes points to a i915.ko GEM device References: https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-intel/+bug/1069031 Signed-off-by: Chris Wilson --- src/intel_module.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/intel_module.c') diff --git a/src/intel_module.c b/src/intel_module.c index e6ca964d..ef62667f 100644 --- a/src/intel_module.c +++ b/src/intel_module.c @@ -383,7 +383,7 @@ static Bool intel_driver_func(ScrnInfoPtr pScrn, } } -static Bool has_kernel_mode_setting(struct pci_device *dev) +static Bool has_kernel_mode_setting(const struct pci_device *dev) { char id[20]; int ret, fd; @@ -418,7 +418,6 @@ static Bool has_kernel_mode_setting(struct pci_device *dev) if (drmIoctl(fd, DRM_IOCTL_I915_GETPARAM, &gp)) ret = FALSE; } - close(fd); } @@ -559,6 +558,9 @@ intel_platform_probe(DriverPtr driver, if (!dev->pdev) return FALSE; + if (!has_kernel_mode_setting(dev->pdev)) + return FALSE; + /* Allow ourselves to act as a slaved output if not primary */ if (flags & PLATFORM_PROBE_GPU_SCREEN) { flags &= ~PLATFORM_PROBE_GPU_SCREEN; -- cgit v1.2.3