Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 77416187 authored by Alex Deucher's avatar Alex Deucher Committed by Dave Airlie
Browse files

drm/radeon/kms: legacy tv dac cleanup



- fix formatting
- clean up tv_dac_cntl handling for tv

Signed-off-by: default avatarAlex Deucher <alexdeucher@gmail.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent 01a356fd
Loading
Loading
Loading
Loading
+33 −25
Original line number Diff line number Diff line
@@ -925,17 +925,25 @@ static void radeon_legacy_tv_dac_mode_set(struct drm_encoder *encoder,
					 RADEON_TV_DAC_BDACPD);
		}

		/*  FIXME TV */
		if (tv_dac) {
			struct radeon_encoder_tv_dac *tv_dac = radeon_encoder->enc_priv;
			tv_dac_cntl |= (RADEON_TV_DAC_NBLANK |
					RADEON_TV_DAC_NHOLD |
					RADEON_TV_DAC_STD_PS2 |
					tv_dac->ps2_tvdac_adj);
		tv_dac_cntl |= RADEON_TV_DAC_NBLANK | RADEON_TV_DAC_NHOLD;

		if (is_tv) {
			if (tv_dac->tv_std == TV_STD_NTSC ||
			    tv_dac->tv_std == TV_STD_NTSC_J ||
			    tv_dac->tv_std == TV_STD_PAL_M ||
			    tv_dac->tv_std == TV_STD_PAL_60)
				tv_dac_cntl |= tv_dac->ntsc_tvdac_adj;
			else
				tv_dac_cntl |= tv_dac->pal_tvdac_adj;

			if (tv_dac->tv_std == TV_STD_NTSC ||
			    tv_dac->tv_std == TV_STD_NTSC_J)
				tv_dac_cntl |= RADEON_TV_DAC_STD_NTSC;
			else
				tv_dac_cntl |= RADEON_TV_DAC_STD_PAL;
		} else
			tv_dac_cntl |= (RADEON_TV_DAC_NBLANK |
					RADEON_TV_DAC_NHOLD |
					RADEON_TV_DAC_STD_PS2);
			tv_dac_cntl |= (RADEON_TV_DAC_STD_PS2 |
					tv_dac->ps2_tvdac_adj);

		WREG32(RADEON_TV_DAC_CNTL, tv_dac_cntl);
	}