[Intel-gfx] [PATCH 5/6] drm/i915: Move intel_setup_outputs() out of the common vdc code
Richard Purdie
rpurdie at linux.intel.com
Wed May 13 16:03:01 CEST 2009
The initial part of intel_setup_outputs() is quite specific to the i915
driver and will be different on other platforms so this moves it into
the i915 code. For now, intel_tv is left as i915 specific for example
due to its calls into i915_irq.c.
Signed-off-by: Richard Purdie <rpurdie at linux.intel.com>
Index: git/drivers/gpu/drm/i915/i915_dma.c
===================================================================
--- git.orig/drivers/gpu/drm/i915/i915_dma.c 2009-05-13 13:42:07.000000000 +0100
+++ git/drivers/gpu/drm/i915/i915_dma.c 2009-05-13 13:52:17.000000000 +0100
@@ -992,6 +992,44 @@
return 0;
}
+static void intel_setup_outputs(struct drm_device *dev)
+{
+ struct intel_vdc_private *vdc = dev->dev_private;
+
+ intel_crt_init(dev);
+
+ /* Set up integrated LVDS */
+ if (IS_MOBILE(dev) && !IS_I830(dev))
+ intel_lvds_init(dev);
+
+ if (IS_I9XX(dev)) {
+ int found;
+ u32 reg;
+
+ if (I915_READ(SDVOB) & SDVO_DETECTED) {
+ found = intel_sdvo_init(dev, SDVOB);
+ if (!found && SUPPORTS_INTEGRATED_HDMI(dev))
+ intel_hdmi_init(dev, SDVOB);
+ }
+
+ /* Before G4X SDVOC doesn't have its own detect register */
+ if (IS_G4X(dev))
+ reg = SDVOC;
+ else
+ reg = SDVOB;
+
+ if (I915_READ(reg) & SDVO_DETECTED) {
+ found = intel_sdvo_init(dev, SDVOC);
+ if (!found && SUPPORTS_INTEGRATED_HDMI(dev))
+ intel_hdmi_init(dev, SDVOC);
+ }
+ } else
+ intel_dvo_init(dev);
+
+ if (IS_I9XX(dev) && IS_MOBILE(dev))
+ intel_tv_init(dev);
+}
+
static int i915_load_modeset_init(struct drm_device *dev)
{
struct intel_vdc_private *vdc = dev->dev_private;
@@ -1054,6 +1092,8 @@
I915_WRITE(INSTPM, (1 << 5) | (1 << 21));
intel_modeset_init(dev);
+ intel_setup_outputs(dev);
+ intel_setup_masks(dev);
drm_helper_initial_config(dev);
Index: git/drivers/gpu/drm/i915/i915_drv.h
===================================================================
--- git.orig/drivers/gpu/drm/i915/i915_drv.h 2009-05-13 13:46:39.000000000 +0100
+++ git/drivers/gpu/drm/i915/i915_drv.h 2009-05-13 13:47:32.000000000 +0100
@@ -578,6 +578,7 @@
/* modesetting */
extern void intel_modeset_init(struct drm_device *dev);
extern void intel_modeset_cleanup(struct drm_device *dev);
+extern void intel_setup_masks(struct drm_device *dev);
/**
* Lock test for when it's just for synchronization of ring access.
Index: git/drivers/gpu/drm/i915/intel_display.c
===================================================================
--- git.orig/drivers/gpu/drm/i915/intel_display.c 2009-05-13 13:42:07.000000000 +0100
+++ git/drivers/gpu/drm/i915/intel_display.c 2009-05-13 13:51:13.000000000 +0100
@@ -1823,44 +1823,10 @@
}
EXPORT_SYMBOL(intel_connector_clones);
-static void intel_setup_outputs(struct drm_device *dev)
+void intel_setup_masks(struct drm_device *dev)
{
- struct intel_vdc_private *vdc = dev->dev_private;
struct drm_connector *connector;
- intel_crt_init(dev);
-
- /* Set up integrated LVDS */
- if (IS_MOBILE(dev) && !IS_I830(dev))
- intel_lvds_init(dev);
-
- if (IS_I9XX(dev)) {
- int found;
- u32 reg;
-
- if (I915_READ(SDVOB) & SDVO_DETECTED) {
- found = intel_sdvo_init(dev, SDVOB);
- if (!found && SUPPORTS_INTEGRATED_HDMI(dev))
- intel_hdmi_init(dev, SDVOB);
- }
-
- /* Before G4X SDVOC doesn't have its own detect register */
- if (IS_G4X(dev))
- reg = SDVOC;
- else
- reg = SDVOB;
-
- if (I915_READ(reg) & SDVO_DETECTED) {
- found = intel_sdvo_init(dev, SDVOC);
- if (!found && SUPPORTS_INTEGRATED_HDMI(dev))
- intel_hdmi_init(dev, SDVOC);
- }
- } else
- intel_dvo_init(dev);
-
- if (IS_I9XX(dev) && IS_MOBILE(dev))
- intel_tv_init(dev);
-
list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
struct intel_output *intel_output = to_intel_output(connector);
struct drm_encoder *encoder = &intel_output->enc;
@@ -1902,6 +1868,7 @@
encoder->possible_clones = intel_connector_clones(dev, clone_mask);
}
}
+EXPORT_SYMBOL(intel_setup_masks);
static void intel_user_framebuffer_destroy(struct drm_framebuffer *fb)
{
@@ -2027,8 +1994,6 @@
for (i = 0; i < num_pipe; i++) {
intel_crtc_init(dev, i);
}
-
- intel_setup_outputs(dev);
}
EXPORT_SYMBOL(intel_modeset_init);
More information about the Intel-gfx
mailing list