drm/nouveau: Convert to CRTC VBLANK callbacks
authorThomas Zimmermann <tzimmermann@suse.de>
Thu, 23 Jan 2020 13:59:30 +0000 (14:59 +0100)
committerThomas Zimmermann <tzimmermann@suse.de>
Thu, 13 Feb 2020 12:08:13 +0000 (13:08 +0100)
VBLANK callbacks in struct drm_driver are deprecated in favor of
their equivalents in struct drm_crtc_funcs. Convert nouvean over.

v4:
* add argument names in function declaration

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200123135943.24140-10-tzimmermann@suse.de
drivers/gpu/drm/nouveau/dispnv04/crtc.c
drivers/gpu/drm/nouveau/dispnv50/head.c
drivers/gpu/drm/nouveau/nouveau_display.c
drivers/gpu/drm/nouveau/nouveau_display.h
drivers/gpu/drm/nouveau/nouveau_drm.c

index 17e9d1c078a0202f7d9514e8dc76d3ce76b2e050..1f08de4241e01b246d86d85ab4658dd56d368f03 100644 (file)
@@ -1248,6 +1248,9 @@ static const struct drm_crtc_funcs nv04_crtc_funcs = {
        .set_config = drm_crtc_helper_set_config,
        .page_flip = nv04_crtc_page_flip,
        .destroy = nv_crtc_destroy,
+       .enable_vblank = nouveau_display_vblank_enable,
+       .disable_vblank = nouveau_display_vblank_disable,
+       .get_vblank_timestamp = drm_crtc_vblank_helper_get_vblank_timestamp,
 };
 
 static const struct drm_crtc_helper_funcs nv04_crtc_helper_funcs = {
index 1354d19d9a18653cd425f39a8f364e313bd9d03c..0b4c7a6fb39ca7f3645f753ee1475622ceaf9859 100644 (file)
@@ -29,6 +29,7 @@
 
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_crtc_helper.h>
+#include <drm/drm_vblank.h>
 #include "nouveau_connector.h"
 void
 nv50_head_flush_clr(struct nv50_head *head,
@@ -472,6 +473,9 @@ nv50_head_func = {
        .page_flip = drm_atomic_helper_page_flip,
        .atomic_duplicate_state = nv50_head_atomic_duplicate_state,
        .atomic_destroy_state = nv50_head_atomic_destroy_state,
+       .enable_vblank = nouveau_display_vblank_enable,
+       .disable_vblank = nouveau_display_vblank_disable,
+       .get_vblank_timestamp = drm_crtc_vblank_helper_get_vblank_timestamp,
 };
 
 int
index 86f99dc8fcef019a98792a6d3e462d11eeb8e200..700817dc4fa04a74bb1ad8d8e0fc848037c0693f 100644 (file)
@@ -54,15 +54,10 @@ nouveau_display_vblank_handler(struct nvif_notify *notify)
 }
 
 int
-nouveau_display_vblank_enable(struct drm_device *dev, unsigned int pipe)
+nouveau_display_vblank_enable(struct drm_crtc *crtc)
 {
-       struct drm_crtc *crtc;
        struct nouveau_crtc *nv_crtc;
 
-       crtc = drm_crtc_from_index(dev, pipe);
-       if (!crtc)
-               return -EINVAL;
-
        nv_crtc = nouveau_crtc(crtc);
        nvif_notify_get(&nv_crtc->vblank);
 
@@ -70,15 +65,10 @@ nouveau_display_vblank_enable(struct drm_device *dev, unsigned int pipe)
 }
 
 void
-nouveau_display_vblank_disable(struct drm_device *dev, unsigned int pipe)
+nouveau_display_vblank_disable(struct drm_crtc *crtc)
 {
-       struct drm_crtc *crtc;
        struct nouveau_crtc *nv_crtc;
 
-       crtc = drm_crtc_from_index(dev, pipe);
-       if (!crtc)
-               return;
-
        nv_crtc = nouveau_crtc(crtc);
        nvif_notify_put(&nv_crtc->vblank);
 }
index 26d34f1a77dafacecc1916f774b85a429804541d..de004018ab5c0ecbd26632386194ca11cdc081ba 100644 (file)
@@ -61,8 +61,8 @@ int  nouveau_display_init(struct drm_device *dev, bool resume, bool runtime);
 void nouveau_display_fini(struct drm_device *dev, bool suspend, bool runtime);
 int  nouveau_display_suspend(struct drm_device *dev, bool runtime);
 void nouveau_display_resume(struct drm_device *dev, bool runtime);
-int  nouveau_display_vblank_enable(struct drm_device *, unsigned int);
-void nouveau_display_vblank_disable(struct drm_device *, unsigned int);
+int  nouveau_display_vblank_enable(struct drm_crtc *crtc);
+void nouveau_display_vblank_disable(struct drm_crtc *crtc);
 bool nouveau_display_scanoutpos(struct drm_crtc *crtc,
                                bool in_vblank_irq, int *vpos, int *hpos,
                                ktime_t *stime, ktime_t *etime,
index 9fb38a0182401ec23f6b5b57bf6f7c229328fd73..0003343014ce843d05f79e80e961c488a8f4fd76 100644 (file)
@@ -1121,10 +1121,6 @@ driver_stub = {
        .debugfs_init = nouveau_drm_debugfs_init,
 #endif
 
-       .enable_vblank = nouveau_display_vblank_enable,
-       .disable_vblank = nouveau_display_vblank_disable,
-       .get_vblank_timestamp = drm_calc_vbltimestamp_from_scanoutpos,
-
        .ioctls = nouveau_ioctls,
        .num_ioctls = ARRAY_SIZE(nouveau_ioctls),
        .fops = &nouveau_driver_fops,