Hello

What about a patch like the attached one; would this be acceptable?


Signed-off-by: David Müller <d.muel...@elsoft.ch>

diff -dpruN linux-2.6.31-rc2.orig/drivers/gpu/drm/i915/i915_drv.h 
linux-2.6.31-rc2.patched/drivers/gpu/drm/i915/i915_drv.h
--- linux-2.6.31-rc2.orig/drivers/gpu/drm/i915/i915_drv.h       2009-07-04 
19:58:48.000000000 +0200
+++ linux-2.6.31-rc2.patched/drivers/gpu/drm/i915/i915_drv.h    2009-07-13 
12:47:52.000000000 +0200
@@ -205,6 +205,7 @@ typedef struct drm_i915_private {
        unsigned int lvds_use_ssc:1;
        int lvds_ssc_freq;
 
+       int crt_ddc_bus; /* -1 = unknown, else GPIO to use for CRT DDC */
        struct drm_i915_fence_reg fence_regs[16]; /* assume 965 */
        int fence_reg_start; /* 4 if userland hasn't ioctl'd us yet */
        int num_fence_regs; /* 8 on pre-965, 16 otherwise */
diff -dpruN linux-2.6.31-rc2.orig/drivers/gpu/drm/i915/intel_bios.c 
linux-2.6.31-rc2.patched/drivers/gpu/drm/i915/intel_bios.c
--- linux-2.6.31-rc2.orig/drivers/gpu/drm/i915/intel_bios.c     2009-07-04 
19:58:48.000000000 +0200
+++ linux-2.6.31-rc2.patched/drivers/gpu/drm/i915/intel_bios.c  2009-07-13 
12:49:22.000000000 +0200
@@ -204,6 +204,38 @@ parse_general_features(struct drm_i915_p
 }
 
 static void
+parse_general_definitions(struct drm_i915_private *dev_priv,
+                         struct bdb_header *bdb)
+{
+       struct bdb_general_definitions *general;
+       const int crt_bus_map_table[] = {
+               GPIOB,
+               GPIOA,
+               GPIOC,
+               GPIOD,
+               GPIOE,
+               GPIOF,
+       };
+
+       /* Set sensible defaults in case we can't find the general block
+          or it is the wrong chipset */
+       dev_priv->crt_ddc_bus = -1;
+
+       /* FIXME maybe add additional chipsets */
+       if (IS_I85X(dev_priv->dev)) {
+               general = find_section(bdb, BDB_GENERAL_DEFINITIONS);
+               if (general) {
+                       int bus_pin = general->crt_ddc_gmbus_pin;
+                       DRM_DEBUG("crt_ddc_bus_pin: %d\n", bus_pin);
+                       if ((bus_pin >= 1) && (bus_pin <= 6)) {
+                               dev_priv->crt_ddc_bus =
+                                       crt_bus_map_table[bus_pin-1];
+                       }
+               }
+       }
+}
+
+static void
 parse_sdvo_device_mapping(struct drm_i915_private *dev_priv,
                       struct bdb_header *bdb)
 {
@@ -332,6 +364,7 @@ intel_init_bios(struct drm_device *dev)
 
        /* Grab useful general definitions */
        parse_general_features(dev_priv, bdb);
+       parse_general_definitions(dev_priv, bdb);
        parse_lfp_panel_data(dev_priv, bdb);
        parse_sdvo_panel_data(dev_priv, bdb);
        parse_sdvo_device_mapping(dev_priv, bdb);
diff -dpruN linux-2.6.31-rc2.orig/drivers/gpu/drm/i915/intel_crt.c 
linux-2.6.31-rc2.patched/drivers/gpu/drm/i915/intel_crt.c
--- linux-2.6.31-rc2.orig/drivers/gpu/drm/i915/intel_crt.c      2009-07-04 
19:58:48.000000000 +0200
+++ linux-2.6.31-rc2.patched/drivers/gpu/drm/i915/intel_crt.c   2009-07-13 
11:48:22.000000000 +0200
@@ -478,6 +478,7 @@ void intel_crt_init(struct drm_device *d
 {
        struct drm_connector *connector;
        struct intel_output *intel_output;
+       struct drm_i915_private *dev_priv = dev->dev_private;
        u32 i2c_reg;
 
        intel_output = kzalloc(sizeof(struct intel_output), GFP_KERNEL);
@@ -497,8 +498,12 @@ void intel_crt_init(struct drm_device *d
        /* Set up the DDC bus. */
        if (IS_IGDNG(dev))
                i2c_reg = PCH_GPIOA;
-       else
+       else {
                i2c_reg = GPIOA;
+               /* Use VBT information for CRT DDC if available */
+               if (dev_priv->crt_ddc_bus != -1)
+                       i2c_reg = dev_priv->crt_ddc_bus;
+       }
        intel_output->ddc_bus = intel_i2c_create(dev, i2c_reg, "CRTDDC_A");
        if (!intel_output->ddc_bus) {
                dev_printk(KERN_ERR, &dev->pdev->dev, "DDC bus registration "
------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
--
_______________________________________________
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to