xf86-video-intel: src/intel_module.c

Chris Wilson ickle at kemper.freedesktop.org
Sun Feb 17 01:35:14 PST 2013


 src/intel_module.c |    9 +++++++++
 1 file changed, 9 insertions(+)

New commits:
commit 43ba22ef4a4142f334e9ae2d926250988ecbe8bc
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Sun Feb 17 09:25:38 2013 +0000

    Confirm that i915.ko has KMS enabled before binding to the device
    
    If the kernel has the module, but the KMS module option is not enabled,
    we cannot function. So after checking to see if the i915.ko is bound,
    then querying whether it provides any KMS resources. If it has no CRTCs
    attached, then we need to failover to the VESA/fbdev drivers. Note that
    this should have been detected by drmCheckModesettingSupported()
    
    References: https://bugs.freedesktop.org/show_bug.cgi?id=60987
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/intel_module.c b/src/intel_module.c
index 141f77a..bd9b9bb 100644
--- a/src/intel_module.c
+++ b/src/intel_module.c
@@ -419,6 +419,15 @@ static Bool has_kernel_mode_setting(const struct pci_device *dev)
 			if (drmIoctl(fd, DRM_IOCTL_I915_GETPARAM, &gp))
 				ret = FALSE;
 		}
+		if (ret) {
+			struct drm_mode_card_res res;
+
+			memset(&res, 0, sizeof(res));
+			if (drmIoctl(fd, DRM_IOCTL_MODE_GETRESOURCES, &res) == 0)
+				ret = res.count_crtcs != 0;
+			else
+				ret = FALSE;
+		}
 		close(fd);
 	}
 


More information about the xorg-commit mailing list