summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nv04_display.c
diff options
context:
space:
mode:
authorFrancisco Jerez <currojerez@riseup.net>2010-07-24 17:37:33 +0200
committerBen Skeggs <bskeggs@redhat.com>2010-07-26 11:43:36 +1000
commitc88c2e0631b03ffb1485f8790a5b659beb1ac0be (patch)
tree479b2e5ca1c1448121b01d8a31c2e308c00f486f /drivers/gpu/drm/nouveau/nv04_display.c
parentf1feda70b5dfdbe6a1069efffec099b430467331 (diff)
downloadtalos-obmc-linux-c88c2e0631b03ffb1485f8790a5b659beb1ac0be.tar.gz
talos-obmc-linux-c88c2e0631b03ffb1485f8790a5b659beb1ac0be.zip
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)
}
int
+nv04_display_early_init(struct drm_device *dev)
+{
+ /* Unlock the VGA CRTCs. */
+ NVLockVgaCrtcs(dev, false);
+
+ /* Make sure the CRTCs aren't in slaved mode. */
+ if (nv_two_heads(dev)) {
+ nv04_display_store_initial_head_owner(dev);
+ NVSetOwner(dev, 0);
+ }
+
+ return 0;
+}
+
+void
+nv04_display_late_takedown(struct drm_device *dev)
+{
+ struct drm_nouveau_private *dev_priv = dev->dev_private;
+
+ if (nv_two_heads(dev))
+ NVSetOwner(dev, dev_priv->crtc_owner);
+
+ NVLockVgaCrtcs(dev, true);
+}
+
+int
nv04_display_create(struct drm_device *dev)
{
struct drm_nouveau_private *dev_priv = dev->dev_private;
@@ -87,13 +113,6 @@ nv04_display_create(struct drm_device *dev)
NV_DEBUG_KMS(dev, "\n");
- NVLockVgaCrtcs(dev, false);
-
- if (nv_two_heads(dev)) {
- nv04_display_store_initial_head_owner(dev);
- NVSetOwner(dev, 0);
- }
-
nouveau_hw_save_vga_fonts(dev, 1);
drm_mode_config_init(dev);
@@ -176,7 +195,6 @@ nv04_display_create(struct drm_device *dev)
void
nv04_display_destroy(struct drm_device *dev)
{
- struct drm_nouveau_private *dev_priv = dev->dev_private;
struct drm_encoder *encoder;
struct drm_crtc *crtc;
@@ -204,20 +222,14 @@ nv04_display_destroy(struct drm_device *dev)
drm_mode_config_cleanup(dev);
nouveau_hw_save_vga_fonts(dev, 0);
-
- if (nv_two_heads(dev))
- NVSetOwner(dev, dev_priv->crtc_owner);
- NVLockVgaCrtcs(dev, true);
}
-void
-nv04_display_restore(struct drm_device *dev)
+int
+nv04_display_init(struct drm_device *dev)
{
struct drm_encoder *encoder;
struct drm_crtc *crtc;
- NVLockVgaCrtcs(dev, false);
-
/* meh.. modeset apparently doesn't setup all the regs and depends
* on pre-existing state, for now load the state of the card *before*
* nouveau was loaded, and then do a modeset.
@@ -234,5 +246,7 @@ nv04_display_restore(struct drm_device *dev)
list_for_each_entry(crtc, &dev->mode_config.crtc_list, head)
crtc->funcs->restore(crtc);
+
+ return 0;
}
OpenPOWER on IntegriCloud