diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-10-21 12:48:06 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-10-21 12:48:06 +0100 |
commit | 9fa6e4aa2daee99ff5f6efc11232de22100bac80 (patch) | |
tree | e45e2875cd0f7ec2ac5e48776202e51dff89cdbf /src/intel_module.c | |
parent | f6eed98fcfea54d50a282ac71ee654645551ae11 (diff) |
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 <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/intel_module.c')
-rw-r--r-- | src/intel_module.c | 6 |
1 files changed, 4 insertions, 2 deletions
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; |