OSDN Git Service

drm/nouveau/kms: display destroy/init/fini hooks can be static
authorBen Skeggs <bskeggs@redhat.com>
Tue, 12 Feb 2019 12:28:13 +0000 (22:28 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Tue, 19 Feb 2019 22:59:59 +0000 (08:59 +1000)
Swapped order of functions in dispnv04 to allow this, but no code changes.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/dispnv04/disp.c
drivers/gpu/drm/nouveau/dispnv04/disp.h
drivers/gpu/drm/nouveau/dispnv50/disp.c

index 1727d39..f2abae3 100644 (file)
 #include "nouveau_encoder.h"
 #include "nouveau_connector.h"
 
+static void
+nv04_display_fini(struct drm_device *dev)
+{
+       /* Disable vblank interrupts. */
+       NVWriteCRTC(dev, 0, NV_PCRTC_INTR_EN_0, 0);
+       if (nv_two_heads(dev))
+               NVWriteCRTC(dev, 1, NV_PCRTC_INTR_EN_0, 0);
+}
+
+static int
+nv04_display_init(struct drm_device *dev)
+{
+       struct nouveau_encoder *encoder;
+       struct nouveau_crtc *crtc;
+
+       /* 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.
+        *
+        * best thing to do probably is to make save/restore routines not
+        * save/restore "pre-load" state, but more general so we can save
+        * on suspend too.
+        */
+       list_for_each_entry(crtc, &dev->mode_config.crtc_list, base.head)
+               crtc->save(&crtc->base);
+
+       list_for_each_entry(encoder, &dev->mode_config.encoder_list, base.base.head)
+               encoder->enc_save(&encoder->base.base);
+
+       return 0;
+}
+
+static void
+nv04_display_destroy(struct drm_device *dev)
+{
+       struct nv04_display *disp = nv04_display(dev);
+       struct nouveau_drm *drm = nouveau_drm(dev);
+       struct nouveau_encoder *encoder;
+       struct nouveau_crtc *nv_crtc;
+
+       /* Restore state */
+       list_for_each_entry(encoder, &dev->mode_config.encoder_list, base.base.head)
+               encoder->enc_restore(&encoder->base.base);
+
+       list_for_each_entry(nv_crtc, &dev->mode_config.crtc_list, base.head)
+               nv_crtc->restore(&nv_crtc->base);
+
+       nouveau_hw_save_vga_fonts(dev, 0);
+
+       nouveau_display(dev)->priv = NULL;
+       kfree(disp);
+
+       nvif_object_unmap(&drm->client.device.object);
+}
+
 int
 nv04_display_create(struct drm_device *dev)
 {
@@ -121,58 +176,3 @@ nv04_display_create(struct drm_device *dev)
 
        return 0;
 }
-
-void
-nv04_display_destroy(struct drm_device *dev)
-{
-       struct nv04_display *disp = nv04_display(dev);
-       struct nouveau_drm *drm = nouveau_drm(dev);
-       struct nouveau_encoder *encoder;
-       struct nouveau_crtc *nv_crtc;
-
-       /* Restore state */
-       list_for_each_entry(encoder, &dev->mode_config.encoder_list, base.base.head)
-               encoder->enc_restore(&encoder->base.base);
-
-       list_for_each_entry(nv_crtc, &dev->mode_config.crtc_list, base.head)
-               nv_crtc->restore(&nv_crtc->base);
-
-       nouveau_hw_save_vga_fonts(dev, 0);
-
-       nouveau_display(dev)->priv = NULL;
-       kfree(disp);
-
-       nvif_object_unmap(&drm->client.device.object);
-}
-
-int
-nv04_display_init(struct drm_device *dev)
-{
-       struct nouveau_encoder *encoder;
-       struct nouveau_crtc *crtc;
-
-       /* 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.
-        *
-        * best thing to do probably is to make save/restore routines not
-        * save/restore "pre-load" state, but more general so we can save
-        * on suspend too.
-        */
-       list_for_each_entry(crtc, &dev->mode_config.crtc_list, base.head)
-               crtc->save(&crtc->base);
-
-       list_for_each_entry(encoder, &dev->mode_config.encoder_list, base.base.head)
-               encoder->enc_save(&encoder->base.base);
-
-       return 0;
-}
-
-void
-nv04_display_fini(struct drm_device *dev)
-{
-       /* disable vblank interrupts */
-       NVWriteCRTC(dev, 0, NV_PCRTC_INTR_EN_0, 0);
-       if (nv_two_heads(dev))
-               NVWriteCRTC(dev, 1, NV_PCRTC_INTR_EN_0, 0);
-}
index f74f1f2..91bbc0c 100644 (file)
@@ -92,9 +92,6 @@ nv04_display(struct drm_device *dev)
 
 /* nv04_display.c */
 int nv04_display_create(struct drm_device *);
-void nv04_display_destroy(struct drm_device *);
-int nv04_display_init(struct drm_device *);
-void nv04_display_fini(struct drm_device *);
 
 /* nv04_crtc.c */
 int nv04_crtc_create(struct drm_device *, int index);
index 3f618ed..07aee82 100644 (file)
@@ -2221,7 +2221,7 @@ nv50_disp_func = {
  * Init
  *****************************************************************************/
 
-void
+static void
 nv50_display_fini(struct drm_device *dev)
 {
        struct nouveau_encoder *nv_encoder;
@@ -2243,7 +2243,7 @@ nv50_display_fini(struct drm_device *dev)
        }
 }
 
-int
+static int
 nv50_display_init(struct drm_device *dev)
 {
        struct nv50_core *core = nv50_disp(dev)->core;
@@ -2270,7 +2270,7 @@ nv50_display_init(struct drm_device *dev)
        return 0;
 }
 
-void
+static void
 nv50_display_destroy(struct drm_device *dev)
 {
        struct nv50_disp *disp = nv50_disp(dev);