drm/i915: Add module param to test the load detect code
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 3 Mar 2015 17:03:47 +0000 (18:03 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Fri, 27 Mar 2015 10:22:52 +0000 (11:22 +0100)
This is useful for writing igts to make sure we don't break this,
without being forced to own a one of these dinosaurs.

Suggested-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Cc: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Reviewed-by: Ander Conselvan de Oliveira <conselvan2@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/i915_params.c
drivers/gpu/drm/i915/intel_crt.c

index a4db7a7db444a92bf0cfbed64da4b20930deed40..6ccdf954b1ca50b88d2d5638ffd2a04620bb3bc1 100644 (file)
@@ -2462,6 +2462,7 @@ struct i915_params {
        bool enable_hangcheck;
        bool fastboot;
        bool prefault_disable;
+       bool load_detect_test;
        bool reset;
        bool disable_display;
        bool disable_vtd_wa;
index f3b8b62cb74d9a2620cf1a4da1baf981d177daf3..bb64415a1c3ec42b594b547e8d48734b4aab188f 100644 (file)
@@ -43,6 +43,7 @@ struct i915_params i915 __read_mostly = {
        .enable_ips = 1,
        .fastboot = 0,
        .prefault_disable = 0,
+       .load_detect_test = 0,
        .reset = true,
        .invert_brightness = 0,
        .disable_display = 0,
@@ -139,11 +140,16 @@ module_param_named(fastboot, i915.fastboot, bool, 0600);
 MODULE_PARM_DESC(fastboot,
        "Try to skip unnecessary mode sets at boot time (default: false)");
 
-module_param_named(prefault_disable, i915.prefault_disable, bool, 0600);
+module_param_named_unsafe(prefault_disable, i915.prefault_disable, bool, 0600);
 MODULE_PARM_DESC(prefault_disable,
        "Disable page prefaulting for pread/pwrite/reloc (default:false). "
        "For developers only.");
 
+module_param_named_unsafe(load_detect_test, i915.load_detect_test, bool, 0600);
+MODULE_PARM_DESC(load_detect_test,
+       "Force-enable the VGA load detect code for testing (default:false). "
+       "For developers only.");
+
 module_param_named(invert_brightness, i915.invert_brightness, int, 0600);
 MODULE_PARM_DESC(invert_brightness,
        "Invert backlight brightness "
index 573aaff3389a2148a2941004d1cae2bbd1244963..6095a998bdac38d32bc2abb30f8d82ee4bbd7f36 100644 (file)
@@ -690,7 +690,7 @@ intel_crt_detect(struct drm_connector *connector, bool force)
         * broken monitor (without edid) to work behind a broken kvm (that fails
         * to have the right resistors for HP detection) needs to fix this up.
         * For now just bail out. */
-       if (I915_HAS_HOTPLUG(dev)) {
+       if (I915_HAS_HOTPLUG(dev) && !i915.load_detect_test) {
                status = connector_status_disconnected;
                goto out;
        }
@@ -706,8 +706,10 @@ intel_crt_detect(struct drm_connector *connector, bool force)
        if (intel_get_load_detect_pipe(connector, NULL, &tmp, &ctx)) {
                if (intel_crt_detect_ddc(connector))
                        status = connector_status_connected;
-               else
+               else if (INTEL_INFO(dev)->gen < 4)
                        status = intel_crt_load_detect(crt);
+               else
+                       status = connector_status_unknown;
                intel_release_load_detect_pipe(connector, &tmp, &ctx);
        } else
                status = connector_status_unknown;