[PATCH] drm/radeon: fix dual-head on rv250

2010-06-08 Thread Dave Airlie
From: Dave Airlie airl...@redhat.com

Plugged in FireMV with the rv250 on it, and the second crtc/dac didn't work,
we were reading/writing different registers than we were modifying in the code.

Signed-off-by: Dave Airlie airl...@redhat.com
---
 drivers/gpu/drm/radeon/radeon_legacy_encoders.c |   22 +-
 1 files changed, 9 insertions(+), 13 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_legacy_encoders.c 
b/drivers/gpu/drm/radeon/radeon_legacy_encoders.c
index 9b5f62b..23ea127 100644
--- a/drivers/gpu/drm/radeon/radeon_legacy_encoders.c
+++ b/drivers/gpu/drm/radeon/radeon_legacy_encoders.c
@@ -931,16 +931,14 @@ static void radeon_legacy_tv_dac_mode_set(struct 
drm_encoder *encoder,
if (ASIC_IS_R300(rdev)) {
gpiopad_a = RREG32(RADEON_GPIOPAD_A) | 1;
disp_output_cntl = RREG32(RADEON_DISP_OUTPUT_CNTL);
-   }
-
-   if (rdev-family == CHIP_R200 || ASIC_IS_R300(rdev))
-   disp_tv_out_cntl = RREG32(RADEON_DISP_TV_OUT_CNTL);
-   else
+   } else if (rdev-family != CHIP_R200)
disp_hw_debug = RREG32(RADEON_DISP_HW_DEBUG);
-
-   if (rdev-family == CHIP_R200)
+   else if (rdev-family == CHIP_R200)
fp2_gen_cntl = RREG32(RADEON_FP2_GEN_CNTL);
 
+   if (rdev-family = CHIP_R200)
+   disp_tv_out_cntl = RREG32(RADEON_DISP_TV_OUT_CNTL);
+
if (is_tv) {
uint32_t dac_cntl;
 
@@ -1005,15 +1003,13 @@ static void radeon_legacy_tv_dac_mode_set(struct 
drm_encoder *encoder,
if (ASIC_IS_R300(rdev)) {
WREG32_P(RADEON_GPIOPAD_A, gpiopad_a, ~1);
WREG32(RADEON_DISP_OUTPUT_CNTL, disp_output_cntl);
-   }
+   } else if (rdev-family != CHIP_R200)
+   WREG32(RADEON_DISP_HW_DEBUG, disp_hw_debug);
+   else if (rdev-family == CHIP_R200)
+   WREG32(RADEON_FP2_GEN_CNTL, fp2_gen_cntl);
 
if (rdev-family = CHIP_R200)
WREG32(RADEON_DISP_TV_OUT_CNTL, disp_tv_out_cntl);
-   else
-   WREG32(RADEON_DISP_HW_DEBUG, disp_hw_debug);
-
-   if (rdev-family == CHIP_R200)
-   WREG32(RADEON_FP2_GEN_CNTL, fp2_gen_cntl);
 
if (is_tv)
radeon_legacy_tv_mode_set(encoder, mode, adjusted_mode);
-- 
1.6.5.2


--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [PATCH] drm/radeon: fix dual-head on rv250

2010-06-08 Thread Alex Deucher
On Wed, Jun 9, 2010 at 12:02 AM, Dave Airlie airl...@gmail.com wrote:
 From: Dave Airlie airl...@redhat.com

 Plugged in FireMV with the rv250 on it, and the second crtc/dac didn't work,
 we were reading/writing different registers than we were modifying in the 
 code.

 Signed-off-by: Dave Airlie airl...@redhat.com

Signed-off-by: Alex Deucher alexdeuc...@gmail.com

 ---
  drivers/gpu/drm/radeon/radeon_legacy_encoders.c |   22 +-
  1 files changed, 9 insertions(+), 13 deletions(-)

 diff --git a/drivers/gpu/drm/radeon/radeon_legacy_encoders.c 
 b/drivers/gpu/drm/radeon/radeon_legacy_encoders.c
 index 9b5f62b..23ea127 100644
 --- a/drivers/gpu/drm/radeon/radeon_legacy_encoders.c
 +++ b/drivers/gpu/drm/radeon/radeon_legacy_encoders.c
 @@ -931,16 +931,14 @@ static void radeon_legacy_tv_dac_mode_set(struct 
 drm_encoder *encoder,
        if (ASIC_IS_R300(rdev)) {
                gpiopad_a = RREG32(RADEON_GPIOPAD_A) | 1;
                disp_output_cntl = RREG32(RADEON_DISP_OUTPUT_CNTL);
 -       }
 -
 -       if (rdev-family == CHIP_R200 || ASIC_IS_R300(rdev))
 -               disp_tv_out_cntl = RREG32(RADEON_DISP_TV_OUT_CNTL);
 -       else
 +       } else if (rdev-family != CHIP_R200)
                disp_hw_debug = RREG32(RADEON_DISP_HW_DEBUG);
 -
 -       if (rdev-family == CHIP_R200)
 +       else if (rdev-family == CHIP_R200)
                fp2_gen_cntl = RREG32(RADEON_FP2_GEN_CNTL);

 +       if (rdev-family = CHIP_R200)
 +               disp_tv_out_cntl = RREG32(RADEON_DISP_TV_OUT_CNTL);
 +
        if (is_tv) {
                uint32_t dac_cntl;

 @@ -1005,15 +1003,13 @@ static void radeon_legacy_tv_dac_mode_set(struct 
 drm_encoder *encoder,
        if (ASIC_IS_R300(rdev)) {
                WREG32_P(RADEON_GPIOPAD_A, gpiopad_a, ~1);
                WREG32(RADEON_DISP_OUTPUT_CNTL, disp_output_cntl);
 -       }
 +       } else if (rdev-family != CHIP_R200)
 +               WREG32(RADEON_DISP_HW_DEBUG, disp_hw_debug);
 +       else if (rdev-family == CHIP_R200)
 +               WREG32(RADEON_FP2_GEN_CNTL, fp2_gen_cntl);

        if (rdev-family = CHIP_R200)
                WREG32(RADEON_DISP_TV_OUT_CNTL, disp_tv_out_cntl);
 -       else
 -               WREG32(RADEON_DISP_HW_DEBUG, disp_hw_debug);
 -
 -       if (rdev-family == CHIP_R200)
 -               WREG32(RADEON_FP2_GEN_CNTL, fp2_gen_cntl);

        if (is_tv)
                radeon_legacy_tv_mode_set(encoder, mode, adjusted_mode);
 --
 1.6.5.2


 --
 ThinkGeek and WIRED's GeekDad team up for the Ultimate
 GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
 lucky parental unit.  See the prize list and enter to win:
 http://p.sf.net/sfu/thinkgeek-promo
 --
 ___
 Dri-devel mailing list
 Dri-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/dri-devel


--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel