From 41cf61d1c97e9a7cb626ec447df029db00c87690 Mon Sep 17 00:00:00 2001 From: Alexander von Gluck IV Date: Thu, 22 Mar 2012 11:48:51 -0500 Subject: [PATCH] radeon_hd: Don't call TV encoder control improperly * TV encoder was dropped on DCE5+ * (ATOM_DEVICE_TV_SUPPORT | ATOM_DEVICE_CV_SUPPORT) will improperly match DFP4 (0x2 | 0x8) = 0xA * Bug reported to linux kernel driver --- src/add-ons/accelerants/radeon_hd/connector.cpp | 4 ++-- src/add-ons/accelerants/radeon_hd/encoder.cpp | 13 ++++++++----- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/add-ons/accelerants/radeon_hd/connector.cpp b/src/add-ons/accelerants/radeon_hd/connector.cpp index d5b307e44d..829bbf83ff 100644 --- a/src/add-ons/accelerants/radeon_hd/connector.cpp +++ b/src/add-ons/accelerants/radeon_hd/connector.cpp @@ -674,8 +674,8 @@ connector_probe() } // Set up information buses such as ddc - if ((connectorFlags - & (ATOM_DEVICE_TV_SUPPORT | ATOM_DEVICE_CV_SUPPORT)) == 0) { + if (((connectorFlags & ATOM_DEVICE_TV_SUPPORT) == 0) + && (connectorFlags & ATOM_DEVICE_CV_SUPPORT) == 0) { for (j = 0; j < connectorObject->ucNumberOfObjects; j++) { if (B_LENDIAN_TO_HOST_INT16(path->usConnObjectId) == B_LENDIAN_TO_HOST_INT16( diff --git a/src/add-ons/accelerants/radeon_hd/encoder.cpp b/src/add-ons/accelerants/radeon_hd/encoder.cpp index fc2496107c..e4ccc02eb0 100644 --- a/src/add-ons/accelerants/radeon_hd/encoder.cpp +++ b/src/add-ons/accelerants/radeon_hd/encoder.cpp @@ -295,11 +295,14 @@ encoder_mode_set(uint8 id, uint32 pixelClock) case ENCODER_OBJECT_ID_INTERNAL_DAC2: case ENCODER_OBJECT_ID_INTERNAL_KLDSCP_DAC2: encoder_analog_setup(connectorIndex, pixelClock, ATOM_ENABLE); - if ((encoderFlags - & (ATOM_DEVICE_TV_SUPPORT | ATOM_DEVICE_CV_SUPPORT)) != 0) { - encoder_tv_setup(connectorIndex, pixelClock, ATOM_ENABLE); - } else { - encoder_tv_setup(connectorIndex, pixelClock, ATOM_DISABLE); + if (info.dceMajor < 5) { + // TV encoder was dropped in DCE 5 + if ((encoderFlags & ATOM_DEVICE_TV_SUPPORT != 0) + || (encoderFlags & ATOM_DEVICE_CV_SUPPORT) != 0) { + encoder_tv_setup(connectorIndex, pixelClock, ATOM_ENABLE); + } else { + encoder_tv_setup(connectorIndex, pixelClock, ATOM_DISABLE); + } } break; case ENCODER_OBJECT_ID_INTERNAL_TMDS1: