aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nv04_display.c
diff options
context:
space:
mode:
authorFrancisco Jerez <currojerez@riseup.net>2010-07-24 11:37:33 -0400
committerBen Skeggs <bskeggs@redhat.com>2010-07-25 21:43:36 -0400
commitc88c2e0631b03ffb1485f8790a5b659beb1ac0be (patch)
tree479b2e5ca1c1448121b01d8a31c2e308c00f486f /drivers/gpu/drm/nouveau/nv04_display.c
parentf1feda70b5dfdbe6a1069efffec099b430467331 (diff)
drm/nouveau: Move display init to a new nouveau_engine.
Signed-off-by: Francisco Jerez <currojerez@riseup.net> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nv04_display.c')
-rw-r--r--drivers/gpu/drm/nouveau/nv04_display.c46
1 files changed, 30 insertions, 16 deletions
diff --git a/drivers/gpu/drm/nouveau/nv04_display.c b/drivers/gpu/drm/nouveau/nv04_display.c
index c6df391ebb2e..cd70bd827614 100644
--- a/drivers/gpu/drm/nouveau/nv04_display.c
+++ b/drivers/gpu/drm/nouveau/nv04_display.c
@@ -76,6 +76,32 @@ nv04_display_store_initial_head_owner(struct drm_device *dev)
76} 76}
77 77
78int 78int
79nv04_display_early_init(struct drm_device *dev)
80{
81 /* Unlock the VGA CRTCs. */
82 NVLockVgaCrtcs(dev, false);
83
84 /* Make sure the CRTCs aren't in slaved mode. */
85 if (nv_two_heads(dev)) {
86 nv04_display_store_initial_head_owner(dev);
87 NVSetOwner(dev, 0);
88 }
89
90 return 0;
91}
92
93void
94nv04_display_late_takedown(struct drm_device *dev)
95{
96 struct drm_nouveau_private *dev_priv = dev->dev_private;
97
98 if (nv_two_heads(dev))
99 NVSetOwner(dev, dev_priv->crtc_owner);
100
101 NVLockVgaCrtcs(dev, true);
102}
103
104int
79nv04_display_create(struct drm_device *dev) 105nv04_display_create(struct drm_device *dev)
80{ 106{
81 struct drm_nouveau_private *dev_priv = dev->dev_private; 107 struct drm_nouveau_private *dev_priv = dev->dev_private;
@@ -87,13 +113,6 @@ nv04_display_create(struct drm_device *dev)
87 113
88 NV_DEBUG_KMS(dev, "\n"); 114 NV_DEBUG_KMS(dev, "\n");
89 115
90 NVLockVgaCrtcs(dev, false);
91
92 if (nv_two_heads(dev)) {
93 nv04_display_store_initial_head_owner(dev);
94 NVSetOwner(dev, 0);
95 }
96
97 nouveau_hw_save_vga_fonts(dev, 1); 116 nouveau_hw_save_vga_fonts(dev, 1);
98 117
99 drm_mode_config_init(dev); 118 drm_mode_config_init(dev);
@@ -176,7 +195,6 @@ nv04_display_create(struct drm_device *dev)
176void 195void
177nv04_display_destroy(struct drm_device *dev) 196nv04_display_destroy(struct drm_device *dev)
178{ 197{
179 struct drm_nouveau_private *dev_priv = dev->dev_private;
180 struct drm_encoder *encoder; 198 struct drm_encoder *encoder;
181 struct drm_crtc *crtc; 199 struct drm_crtc *crtc;
182 200
@@ -204,20 +222,14 @@ nv04_display_destroy(struct drm_device *dev)
204 drm_mode_config_cleanup(dev); 222 drm_mode_config_cleanup(dev);
205 223
206 nouveau_hw_save_vga_fonts(dev, 0); 224 nouveau_hw_save_vga_fonts(dev, 0);
207
208 if (nv_two_heads(dev))
209 NVSetOwner(dev, dev_priv->crtc_owner);
210 NVLockVgaCrtcs(dev, true);
211} 225}
212 226
213void 227int
214nv04_display_restore(struct drm_device *dev) 228nv04_display_init(struct drm_device *dev)
215{ 229{
216 struct drm_encoder *encoder; 230 struct drm_encoder *encoder;
217 struct drm_crtc *crtc; 231 struct drm_crtc *crtc;
218 232
219 NVLockVgaCrtcs(dev, false);
220
221 /* meh.. modeset apparently doesn't setup all the regs and depends 233 /* meh.. modeset apparently doesn't setup all the regs and depends
222 * on pre-existing state, for now load the state of the card *before* 234 * on pre-existing state, for now load the state of the card *before*
223 * nouveau was loaded, and then do a modeset. 235 * nouveau was loaded, and then do a modeset.
@@ -234,5 +246,7 @@ nv04_display_restore(struct drm_device *dev)
234 246
235 list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) 247 list_for_each_entry(crtc, &dev->mode_config.crtc_list, head)
236 crtc->funcs->restore(crtc); 248 crtc->funcs->restore(crtc);
249
250 return 0;
237} 251}
238 252