diff options
| author | Alex Deucher <alexdeucher@gmail.com> | 2009-12-17 19:00:29 -0500 |
|---|---|---|
| committer | Dave Airlie <airlied@redhat.com> | 2009-12-22 20:14:03 -0500 |
| commit | d79766fab9975c6414ebab7d2abf017834a48c35 (patch) | |
| tree | 00df1cf95d124f957fa91ff29a7edb81e16727d6 | |
| parent | 310a82c8c5fc431913fe34a17251118e71c2c876 (diff) | |
drm/radeon/kms: set proper default tv standard
we were just using 1 before.
reported on irc by soreau
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
| -rw-r--r-- | drivers/gpu/drm/radeon/radeon_atombios.c | 56 | ||||
| -rw-r--r-- | drivers/gpu/drm/radeon/radeon_combios.c | 9 | ||||
| -rw-r--r-- | drivers/gpu/drm/radeon/radeon_connectors.c | 4 | ||||
| -rw-r--r-- | drivers/gpu/drm/radeon/radeon_display.c | 2 | ||||
| -rw-r--r-- | drivers/gpu/drm/radeon/radeon_mode.h | 6 |
5 files changed, 69 insertions, 8 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c b/drivers/gpu/drm/radeon/radeon_atombios.c index 12a0c760e7ff..b5912c26b1db 100644 --- a/drivers/gpu/drm/radeon/radeon_atombios.c +++ b/drivers/gpu/drm/radeon/radeon_atombios.c | |||
| @@ -1234,6 +1234,61 @@ bool radeon_atom_get_tv_timings(struct radeon_device *rdev, int index, | |||
| 1234 | return true; | 1234 | return true; |
| 1235 | } | 1235 | } |
| 1236 | 1236 | ||
| 1237 | enum radeon_tv_std | ||
| 1238 | radeon_atombios_get_tv_info(struct radeon_device *rdev) | ||
| 1239 | { | ||
| 1240 | struct radeon_mode_info *mode_info = &rdev->mode_info; | ||
| 1241 | int index = GetIndexIntoMasterTable(DATA, AnalogTV_Info); | ||
| 1242 | uint16_t data_offset; | ||
| 1243 | uint8_t frev, crev; | ||
| 1244 | struct _ATOM_ANALOG_TV_INFO *tv_info; | ||
| 1245 | enum radeon_tv_std tv_std = TV_STD_NTSC; | ||
| 1246 | |||
| 1247 | atom_parse_data_header(mode_info->atom_context, index, NULL, &frev, &crev, &data_offset); | ||
| 1248 | |||
| 1249 | tv_info = (struct _ATOM_ANALOG_TV_INFO *)(mode_info->atom_context->bios + data_offset); | ||
| 1250 | |||
| 1251 | switch (tv_info->ucTV_BootUpDefaultStandard) { | ||
| 1252 | case ATOM_TV_NTSC: | ||
| 1253 | tv_std = TV_STD_NTSC; | ||
| 1254 | DRM_INFO("Default TV standard: NTSC\n"); | ||
| 1255 | break; | ||
| 1256 | case ATOM_TV_NTSCJ: | ||
| 1257 | tv_std = TV_STD_NTSC_J; | ||
| 1258 | DRM_INFO("Default TV standard: NTSC-J\n"); | ||
| 1259 | break; | ||
| 1260 | case ATOM_TV_PAL: | ||
| 1261 | tv_std = TV_STD_PAL; | ||
| 1262 | DRM_INFO("Default TV standard: PAL\n"); | ||
| 1263 | break; | ||
| 1264 | case ATOM_TV_PALM: | ||
| 1265 | tv_std = TV_STD_PAL_M; | ||
| 1266 | DRM_INFO("Default TV standard: PAL-M\n"); | ||
| 1267 | break; | ||
| 1268 | case ATOM_TV_PALN: | ||
| 1269 | tv_std = TV_STD_PAL_N; | ||
| 1270 | DRM_INFO("Default TV standard: PAL-N\n"); | ||
| 1271 | break; | ||
| 1272 | case ATOM_TV_PALCN: | ||
| 1273 | tv_std = TV_STD_PAL_CN; | ||
| 1274 | DRM_INFO("Default TV standard: PAL-CN\n"); | ||
| 1275 | break; | ||
| 1276 | case ATOM_TV_PAL60: | ||
| 1277 | tv_std = TV_STD_PAL_60; | ||
| 1278 | DRM_INFO("Default TV standard: PAL-60\n"); | ||
| 1279 | break; | ||
| 1280 | case ATOM_TV_SECAM: | ||
| 1281 | tv_std = TV_STD_SECAM; | ||
| 1282 | DRM_INFO("Default TV standard: SECAM\n"); | ||
| 1283 | break; | ||
| 1284 | default: | ||
| 1285 | tv_std = TV_STD_NTSC; | ||
| 1286 | DRM_INFO("Unknown TV standard; defaulting to NTSC\n"); | ||
| 1287 | break; | ||
| 1288 | } | ||
| 1289 | return tv_std; | ||
| 1290 | } | ||
| 1291 | |||
| 1237 | struct radeon_encoder_tv_dac * | 1292 | struct radeon_encoder_tv_dac * |
| 1238 | radeon_atombios_get_tv_dac_info(struct radeon_encoder *encoder) | 1293 | radeon_atombios_get_tv_dac_info(struct radeon_encoder *encoder) |
| 1239 | { | 1294 | { |
| @@ -1269,6 +1324,7 @@ radeon_atombios_get_tv_dac_info(struct radeon_encoder *encoder) | |||
| 1269 | dac = dac_info->ucDAC2_NTSC_DAC_Adjustment; | 1324 | dac = dac_info->ucDAC2_NTSC_DAC_Adjustment; |
| 1270 | tv_dac->ntsc_tvdac_adj = (bg << 16) | (dac << 20); | 1325 | tv_dac->ntsc_tvdac_adj = (bg << 16) | (dac << 20); |
| 1271 | 1326 | ||
| 1327 | tv_dac->tv_std = radeon_atombios_get_tv_info(rdev); | ||
| 1272 | } | 1328 | } |
| 1273 | return tv_dac; | 1329 | return tv_dac; |
| 1274 | } | 1330 | } |
diff --git a/drivers/gpu/drm/radeon/radeon_combios.c b/drivers/gpu/drm/radeon/radeon_combios.c index c5021a3445de..fd94dbca33ac 100644 --- a/drivers/gpu/drm/radeon/radeon_combios.c +++ b/drivers/gpu/drm/radeon/radeon_combios.c | |||
| @@ -634,11 +634,10 @@ struct radeon_encoder_primary_dac *radeon_combios_get_primary_dac_info(struct | |||
| 634 | return p_dac; | 634 | return p_dac; |
| 635 | } | 635 | } |
| 636 | 636 | ||
| 637 | static enum radeon_tv_std | 637 | enum radeon_tv_std |
| 638 | radeon_combios_get_tv_info(struct radeon_encoder *encoder) | 638 | radeon_combios_get_tv_info(struct radeon_device *rdev) |
| 639 | { | 639 | { |
| 640 | struct drm_device *dev = encoder->base.dev; | 640 | struct drm_device *dev = rdev->ddev; |
| 641 | struct radeon_device *rdev = dev->dev_private; | ||
| 642 | uint16_t tv_info; | 641 | uint16_t tv_info; |
| 643 | enum radeon_tv_std tv_std = TV_STD_NTSC; | 642 | enum radeon_tv_std tv_std = TV_STD_NTSC; |
| 644 | 643 | ||
| @@ -779,7 +778,7 @@ struct radeon_encoder_tv_dac *radeon_combios_get_tv_dac_info(struct | |||
| 779 | tv_dac->ntsc_tvdac_adj = (bg << 16) | (dac << 20); | 778 | tv_dac->ntsc_tvdac_adj = (bg << 16) | (dac << 20); |
| 780 | found = 1; | 779 | found = 1; |
| 781 | } | 780 | } |
| 782 | tv_dac->tv_std = radeon_combios_get_tv_info(encoder); | 781 | tv_dac->tv_std = radeon_combios_get_tv_info(rdev); |
| 783 | } | 782 | } |
| 784 | if (!found) { | 783 | if (!found) { |
| 785 | /* then check CRT table */ | 784 | /* then check CRT table */ |
diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c index 5eece186e03c..8da06e17ff27 100644 --- a/drivers/gpu/drm/radeon/radeon_connectors.c +++ b/drivers/gpu/drm/radeon/radeon_connectors.c | |||
| @@ -1171,7 +1171,7 @@ radeon_add_atom_connector(struct drm_device *dev, | |||
| 1171 | 1); | 1171 | 1); |
| 1172 | drm_connector_attach_property(&radeon_connector->base, | 1172 | drm_connector_attach_property(&radeon_connector->base, |
| 1173 | rdev->mode_info.tv_std_property, | 1173 | rdev->mode_info.tv_std_property, |
| 1174 | 1); | 1174 | radeon_atombios_get_tv_info(rdev)); |
| 1175 | } | 1175 | } |
| 1176 | break; | 1176 | break; |
| 1177 | case DRM_MODE_CONNECTOR_LVDS: | 1177 | case DRM_MODE_CONNECTOR_LVDS: |
| @@ -1315,7 +1315,7 @@ radeon_add_legacy_connector(struct drm_device *dev, | |||
| 1315 | 1); | 1315 | 1); |
| 1316 | drm_connector_attach_property(&radeon_connector->base, | 1316 | drm_connector_attach_property(&radeon_connector->base, |
| 1317 | rdev->mode_info.tv_std_property, | 1317 | rdev->mode_info.tv_std_property, |
| 1318 | 1); | 1318 | radeon_combios_get_tv_info(rdev)); |
| 1319 | } | 1319 | } |
| 1320 | break; | 1320 | break; |
| 1321 | case DRM_MODE_CONNECTOR_LVDS: | 1321 | case DRM_MODE_CONNECTOR_LVDS: |
diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c index a133b833e45d..91d72b70abc9 100644 --- a/drivers/gpu/drm/radeon/radeon_display.c +++ b/drivers/gpu/drm/radeon/radeon_display.c | |||
| @@ -739,7 +739,7 @@ static struct drm_prop_enum_list radeon_tv_std_enum_list[] = | |||
| 739 | { TV_STD_SECAM, "secam" }, | 739 | { TV_STD_SECAM, "secam" }, |
| 740 | }; | 740 | }; |
| 741 | 741 | ||
| 742 | int radeon_modeset_create_props(struct radeon_device *rdev) | 742 | static int radeon_modeset_create_props(struct radeon_device *rdev) |
| 743 | { | 743 | { |
| 744 | int i, sz; | 744 | int i, sz; |
| 745 | 745 | ||
diff --git a/drivers/gpu/drm/radeon/radeon_mode.h b/drivers/gpu/drm/radeon/radeon_mode.h index 3dcbe130c422..402369db5ba0 100644 --- a/drivers/gpu/drm/radeon/radeon_mode.h +++ b/drivers/gpu/drm/radeon/radeon_mode.h | |||
| @@ -88,6 +88,7 @@ enum radeon_tv_std { | |||
| 88 | TV_STD_SCART_PAL, | 88 | TV_STD_SCART_PAL, |
| 89 | TV_STD_SECAM, | 89 | TV_STD_SECAM, |
| 90 | TV_STD_PAL_CN, | 90 | TV_STD_PAL_CN, |
| 91 | TV_STD_PAL_N, | ||
| 91 | }; | 92 | }; |
| 92 | 93 | ||
| 93 | /* radeon gpio-based i2c | 94 | /* radeon gpio-based i2c |
| @@ -395,6 +396,11 @@ struct radeon_framebuffer { | |||
| 395 | struct drm_gem_object *obj; | 396 | struct drm_gem_object *obj; |
| 396 | }; | 397 | }; |
| 397 | 398 | ||
| 399 | extern enum radeon_tv_std | ||
| 400 | radeon_combios_get_tv_info(struct radeon_device *rdev); | ||
| 401 | extern enum radeon_tv_std | ||
| 402 | radeon_atombios_get_tv_info(struct radeon_device *rdev); | ||
| 403 | |||
| 398 | extern void radeon_connector_hotplug(struct drm_connector *connector); | 404 | extern void radeon_connector_hotplug(struct drm_connector *connector); |
| 399 | extern bool radeon_dp_needs_link_train(struct radeon_connector *radeon_connector); | 405 | extern bool radeon_dp_needs_link_train(struct radeon_connector *radeon_connector); |
| 400 | extern int radeon_dp_mode_valid_helper(struct radeon_connector *radeon_connector, | 406 | extern int radeon_dp_mode_valid_helper(struct radeon_connector *radeon_connector, |
