aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nv04_dfp.c
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2010-06-28 00:35:50 -0400
committerBen Skeggs <bskeggs@redhat.com>2010-07-12 20:13:09 -0400
commit8f1a60868f4594bc5576cca8952635f475e8bec6 (patch)
tree23eeab5d99ecaee1f6c8c94e21911cfa8fc47de1 /drivers/gpu/drm/nouveau/nv04_dfp.c
parent3195c5f9784aa8ec27a7bb19a6840dc67e9e90f1 (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/nv04_dfp.c')
-rw-r--r--drivers/gpu/drm/nouveau/nv04_dfp.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/gpu/drm/nouveau/nv04_dfp.c b/drivers/gpu/drm/nouveau/nv04_dfp.c
index 41634d4752f..3559d8972c7 100644
--- a/drivers/gpu/drm/nouveau/nv04_dfp.c
+++ b/drivers/gpu/drm/nouveau/nv04_dfp.c
@@ -584,11 +584,12 @@ static const struct drm_encoder_funcs nv04_dfp_funcs = {
584 .destroy = nv04_dfp_destroy, 584 .destroy = nv04_dfp_destroy,
585}; 585};
586 586
587int nv04_dfp_create(struct drm_device *dev, struct dcb_entry *entry) 587int
588nv04_dfp_create(struct drm_connector *connector, struct dcb_entry *entry)
588{ 589{
589 const struct drm_encoder_helper_funcs *helper; 590 const struct drm_encoder_helper_funcs *helper;
590 struct drm_encoder *encoder;
591 struct nouveau_encoder *nv_encoder = NULL; 591 struct nouveau_encoder *nv_encoder = NULL;
592 struct drm_encoder *encoder;
592 int type; 593 int type;
593 594
594 switch (entry->type) { 595 switch (entry->type) {
@@ -613,11 +614,12 @@ int nv04_dfp_create(struct drm_device *dev, struct dcb_entry *entry)
613 nv_encoder->dcb = entry; 614 nv_encoder->dcb = entry;
614 nv_encoder->or = ffs(entry->or) - 1; 615 nv_encoder->or = ffs(entry->or) - 1;
615 616
616 drm_encoder_init(dev, encoder, &nv04_dfp_funcs, type); 617 drm_encoder_init(connector->dev, encoder, &nv04_dfp_funcs, type);
617 drm_encoder_helper_add(encoder, helper); 618 drm_encoder_helper_add(encoder, helper);
618 619
619 encoder->possible_crtcs = entry->heads; 620 encoder->possible_crtcs = entry->heads;
620 encoder->possible_clones = 0; 621 encoder->possible_clones = 0;
621 622
623 drm_mode_connector_attach_encoder(connector, encoder);
622 return 0; 624 return 0;
623} 625}