summaryrefslogtreecommitdiff
path: root/src/atombios_output.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/atombios_output.c')
-rw-r--r--src/atombios_output.c76
1 files changed, 51 insertions, 25 deletions
diff --git a/src/atombios_output.c b/src/atombios_output.c
index 2f858339..35d1767c 100644
--- a/src/atombios_output.c
+++ b/src/atombios_output.c
@@ -1019,11 +1019,30 @@ static void atom_rv515_force_tv_scaler(ScrnInfoPtr pScrn)
static int
atombios_output_yuv_setup(xf86OutputPtr output, Bool enable)
{
+ RADEONOutputPrivatePtr radeon_output = output->driver_private;
RADEONInfoPtr info = RADEONPTR(output->scrn);
RADEONCrtcPrivatePtr radeon_crtc = output->crtc->driver_private;
ENABLE_YUV_PS_ALLOCATION disp_data;
AtomBiosArgRec data;
unsigned char *space;
+ unsigned char *RADEONMMIO = info->MMIO;
+ uint32_t temp, reg;
+
+ if (info->ChipFamily >= CHIP_FAMILY_R600)
+ reg = R600_BIOS_3_SCRATCH;
+ else
+ reg = RADEON_BIOS_3_SCRATCH;
+
+ //fix up scratch reg handling
+ temp = INREG(reg);
+ if (radeon_output->active_device & (ATOM_DEVICE_TV_SUPPORT))
+ OUTREG(reg, (ATOM_S3_TV1_ACTIVE |
+ (radeon_crtc->crtc_id << 18)));
+ else if (radeon_output->active_device & (ATOM_DEVICE_CV_SUPPORT))
+ OUTREG(reg, (ATOM_S3_CV_ACTIVE |
+ (radeon_crtc->crtc_id << 24)));
+ else
+ OUTREG(reg, 0);
memset(&disp_data, 0, sizeof(disp_data));
@@ -1036,10 +1055,15 @@ atombios_output_yuv_setup(xf86OutputPtr output, Bool enable)
data.exec.pspace = &disp_data;
if (RHDAtomBiosFunc(info->atomBIOS->scrnIndex, info->atomBIOS, ATOMBIOS_EXEC, &data) == ATOM_SUCCESS) {
+
+ OUTREG(reg, temp);
+
ErrorF("crtc %d YUV %s setup success\n", radeon_crtc->crtc_id, enable ? "enable" : "disable");
return ATOM_SUCCESS;
}
+ OUTREG(reg, temp);
+
ErrorF("crtc %d YUV %s setup failed\n", radeon_crtc->crtc_id, enable ? "enable" : "disable");
return ATOM_NOT_IMPLEMENTED;
@@ -1631,36 +1655,38 @@ atom_bios_dac_load_detect(atomBiosHandlePtr atomBIOS, xf86OutputPtr output)
}
} else if (radeon_output->devices & ATOM_DEVICE_CV_SUPPORT) {
dac_data.sDacload.usDeviceID = cpu_to_le16(ATOM_DEVICE_CV_SUPPORT);
- if (IS_AVIVO_VARIANT) {
- if (info->encoders[ATOM_DEVICE_CV_INDEX] &&
- (info->encoders[ATOM_DEVICE_CV_INDEX]->encoder_id == ENCODER_OBJECT_ID_INTERNAL_KLDSCP_DAC1))
- dac_data.sDacload.ucDacType = ATOM_DAC_A;
- else
- dac_data.sDacload.ucDacType = ATOM_DAC_B;
- } else {
- if (info->encoders[ATOM_DEVICE_CV_INDEX] &&
- (info->encoders[ATOM_DEVICE_CV_INDEX]->encoder_id == ENCODER_OBJECT_ID_INTERNAL_DAC1))
- dac_data.sDacload.ucDacType = ATOM_DAC_A;
- else
+ if (IS_AVIVO_VARIANT) {
+ if (info->encoders[ATOM_DEVICE_CV_INDEX] &&
+ (info->encoders[ATOM_DEVICE_CV_INDEX]->encoder_id == ENCODER_OBJECT_ID_INTERNAL_KLDSCP_DAC1))
+ dac_data.sDacload.ucDacType = ATOM_DAC_A;
+ else
+ dac_data.sDacload.ucDacType = ATOM_DAC_B;
+ } else {
+ if (info->encoders[ATOM_DEVICE_CV_INDEX] &&
+ (info->encoders[ATOM_DEVICE_CV_INDEX]->encoder_id == ENCODER_OBJECT_ID_INTERNAL_DAC1))
+ dac_data.sDacload.ucDacType = ATOM_DAC_A;
+ else
dac_data.sDacload.ucDacType = ATOM_DAC_B;
- }
+ }
if (minor >= 3)
dac_data.sDacload.ucMisc = DAC_LOAD_MISC_YPrPb;
} else if (radeon_output->devices & ATOM_DEVICE_TV1_SUPPORT) {
dac_data.sDacload.usDeviceID = cpu_to_le16(ATOM_DEVICE_TV1_SUPPORT);
- if (IS_AVIVO_VARIANT) {
- if (info->encoders[ATOM_DEVICE_TV1_INDEX] &&
- (info->encoders[ATOM_DEVICE_TV1_INDEX]->encoder_id == ENCODER_OBJECT_ID_INTERNAL_KLDSCP_DAC1))
- dac_data.sDacload.ucDacType = ATOM_DAC_A;
- else
- dac_data.sDacload.ucDacType = ATOM_DAC_B;
- } else {
- if (info->encoders[ATOM_DEVICE_TV1_INDEX] &&
- (info->encoders[ATOM_DEVICE_TV1_INDEX]->encoder_id == ENCODER_OBJECT_ID_INTERNAL_DAC1))
- dac_data.sDacload.ucDacType = ATOM_DAC_A;
- else
- dac_data.sDacload.ucDacType = ATOM_DAC_B;
- }
+ if (IS_AVIVO_VARIANT) {
+ if (info->encoders[ATOM_DEVICE_TV1_INDEX] &&
+ (info->encoders[ATOM_DEVICE_TV1_INDEX]->encoder_id == ENCODER_OBJECT_ID_INTERNAL_KLDSCP_DAC1))
+ dac_data.sDacload.ucDacType = ATOM_DAC_A;
+ else
+ dac_data.sDacload.ucDacType = ATOM_DAC_B;
+ } else {
+ if (info->encoders[ATOM_DEVICE_TV1_INDEX] &&
+ (info->encoders[ATOM_DEVICE_TV1_INDEX]->encoder_id == ENCODER_OBJECT_ID_INTERNAL_DAC1))
+ dac_data.sDacload.ucDacType = ATOM_DAC_A;
+ else
+ dac_data.sDacload.ucDacType = ATOM_DAC_B;
+ }
+ if (minor >= 3)
+ dac_data.sDacload.ucMisc = DAC_LOAD_MISC_YPrPb;
} else {
ErrorF("invalid output device for dac detection\n");
return ATOM_NOT_IMPLEMENTED;