diff options
author | Dave Airlie <airlied@redhat.com> | 2009-10-13 00:10:37 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2009-12-01 20:37:09 -0500 |
commit | 1f3b6a45f0805690269a7a9d265cbbc2f15b6c6e (patch) | |
tree | 76e2d95a6b3da15598cd493b073ed00e6ecc2b69 /drivers/gpu | |
parent | 2de3b4841f67a15c7b8e820b84dd6b7cc41370da (diff) |
drm/radeon/kms: add support for encoder cloning.
The RN50 really needs this since its a single crtc card,
however other gpus may benefit from it as well.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_display.c | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_encoders.c | 46 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_legacy_encoders.c | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_mode.h | 2 |
4 files changed, 48 insertions, 2 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c index 5859109f924d..62b02372cb09 100644 --- a/drivers/gpu/drm/radeon/radeon_display.c +++ b/drivers/gpu/drm/radeon/radeon_display.c | |||
@@ -324,6 +324,7 @@ static bool radeon_setup_enc_conn(struct drm_device *dev) | |||
324 | ret = radeon_get_legacy_connector_info_from_table(dev); | 324 | ret = radeon_get_legacy_connector_info_from_table(dev); |
325 | } | 325 | } |
326 | if (ret) { | 326 | if (ret) { |
327 | radeon_setup_encoder_clones(dev); | ||
327 | radeon_print_display_setup(dev); | 328 | radeon_print_display_setup(dev); |
328 | list_for_each_entry(drm_connector, &dev->mode_config.connector_list, head) | 329 | list_for_each_entry(drm_connector, &dev->mode_config.connector_list, head) |
329 | radeon_ddc_dump(drm_connector); | 330 | radeon_ddc_dump(drm_connector); |
diff --git a/drivers/gpu/drm/radeon/radeon_encoders.c b/drivers/gpu/drm/radeon/radeon_encoders.c index 57a29f36115e..52e484fc75ff 100644 --- a/drivers/gpu/drm/radeon/radeon_encoders.c +++ b/drivers/gpu/drm/radeon/radeon_encoders.c | |||
@@ -35,6 +35,51 @@ extern int atom_debug; | |||
35 | bool radeon_atom_get_tv_timings(struct radeon_device *rdev, int index, | 35 | bool radeon_atom_get_tv_timings(struct radeon_device *rdev, int index, |
36 | struct drm_display_mode *mode); | 36 | struct drm_display_mode *mode); |
37 | 37 | ||
38 | static uint32_t radeon_encoder_clones(struct drm_encoder *encoder) | ||
39 | { | ||
40 | struct drm_device *dev = encoder->dev; | ||
41 | struct radeon_device *rdev = dev->dev_private; | ||
42 | struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); | ||
43 | struct drm_encoder *clone_encoder; | ||
44 | uint32_t index_mask = 0; | ||
45 | int count; | ||
46 | |||
47 | /* DIG routing gets problematic */ | ||
48 | if (rdev->family >= CHIP_R600) | ||
49 | return index_mask; | ||
50 | /* LVDS/TV are too wacky */ | ||
51 | if (radeon_encoder->devices & ATOM_DEVICE_LCD_SUPPORT) | ||
52 | return index_mask; | ||
53 | /* DVO requires 2x ppll clocks depending on tmds chip */ | ||
54 | if (radeon_encoder->devices & ATOM_DEVICE_DFP2_SUPPORT) | ||
55 | return index_mask; | ||
56 | |||
57 | count = -1; | ||
58 | list_for_each_entry(clone_encoder, &dev->mode_config.encoder_list, head) { | ||
59 | struct radeon_encoder *radeon_clone = to_radeon_encoder(clone_encoder); | ||
60 | count++; | ||
61 | |||
62 | if (clone_encoder == encoder) | ||
63 | continue; | ||
64 | if (radeon_clone->devices & (ATOM_DEVICE_LCD_SUPPORT)) | ||
65 | continue; | ||
66 | if (radeon_clone->devices & ATOM_DEVICE_DFP2_SUPPORT) | ||
67 | continue; | ||
68 | else | ||
69 | index_mask |= (1 << count); | ||
70 | } | ||
71 | return index_mask; | ||
72 | } | ||
73 | |||
74 | void radeon_setup_encoder_clones(struct drm_device *dev) | ||
75 | { | ||
76 | struct drm_encoder *encoder; | ||
77 | |||
78 | list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) { | ||
79 | encoder->possible_clones = radeon_encoder_clones(encoder); | ||
80 | } | ||
81 | } | ||
82 | |||
38 | uint32_t | 83 | uint32_t |
39 | radeon_get_encoder_id(struct drm_device *dev, uint32_t supported_device, uint8_t dac) | 84 | radeon_get_encoder_id(struct drm_device *dev, uint32_t supported_device, uint8_t dac) |
40 | { | 85 | { |
@@ -1341,7 +1386,6 @@ radeon_add_atom_encoder(struct drm_device *dev, uint32_t encoder_id, uint32_t su | |||
1341 | encoder->possible_crtcs = 0x1; | 1386 | encoder->possible_crtcs = 0x1; |
1342 | else | 1387 | else |
1343 | encoder->possible_crtcs = 0x3; | 1388 | encoder->possible_crtcs = 0x3; |
1344 | encoder->possible_clones = 0; | ||
1345 | 1389 | ||
1346 | radeon_encoder->enc_priv = NULL; | 1390 | radeon_encoder->enc_priv = NULL; |
1347 | 1391 | ||
diff --git a/drivers/gpu/drm/radeon/radeon_legacy_encoders.c b/drivers/gpu/drm/radeon/radeon_legacy_encoders.c index ae554bfa0548..36ac47672a3c 100644 --- a/drivers/gpu/drm/radeon/radeon_legacy_encoders.c +++ b/drivers/gpu/drm/radeon/radeon_legacy_encoders.c | |||
@@ -1331,7 +1331,6 @@ radeon_add_legacy_encoder(struct drm_device *dev, uint32_t encoder_id, uint32_t | |||
1331 | encoder->possible_crtcs = 0x1; | 1331 | encoder->possible_crtcs = 0x1; |
1332 | else | 1332 | else |
1333 | encoder->possible_crtcs = 0x3; | 1333 | encoder->possible_crtcs = 0x3; |
1334 | encoder->possible_clones = 0; | ||
1335 | 1334 | ||
1336 | radeon_encoder->enc_priv = NULL; | 1335 | radeon_encoder->enc_priv = NULL; |
1337 | 1336 | ||
diff --git a/drivers/gpu/drm/radeon/radeon_mode.h b/drivers/gpu/drm/radeon/radeon_mode.h index d7a29ce19df8..5c25930d9bcf 100644 --- a/drivers/gpu/drm/radeon/radeon_mode.h +++ b/drivers/gpu/drm/radeon/radeon_mode.h | |||
@@ -377,6 +377,8 @@ extern void radeon_compute_pll(struct radeon_pll *pll, | |||
377 | uint32_t *post_div_p, | 377 | uint32_t *post_div_p, |
378 | int flags); | 378 | int flags); |
379 | 379 | ||
380 | extern void radeon_setup_encoder_clones(struct drm_device *dev); | ||
381 | |||
380 | struct drm_encoder *radeon_encoder_legacy_lvds_add(struct drm_device *dev, int bios_index); | 382 | struct drm_encoder *radeon_encoder_legacy_lvds_add(struct drm_device *dev, int bios_index); |
381 | struct drm_encoder *radeon_encoder_legacy_primary_dac_add(struct drm_device *dev, int bios_index, int with_tv); | 383 | struct drm_encoder *radeon_encoder_legacy_primary_dac_add(struct drm_device *dev, int bios_index, int with_tv); |
382 | struct drm_encoder *radeon_encoder_legacy_tv_dac_add(struct drm_device *dev, int bios_index, int with_tv); | 384 | struct drm_encoder *radeon_encoder_legacy_tv_dac_add(struct drm_device *dev, int bios_index, int with_tv); |