diff options
author | Maarten Maathuis <madman2003@gmail.com> | 2008-07-05 20:17:49 +0200 |
---|---|---|
committer | Maarten Maathuis <madman2003@gmail.com> | 2008-07-05 20:17:49 +0200 |
commit | e1cd21bcc8747fcc573708bd4d74df39b60c476a (patch) | |
tree | 26279ab6adea7ad1534a6b333d96975c01b709ef /linux-core/nv50_fbcon.c | |
parent | c48cddc7ef984c1e05ed4f64a7fc182b6a5031f5 (diff) |
NV50: remove edid when monitor is gone, improve fbcon, misc fixes
- This should avoid switching crtc's when going to fbcon.
Diffstat (limited to 'linux-core/nv50_fbcon.c')
-rw-r--r-- | linux-core/nv50_fbcon.c | 46 |
1 files changed, 37 insertions, 9 deletions
diff --git a/linux-core/nv50_fbcon.c b/linux-core/nv50_fbcon.c index c428ff94..8969860b 100644 --- a/linux-core/nv50_fbcon.c +++ b/linux-core/nv50_fbcon.c @@ -284,16 +284,21 @@ static int nv50_fbcon_set_par(struct fb_info *info) } mode_set.mode = drm_mode; - list_for_each_entry(drm_crtc, &dev->mode_config.crtc_list, head) { - if (crtc_used[crtc_count]) { - crtc_count++; - continue; + /* choose crtc it already has, if possible */ + if (drm_connector->encoder) { + struct drm_encoder *drm_encoder = drm_connector->encoder; + + if (drm_encoder->crtc) { + list_for_each_entry(drm_crtc, &dev->mode_config.crtc_list, head) { + crtc_count++; + + if (drm_crtc == drm_encoder->crtc) { + if (!crtc_used[crtc_count]) /* still available? */ + mode_set.crtc = drm_crtc; + break; + } + } } - - /* found a crtc */ - mode_set.crtc = drm_crtc; - - break; } /* proceed as planned */ @@ -302,6 +307,29 @@ static int nv50_fbcon_set_par(struct fb_info *info) crtc_used[crtc_count] = true; } + if (!mode_set.crtc) { + crtc_count = 0; /* reset */ + + /* choose a "random" crtc */ + list_for_each_entry(drm_crtc, &dev->mode_config.crtc_list, head) { + if (crtc_used[crtc_count]) { + crtc_count++; + continue; + } + + /* found a crtc */ + mode_set.crtc = drm_crtc; + + break; + } + + /* proceed as planned */ + if (mode_set.crtc) { + mode_set.crtc->funcs->set_config(&mode_set); + crtc_used[crtc_count] = true; + } + } + kfree(mode_set.connectors); } |