diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2010-06-28 00:35:50 -0400 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2010-07-12 20:13:09 -0400 |
commit | 8f1a60868f4594bc5576cca8952635f475e8bec6 (patch) | |
tree | 23eeab5d99ecaee1f6c8c94e21911cfa8fc47de1 /drivers/gpu/drm/nouveau/nv50_display.c | |
parent | 3195c5f9784aa8ec27a7bb19a6840dc67e9e90f1 (diff) |
drm/nouveau: tidy connector/encoder creation a little
Create connectors before encoders to avoid having to do another loop across
encoder list whenever we create a new connector. This allows us to pass
the connector to the encoder creation functions, and avoid using a
create_resources() callback since we can now call it directly.
This can also potentially modify the connector ordering on nv50. On cards
where the DCB connector and encoder tables are in the same order, things
will be unchanged. However, there's some cards where the ordering between
the tables differ, and in one case, leads us to naming the connectors
"wrongly".
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nv50_display.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/nv50_display.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/drivers/gpu/drm/nouveau/nv50_display.c b/drivers/gpu/drm/nouveau/nv50_display.c index 515edde2c59f..e031904ef7a7 100644 --- a/drivers/gpu/drm/nouveau/nv50_display.c +++ b/drivers/gpu/drm/nouveau/nv50_display.c | |||
@@ -465,6 +465,7 @@ int nv50_display_create(struct drm_device *dev) | |||
465 | { | 465 | { |
466 | struct drm_nouveau_private *dev_priv = dev->dev_private; | 466 | struct drm_nouveau_private *dev_priv = dev->dev_private; |
467 | struct dcb_table *dcb = &dev_priv->vbios.dcb; | 467 | struct dcb_table *dcb = &dev_priv->vbios.dcb; |
468 | struct drm_connector *connector, *ct; | ||
468 | int ret, i; | 469 | int ret, i; |
469 | 470 | ||
470 | NV_DEBUG_KMS(dev, "\n"); | 471 | NV_DEBUG_KMS(dev, "\n"); |
@@ -507,14 +508,18 @@ int nv50_display_create(struct drm_device *dev) | |||
507 | continue; | 508 | continue; |
508 | } | 509 | } |
509 | 510 | ||
511 | connector = nouveau_connector_create(dev, entry->connector); | ||
512 | if (IS_ERR(connector)) | ||
513 | continue; | ||
514 | |||
510 | switch (entry->type) { | 515 | switch (entry->type) { |
511 | case OUTPUT_TMDS: | 516 | case OUTPUT_TMDS: |
512 | case OUTPUT_LVDS: | 517 | case OUTPUT_LVDS: |
513 | case OUTPUT_DP: | 518 | case OUTPUT_DP: |
514 | nv50_sor_create(dev, entry); | 519 | nv50_sor_create(connector, entry); |
515 | break; | 520 | break; |
516 | case OUTPUT_ANALOG: | 521 | case OUTPUT_ANALOG: |
517 | nv50_dac_create(dev, entry); | 522 | nv50_dac_create(connector, entry); |
518 | break; | 523 | break; |
519 | default: | 524 | default: |
520 | NV_WARN(dev, "DCB encoder %d unknown\n", entry->type); | 525 | NV_WARN(dev, "DCB encoder %d unknown\n", entry->type); |
@@ -522,11 +527,13 @@ int nv50_display_create(struct drm_device *dev) | |||
522 | } | 527 | } |
523 | } | 528 | } |
524 | 529 | ||
525 | for (i = 0 ; i < dcb->connector.entries; i++) { | 530 | list_for_each_entry_safe(connector, ct, |
526 | if (i != 0 && dcb->connector.entry[i].index2 == | 531 | &dev->mode_config.connector_list, head) { |
527 | dcb->connector.entry[i - 1].index2) | 532 | if (!connector->encoder_ids[0]) { |
528 | continue; | 533 | NV_WARN(dev, "%s has no encoders, removing\n", |
529 | nouveau_connector_create(dev, &dcb->connector.entry[i]); | 534 | drm_get_connector_name(connector)); |
535 | connector->funcs->destroy(connector); | ||
536 | } | ||
530 | } | 537 | } |
531 | 538 | ||
532 | ret = nv50_display_init(dev); | 539 | ret = nv50_display_init(dev); |