Subversion Repositories Kolibri OS

Rev

Rev 3031 | Rev 3243 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3031 Rev 3120
Line 2210... Line 2210...
2210
 
2210
 
2211
	if (intel_sdvo_is_hdmi_connector(intel_sdvo, device)) {
2211
	if (intel_sdvo_is_hdmi_connector(intel_sdvo, device)) {
2212
		connector->connector_type = DRM_MODE_CONNECTOR_HDMIA;
2212
		connector->connector_type = DRM_MODE_CONNECTOR_HDMIA;
2213
		intel_sdvo->is_hdmi = true;
2213
		intel_sdvo->is_hdmi = true;
2214
	}
-
 
Line 2215... Line 2214...
2215
	intel_sdvo->base.cloneable = true;
2214
	}
2216
 
2215
 
2217
	intel_sdvo_connector_init(intel_sdvo_connector, intel_sdvo);
2216
	intel_sdvo_connector_init(intel_sdvo_connector, intel_sdvo);
Line 2241... Line 2240...
2241
	intel_sdvo->controlled_output |= type;
2240
	intel_sdvo->controlled_output |= type;
2242
	intel_sdvo_connector->output_flag = type;
2241
	intel_sdvo_connector->output_flag = type;
Line 2243... Line 2242...
2243
 
2242
 
2244
	intel_sdvo->is_tv = true;
2243
	intel_sdvo->is_tv = true;
2245
	intel_sdvo->base.needs_tv_clock = true;
-
 
Line 2246... Line 2244...
2246
	intel_sdvo->base.cloneable = false;
2244
	intel_sdvo->base.needs_tv_clock = true;
Line 2247... Line 2245...
2247
 
2245
 
2248
	intel_sdvo_connector_init(intel_sdvo_connector, intel_sdvo);
2246
	intel_sdvo_connector_init(intel_sdvo_connector, intel_sdvo);
Line 2284... Line 2282...
2284
	} else if (device == 1) {
2282
	} else if (device == 1) {
2285
		intel_sdvo->controlled_output |= SDVO_OUTPUT_RGB1;
2283
		intel_sdvo->controlled_output |= SDVO_OUTPUT_RGB1;
2286
		intel_sdvo_connector->output_flag = SDVO_OUTPUT_RGB1;
2284
		intel_sdvo_connector->output_flag = SDVO_OUTPUT_RGB1;
2287
	}
2285
	}
Line 2288... Line -...
2288
 
-
 
2289
	intel_sdvo->base.cloneable = true;
-
 
2290
 
2286
 
2291
	intel_sdvo_connector_init(intel_sdvo_connector,
2287
	intel_sdvo_connector_init(intel_sdvo_connector,
2292
				  intel_sdvo);
2288
				  intel_sdvo);
2293
	return true;
2289
	return true;
Line 2316... Line 2312...
2316
	} else if (device == 1) {
2312
	} else if (device == 1) {
2317
		intel_sdvo->controlled_output |= SDVO_OUTPUT_LVDS1;
2313
		intel_sdvo->controlled_output |= SDVO_OUTPUT_LVDS1;
2318
		intel_sdvo_connector->output_flag = SDVO_OUTPUT_LVDS1;
2314
		intel_sdvo_connector->output_flag = SDVO_OUTPUT_LVDS1;
2319
	}
2315
	}
Line 2320... Line -...
2320
 
-
 
2321
	/* SDVO LVDS is not cloneable because the input mode gets adjusted by the encoder */
-
 
2322
	intel_sdvo->base.cloneable = false;
-
 
2323
 
2316
 
2324
	intel_sdvo_connector_init(intel_sdvo_connector, intel_sdvo);
2317
	intel_sdvo_connector_init(intel_sdvo_connector, intel_sdvo);
2325
	if (!intel_sdvo_create_enhance_property(intel_sdvo, intel_sdvo_connector))
2318
	if (!intel_sdvo_create_enhance_property(intel_sdvo, intel_sdvo_connector))
Line 2326... Line 2319...
2326
		goto err;
2319
		goto err;
Line 2391... Line 2384...
2391
	intel_sdvo->base.crtc_mask = (1 << 0) | (1 << 1) | (1 << 2);
2384
	intel_sdvo->base.crtc_mask = (1 << 0) | (1 << 1) | (1 << 2);
Line 2392... Line 2385...
2392
 
2385
 
2393
	return true;
2386
	return true;
Line -... Line 2387...
-
 
2387
}
-
 
2388
 
-
 
2389
static void intel_sdvo_output_cleanup(struct intel_sdvo *intel_sdvo)
-
 
2390
{
-
 
2391
	struct drm_device *dev = intel_sdvo->base.base.dev;
-
 
2392
	struct drm_connector *connector, *tmp;
-
 
2393
 
-
 
2394
	list_for_each_entry_safe(connector, tmp,
-
 
2395
				 &dev->mode_config.connector_list, head) {
-
 
2396
		if (intel_attached_encoder(connector) == &intel_sdvo->base)
-
 
2397
			intel_sdvo_destroy(connector);
-
 
2398
	}
2394
}
2399
}
2395
 
