aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nv50_dac.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/nv50_dac.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/nv50_dac.c')
-rw-r--r--drivers/gpu/drm/nouveau/nv50_dac.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/gpu/drm/nouveau/nv50_dac.c b/drivers/gpu/drm/nouveau/nv50_dac.c
index 1fd9537beff6..e114f818751d 100644
--- a/drivers/gpu/drm/nouveau/nv50_dac.c
+++ b/drivers/gpu/drm/nouveau/nv50_dac.c
@@ -275,14 +275,11 @@ static const struct drm_encoder_funcs nv50_dac_encoder_funcs = {
275}; 275};
276 276
277int 277int
278nv50_dac_create(struct drm_device *dev, struct dcb_entry *entry) 278nv50_dac_create(struct drm_connector *connector, struct dcb_entry *entry)
279{ 279{
280 struct nouveau_encoder *nv_encoder; 280 struct nouveau_encoder *nv_encoder;
281 struct drm_encoder *encoder; 281 struct drm_encoder *encoder;
282 282
283 NV_DEBUG_KMS(dev, "\n");
284 NV_INFO(dev, "Detected a DAC output\n");
285
286 nv_encoder = kzalloc(sizeof(*nv_encoder), GFP_KERNEL); 283 nv_encoder = kzalloc(sizeof(*nv_encoder), GFP_KERNEL);
287 if (!nv_encoder) 284 if (!nv_encoder)
288 return -ENOMEM; 285 return -ENOMEM;
@@ -293,12 +290,14 @@ nv50_dac_create(struct drm_device *dev, struct dcb_entry *entry)
293 290
294 nv_encoder->disconnect = nv50_dac_disconnect; 291 nv_encoder->disconnect = nv50_dac_disconnect;
295 292
296 drm_encoder_init(dev, encoder, &nv50_dac_encoder_funcs, 293 drm_encoder_init(connector->dev, encoder, &nv50_dac_encoder_funcs,
297 DRM_MODE_ENCODER_DAC); 294 DRM_MODE_ENCODER_DAC);
298 drm_encoder_helper_add(encoder, &nv50_dac_helper_funcs); 295 drm_encoder_helper_add(encoder, &nv50_dac_helper_funcs);
299 296
300 encoder->possible_crtcs = entry->heads; 297 encoder->possible_crtcs = entry->heads;
301 encoder->possible_clones = 0; 298 encoder->possible_clones = 0;
299
300 drm_mode_connector_attach_encoder(connector, encoder);
302 return 0; 301 return 0;
303} 302}
304 303