aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nv50_display.c
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2010-02-23 21:07:31 -0500
committerBen Skeggs <bskeggs@redhat.com>2010-02-25 00:09:32 -0500
commit7f612d87f8b4b1ddbcee04264a93e5af7b9f21c7 (patch)
tree2424853fa26091abdfb946aecbcc4d6b78d24ce8 /drivers/gpu/drm/nouveau/nv50_display.c
parentdc5bc4ed3815dfec2f3ecfbf6f7983440040fe22 (diff)
drm/nouveau: use dcb connector table for creating drm connectors
This makes this code common to both the nv04 and nv50 paths. For the moment, we keep the previous behaviour with HDMI/eDP connectors and report them as DVI-D/DP instead. This will be fixed once the rest of the code has been fixed to deal with those types. 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.c40
1 files changed, 4 insertions, 36 deletions
diff --git a/drivers/gpu/drm/nouveau/nv50_display.c b/drivers/gpu/drm/nouveau/nv50_display.c
index c406be6fdc5..ebcd8bf2406 100644
--- a/drivers/gpu/drm/nouveau/nv50_display.c
+++ b/drivers/gpu/drm/nouveau/nv50_display.c
@@ -466,7 +466,6 @@ int nv50_display_create(struct drm_device *dev)
466{ 466{
467 struct drm_nouveau_private *dev_priv = dev->dev_private; 467 struct drm_nouveau_private *dev_priv = dev->dev_private;
468 struct dcb_table *dcb = &dev_priv->vbios.dcb; 468 struct dcb_table *dcb = &dev_priv->vbios.dcb;
469 uint32_t connector[16] = {};
470 int ret, i; 469 int ret, i;
471 470
472 NV_DEBUG_KMS(dev, "\n"); 471 NV_DEBUG_KMS(dev, "\n");
@@ -522,44 +521,13 @@ int nv50_display_create(struct drm_device *dev)
522 NV_WARN(dev, "DCB encoder %d unknown\n", entry->type); 521 NV_WARN(dev, "DCB encoder %d unknown\n", entry->type);
523 continue; 522 continue;
524 } 523 }
525
526 connector[entry->connector] |= (1 << entry->type);
527 } 524 }
528 525
529 /* It appears that DCB 3.0+ vbios has a connector table, however, 526 for (i = 0 ; i < dcb->connector.entries; i++) {
530 * I'm not 100% certain how to decode it correctly yet so just 527 if (i != 0 && dcb->connector.entry[i].index ==
531 * look at what encoders are present on each connector index and 528 dcb->connector.entry[i - 1].index)
532 * attempt to derive the connector type from that.
533 */
534 for (i = 0 ; i < dcb->entries; i++) {
535 struct dcb_entry *entry = &dcb->entry[i];
536 uint16_t encoders;
537 int type;
538
539 encoders = connector[entry->connector];
540 if (!(encoders & (1 << entry->type)))
541 continue; 529 continue;
542 connector[entry->connector] = 0; 530 nouveau_connector_create(dev, &dcb->connector.entry[i]);
543
544 if (encoders & (1 << OUTPUT_DP)) {
545 type = DRM_MODE_CONNECTOR_DisplayPort;
546 } else if (encoders & (1 << OUTPUT_TMDS)) {
547 if (encoders & (1 << OUTPUT_ANALOG))
548 type = DRM_MODE_CONNECTOR_DVII;
549 else
550 type = DRM_MODE_CONNECTOR_DVID;
551 } else if (encoders & (1 << OUTPUT_ANALOG)) {
552 type = DRM_MODE_CONNECTOR_VGA;
553 } else if (encoders & (1 << OUTPUT_LVDS)) {
554 type = DRM_MODE_CONNECTOR_LVDS;
555 } else {
556 type = DRM_MODE_CONNECTOR_Unknown;
557 }
558
559 if (type == DRM_MODE_CONNECTOR_Unknown)
560 continue;
561
562 nouveau_connector_create(dev, entry->connector, type);
563 } 531 }
564 532
565 ret = nv50_display_init(dev); 533 ret = nv50_display_init(dev);