2400
 
2396
static bool intel_sdvo_tv_create_property(struct intel_sdvo *intel_sdvo,
2401
static bool intel_sdvo_tv_create_property(struct intel_sdvo *intel_sdvo,
2397
					  struct intel_sdvo_connector *intel_sdvo_connector,
2402
					  struct intel_sdvo_connector *intel_sdvo_connector,
2398
					  int type)
2403
					  int type)
Line 2714... Line 2719...
2714
 
2719
 
2715
    if (intel_sdvo_output_setup(intel_sdvo,
2720
    if (intel_sdvo_output_setup(intel_sdvo,
2716
                    intel_sdvo->caps.output_flags) != true) {
2721
                    intel_sdvo->caps.output_flags) != true) {
2717
		DRM_DEBUG_KMS("SDVO output failed to setup on %s\n",
2722
		DRM_DEBUG_KMS("SDVO output failed to setup on %s\n",
-
 
2723
			      SDVO_NAME(intel_sdvo));
2718
			      SDVO_NAME(intel_sdvo));
2724
		/* Output_setup can leave behind connectors! */
2719
        goto err;
2725
		goto err_output;
Line -... Line 2726...
-
 
2726
    }
-
 
2727
 
-
 
2728
	/*
-
 
2729
	 * Cloning SDVO with anything is often impossible, since the SDVO
-
 
2730
	 * encoder can request a special input timing mode. And even if that's
-
 
2731
	 * not the case we have evidence that cloning a plain unscaled mode with
-
 
2732
	 * VGA doesn't really work. Furthermore the cloning flags are way too
-
 
2733
	 * simplistic anyway to express such constraints, so just give up on
-
 
2734
	 * cloning for SDVO encoders.
-
 
2735
	 */
2720
    }
2736
	intel_sdvo->base.cloneable = false;
2721
 
2737
 
2722
	/* Only enable the hotplug irq if we need it, to work around noisy
2738
	/* Only enable the hotplug irq if we need it, to work around noisy
2723
	 * hotplug lines.
2739
	 * hotplug lines.
2724
	 */
2740
	 */
Line 2725... Line 2741...
2725
	if (intel_sdvo->hotplug_active)
2741
	if (intel_sdvo->hotplug_active)
Line 2726... Line 2742...
2726
		dev_priv->hotplug_supported_mask |= hotplug_mask;
2742
		dev_priv->hotplug_supported_mask |= hotplug_mask;
2727
 
2743
 
2728
    intel_sdvo_select_ddc_bus(dev_priv, intel_sdvo, sdvo_reg);
2744
    intel_sdvo_select_ddc_bus(dev_priv, intel_sdvo, sdvo_reg);
Line 2729... Line 2745...
2729
 
2745
 
2730
    /* Set the input timing to the screen. Assume always input 0. */
2746
    /* Set the input timing to the screen. Assume always input 0. */
2731
    if (!intel_sdvo_set_target_input(intel_sdvo))
2747
    if (!intel_sdvo_set_target_input(intel_sdvo))
2732
        goto err;
2748
		goto err_output;
Line 2733... Line 2749...
2733
 
2749
 
2734
    if (!intel_sdvo_get_input_pixel_clock_range(intel_sdvo,
2750
    if (!intel_sdvo_get_input_pixel_clock_range(intel_sdvo,
2735
                            &intel_sdvo->pixel_clock_min,
2751
                            &intel_sdvo->pixel_clock_min,
2736
                            &intel_sdvo->pixel_clock_max))
2752
                            &intel_sdvo->pixel_clock_max))
Line 2752... Line 2768...
2752
            (SDVO_OUTPUT_TMDS0 | SDVO_OUTPUT_RGB0) ? 'Y' : 'N',
2768
            (SDVO_OUTPUT_TMDS0 | SDVO_OUTPUT_RGB0) ? 'Y' : 'N',
2753
            intel_sdvo->caps.output_flags &
2769
            intel_sdvo->caps.output_flags &
2754
            (SDVO_OUTPUT_TMDS1 | SDVO_OUTPUT_RGB1) ? 'Y' : 'N');
2770
            (SDVO_OUTPUT_TMDS1 | SDVO_OUTPUT_RGB1) ? 'Y' : 'N');
2755
    return true;
2771
    return true;
Line -... Line 2772...
-
 
2772
 
-
 
2773
err_output:
-
 
2774
	intel_sdvo_output_cleanup(intel_sdvo);
2756
 
2775
 
2757
err:
2776
err:
2758
    drm_encoder_cleanup(&intel_encoder->base);
2777
    drm_encoder_cleanup(&intel_encoder->base);
2759
//    i2c_del_adapter(&intel_sdvo->ddc);
2778
//    i2c_del_adapter(&intel_sdvo->ddc);