drm/radeon/kms/atom/dce3: fix up usPixelClock calculation for Transmitter tables
authorAlex Deucher <alexdeucher@gmail.com>
Thu, 5 Nov 2009 06:16:23 +0000 (01:16 -0500)
committerDave Airlie <airlied@redhat.com>
Fri, 6 Nov 2009 01:35:24 +0000 (11:35 +1000)
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/radeon/radeon_encoders.c

index 2aa5994a29d5e8073595a70ec5c271317eb2ced2..355b0fbed9272fe20915e666ade87bd7f61cf145 100644 (file)
@@ -725,10 +725,10 @@ atombios_dig_transmitter_setup(struct drm_encoder *encoder, int action)
 
        if (ASIC_IS_DCE32(rdev)) {
                if (radeon_encoder->pixel_clock > 165000) {
-                       args.v2.usPixelClock = cpu_to_le16((radeon_encoder->pixel_clock * 10 * 2) / 100);
+                       args.v2.usPixelClock = cpu_to_le16((radeon_encoder->pixel_clock / 2) / 10);
                        args.v2.acConfig.fDualLinkConnector = 1;
                } else {
-                       args.v2.usPixelClock = cpu_to_le16((radeon_encoder->pixel_clock * 10 * 4) / 100);
+                       args.v2.usPixelClock = cpu_to_le16(radeon_encoder->pixel_clock / 10);
                }
                if (dig->dig_block)
                        args.v2.acConfig.ucEncoderSel = 1;
@@ -754,7 +754,10 @@ atombios_dig_transmitter_setup(struct drm_encoder *encoder, int action)
                }
        } else {
                args.v1.ucConfig = ATOM_TRANSMITTER_CONFIG_CLKSRC_PPLL;
-               args.v1.usPixelClock = cpu_to_le16((radeon_encoder->pixel_clock) / 10);
+               if (radeon_encoder->pixel_clock > 165000)
+                       args.v1.usPixelClock = cpu_to_le16((radeon_encoder->pixel_clock / 2) / 10);
+               else
+                       args.v1.usPixelClock = cpu_to_le16(radeon_encoder->pixel_clock / 10);
 
                switch (radeon_encoder->encoder_id) {
                case ENCODER_OBJECT_ID_INTERNAL_UNIPHY: