From 63d0b67679e81983773b611297c04c024541687a Mon Sep 17 00:00:00 2001 From: Alexander von Gluck IV Date: Thu, 8 Mar 2012 05:46:40 -0600 Subject: [PATCH] radeon_hd: Fill in a few analog encoder edge cases * If TV, NTSC hardcoded for now. I plan to address this with an accelerant config file at some point --- src/add-ons/accelerants/radeon_hd/encoder.cpp | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/add-ons/accelerants/radeon_hd/encoder.cpp b/src/add-ons/accelerants/radeon_hd/encoder.cpp index 5ecd602eb4..b72e85f71f 100644 --- a/src/add-ons/accelerants/radeon_hd/encoder.cpp +++ b/src/add-ons/accelerants/radeon_hd/encoder.cpp @@ -860,6 +860,8 @@ encoder_analog_setup(uint32 connectorIndex, uint32 pixelClock, int command) { TRACE("%s\n", __func__); + uint32 encoderFlags = gConnector[connectorIndex]->encoder.flags; + int index = 0; DAC_ENCODER_CONTROL_PS_ALLOCATION args; memset(&args, 0, sizeof(args)); @@ -876,9 +878,21 @@ encoder_analog_setup(uint32 connectorIndex, uint32 pixelClock, int command) } args.ucAction = command; - args.ucDacStandard = ATOM_DAC1_PS2; - // TODO: or ATOM_DAC1_CV if ATOM_DEVICE_CV_SUPPORT - // TODO: or ATOM_DAC1_PAL or ATOM_DAC1_NTSC if else + + if ((encoderFlags & ATOM_DEVICE_CRT_SUPPORT) != 0) + args.ucDacStandard = ATOM_DAC1_PS2; + else if ((encoderFlags & ATOM_DEVICE_CV_SUPPORT) != 0) + args.ucDacStandard = ATOM_DAC1_CV; + else { + TRACE("%s: TODO, hardcoded NTSC TV support\n", __func__); + if (1) { + // NTSC, NTSC_J, PAL 60 + args.ucDacStandard = ATOM_DAC1_NTSC; + } else { + // PAL, SCART. SECAM, PAL_CN + args.ucDacStandard = ATOM_DAC1_PAL; + } + } args.usPixelClock = B_HOST_TO_LENDIAN_INT16(pixelClock / 10);