radeon: use atom for ext tmds on r4xx
authorAlex Deucher <alexdeucher@gmail.com>
Fri, 26 Sep 2008 21:32:15 +0000 (17:32 -0400)
committerAlex Deucher <alexdeucher@gmail.com>
Fri, 26 Sep 2008 21:32:15 +0000 (17:32 -0400)
linux-core/radeon_encoders.c
linux-core/radeon_legacy_encoders.c
linux-core/radeon_mode.h

index 04ab03a..e5c95c9 100644 (file)
@@ -768,8 +768,8 @@ static void atombios_tmds2_setup(struct drm_encoder *encoder,
 }
 
 
-static void atombios_ext_tmds_setup(struct drm_encoder *encoder,
-                                   struct drm_display_mode *mode)
+void atombios_ext_tmds_setup(struct drm_encoder *encoder,
+                            struct drm_display_mode *mode)
 {
        struct drm_device *dev = encoder->dev;
        struct drm_radeon_private *dev_priv = dev->dev_private;
index 1a1db53..261501d 100644 (file)
@@ -923,33 +923,40 @@ static void radeon_legacy_tmds_ext_mode_set(struct drm_encoder *encoder,
        struct drm_radeon_private *dev_priv = dev->dev_private;
        struct radeon_crtc *radeon_crtc = to_radeon_crtc(encoder->crtc);
        struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
-       uint32_t fp2_gen_cntl = RADEON_READ(RADEON_FP2_GEN_CNTL);
+       uint32_t fp2_gen_cntl;
 
        DRM_DEBUG("\n");
 
        if (radeon_crtc->crtc_id == 0)
                radeon_legacy_rmx_mode_set(encoder, mode, adjusted_mode);
 
-       if (1) // FIXME rgbBits == 8
-               fp2_gen_cntl |= RADEON_FP2_PANEL_FORMAT; /* 24 bit format, */
-       else
-               fp2_gen_cntl &= ~RADEON_FP2_PANEL_FORMAT;/* 18 bit format, */
-
-       fp2_gen_cntl &= ~(RADEON_FP2_ON |
-                         RADEON_FP2_DVO_EN |
-                         RADEON_FP2_DVO_RATE_SEL_SDR);
+       if (dev_priv->is_atom_bios) {
+               atombios_ext_tmds_setup(encoder, adjusted_mode);
+               fp2_gen_cntl = RADEON_READ(RADEON_FP2_GEN_CNTL);
+       } else {
+               fp2_gen_cntl = RADEON_READ(RADEON_FP2_GEN_CNTL);
 
-       /* XXX: these are oem specific */
-       if (radeon_is_r300(dev_priv)) {
-               if ((dev->pdev->device == 0x4850) &&
-                   (dev->pdev->subsystem_vendor == 0x1028) &&
-                   (dev->pdev->subsystem_device == 0x2001)) /* Dell Inspiron 8600 */
-                       fp2_gen_cntl |= R300_FP2_DVO_CLOCK_MODE_SINGLE;
+               if (1) // FIXME rgbBits == 8
+                       fp2_gen_cntl |= RADEON_FP2_PANEL_FORMAT; /* 24 bit format, */
                else
-                       fp2_gen_cntl |= RADEON_FP2_PAD_FLOP_EN | R300_FP2_DVO_CLOCK_MODE_SINGLE;
+                       fp2_gen_cntl &= ~RADEON_FP2_PANEL_FORMAT;/* 18 bit format, */
+
+               fp2_gen_cntl &= ~(RADEON_FP2_ON |
+                                 RADEON_FP2_DVO_EN |
+                                 RADEON_FP2_DVO_RATE_SEL_SDR);
+
+               /* XXX: these are oem specific */
+               if (radeon_is_r300(dev_priv)) {
+                       if ((dev->pdev->device == 0x4850) &&
+                           (dev->pdev->subsystem_vendor == 0x1028) &&
+                           (dev->pdev->subsystem_device == 0x2001)) /* Dell Inspiron 8600 */
+                               fp2_gen_cntl |= R300_FP2_DVO_CLOCK_MODE_SINGLE;
+                       else
+                               fp2_gen_cntl |= RADEON_FP2_PAD_FLOP_EN | R300_FP2_DVO_CLOCK_MODE_SINGLE;
 
-               /*if (mode->clock > 165000)
-                       fp2_gen_cntl |= R300_FP2_DVO_DUAL_CHANNEL_EN;*/
+                       /*if (mode->clock > 165000)
+                         fp2_gen_cntl |= R300_FP2_DVO_DUAL_CHANNEL_EN;*/
+               }
        }
 
        if (radeon_crtc->crtc_id == 0) {
index 8074eb7..fef2738 100644 (file)
@@ -277,6 +277,8 @@ struct drm_encoder *radeon_encoder_legacy_primary_dac_add(struct drm_device *dev
 struct drm_encoder *radeon_encoder_legacy_tv_dac_add(struct drm_device *dev, int bios_index, int with_tv);
 struct drm_encoder *radeon_encoder_legacy_tmds_int_add(struct drm_device *dev, int bios_index);
 struct drm_encoder *radeon_encoder_legacy_tmds_ext_add(struct drm_device *dev, int bios_index);
+extern void atombios_ext_tmds_setup(struct drm_encoder *encoder,
+                                   struct drm_display_mode *mode);
 
 extern void radeon_crtc_load_lut(struct drm_crtc *crtc);
 extern void atombios_crtc_set_base(struct drm_crtc *crtc, int x, int y);