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>
This commit is contained in:
Chris Wilson 2012-10-21 12:48:06 +01:00
parent f6eed98fcf
commit 9fa6e4aa2d
1 changed files with 4 additions and 2 deletions

View File

@ -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;