aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/radeon_atombios.c
diff options
context:
space:
mode:
authorAlex Deucher <alexdeucher@gmail.com>2009-06-12 13:26:08 -0400
committerDave Airlie <airlied@redhat.com>2009-06-14 22:02:27 -0400
commit6fe7ac3f5b544703581f3829c8c950dc721d976e (patch)
treef4c98df51d3b73486572bc3f4c65a96c6bdd34f0 /drivers/gpu/drm/radeon/radeon_atombios.c
parent771fe6b912fca54f03e8a72eb63058b582775362 (diff)
radeon legacy chips: tv dac bg/dac adj updates
COMBIOS - fallback to table values if there are no tv dac or lvds bios tables ATOMBIOS - add support for looking up these values from the bios table Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_atombios.c')
-rw-r--r--drivers/gpu/drm/radeon/radeon_atombios.c72
1 files changed, 72 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c b/drivers/gpu/drm/radeon/radeon_atombios.c
index 98904de63874..786632d3e378 100644
--- a/drivers/gpu/drm/radeon/radeon_atombios.c
+++ b/drivers/gpu/drm/radeon/radeon_atombios.c
@@ -824,6 +824,78 @@ struct radeon_encoder_atom_dig *radeon_atombios_get_lvds_info(struct
824 return lvds; 824 return lvds;
825} 825}
826 826
827struct radeon_encoder_primary_dac *
828radeon_atombios_get_primary_dac_info(struct radeon_encoder *encoder)
829{
830 struct drm_device *dev = encoder->base.dev;
831 struct radeon_device *rdev = dev->dev_private;
832 struct radeon_mode_info *mode_info = &rdev->mode_info;
833 int index = GetIndexIntoMasterTable(DATA, CompassionateData);
834 uint16_t data_offset;
835 struct _COMPASSIONATE_DATA *dac_info;
836 uint8_t frev, crev;
837 uint8_t bg, dac;
838 int i;
839 struct radeon_encoder_primary_dac *p_dac = NULL;
840
841 atom_parse_data_header(mode_info->atom_context, index, NULL, &frev, &crev, &data_offset);
842
843 dac_info = (struct _COMPASSIONATE_DATA *)(mode_info->atom_context->bios + data_offset);
844
845 if (dac_info) {
846 p_dac = kzalloc(sizeof(struct radeon_encoder_primary_dac), GFP_KERNEL);
847
848 if (!p_dac)
849 return NULL;
850
851 bg = dac_info->ucDAC1_BG_Adjustment;
852 dac = dac_info->ucDAC1_DAC_Adjustment;
853 p_dac->ps2_pdac_adj = (bg << 8) | (dac);
854
855 }
856 return p_dac;
857}
858
859struct radeon_encoder_tv_dac *
860radeon_atombios_get_tv_dac_info(struct radeon_encoder *encoder)
861{
862 struct drm_device *dev = encoder->base.dev;
863 struct radeon_device *rdev = dev->dev_private;
864 struct radeon_mode_info *mode_info = &rdev->mode_info;
865 int index = GetIndexIntoMasterTable(DATA, CompassionateData);
866 uint16_t data_offset;
867 struct _COMPASSIONATE_DATA *dac_info;
868 uint8_t frev, crev;
869 uint8_t bg, dac;
870 int i;
871 struct radeon_encoder_tv_dac *tv_dac = NULL;
872
873 atom_parse_data_header(mode_info->atom_context, index, NULL, &frev, &crev, &data_offset);
874
875 dac_info = (struct _COMPASSIONATE_DATA *)(mode_info->atom_context->bios + data_offset);
876
877 if (dac_info) {
878 tv_dac = kzalloc(sizeof(struct radeon_encoder_tv_dac), GFP_KERNEL);
879
880 if (!tv_dac)
881 return NULL;
882
883 bg = dac_info->ucDAC2_CRT2_BG_Adjustment;
884 dac = dac_info->ucDAC2_CRT2_DAC_Adjustment;
885 tv_dac->ps2_tvdac_adj = (bg << 16) | (dac << 20);
886
887 bg = dac_info->ucDAC2_PAL_BG_Adjustment;
888 dac = dac_info->ucDAC2_PAL_DAC_Adjustment;
889 tv_dac->pal_tvdac_adj = (bg << 16) | (dac << 20);
890
891 bg = dac_info->ucDAC2_NTSC_BG_Adjustment;
892 dac = dac_info->ucDAC2_NTSC_DAC_Adjustment;
893 tv_dac->ntsc_tvdac_adj = (bg << 16) | (dac << 20);
894
895 }
896 return tv_dac;
897}
898
827void radeon_atom_set_clock_gating(struct radeon_device *rdev, int enable) 899void radeon_atom_set_clock_gating(struct radeon_device *rdev, int enable)
828{ 900{
829 DYNAMIC_CLOCK_GATING_PS_ALLOCATION args; 901 DYNAMIC_CLOCK_GATING_PS_ALLOCATION args;