drm/nouveau: Convert to struct drm_crtc_helper_funcs.get_scanout_position()
authorThomas Zimmermann <tzimmermann@suse.de>
Thu, 23 Jan 2020 13:59:29 +0000 (14:59 +0100)
committerThomas Zimmermann <tzimmermann@suse.de>
Thu, 13 Feb 2020 12:08:13 +0000 (13:08 +0100)
The callback struct drm_driver.get_scanout_position() is deprecated in
favor of struct drm_crtc_helper_funcs.get_scanout_position(). Convert
nouveau over.

v4:
* add argument names in function declaration

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200123135943.24140-9-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 37c50ea8f84753c35176c311b87daa9b63cd24c3..17e9d1c078a0202f7d9514e8dc76d3ce76b2e050 100644 (file)
@@ -1258,6 +1258,7 @@ static const struct drm_crtc_helper_funcs nv04_crtc_helper_funcs = {
        .mode_set_base = nv04_crtc_mode_set_base,
        .mode_set_base_atomic = nv04_crtc_mode_set_base_atomic,
        .disable = nv_crtc_disable,
+       .get_scanout_position = nouveau_display_scanoutpos,
 };
 
 static const uint32_t modeset_formats[] = {
index c9692df2b76cca51604c0fb008643ff26a972be0..1354d19d9a18653cd425f39a8f364e313bd9d03c 100644 (file)
@@ -403,6 +403,7 @@ nv50_head_atomic_check(struct drm_crtc *crtc, struct drm_crtc_state *state)
 static const struct drm_crtc_helper_funcs
 nv50_head_help = {
        .atomic_check = nv50_head_atomic_check,
+       .get_scanout_position = nouveau_display_scanoutpos,
 };
 
 static void
index 53f9bceaf17a5f428afe4bf98df6cf9ee998ff40..86f99dc8fcef019a98792a6d3e462d11eeb8e200 100644 (file)
@@ -136,21 +136,13 @@ nouveau_display_scanoutpos_head(struct drm_crtc *crtc, int *vpos, int *hpos,
 }
 
 bool
-nouveau_display_scanoutpos(struct drm_device *dev, unsigned int pipe,
+nouveau_display_scanoutpos(struct drm_crtc *crtc,
                           bool in_vblank_irq, int *vpos, int *hpos,
                           ktime_t *stime, ktime_t *etime,
                           const struct drm_display_mode *mode)
 {
-       struct drm_crtc *crtc;
-
-       list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
-               if (nouveau_crtc(crtc)->index == pipe) {
-                       return nouveau_display_scanoutpos_head(crtc, vpos, hpos,
-                                                              stime, etime);
-               }
-       }
-
-       return false;
+       return nouveau_display_scanoutpos_head(crtc, vpos, hpos,
+                                              stime, etime);
 }
 
 static void
index 6e8e66882e4547084c67f7fd190b3be6b856fc10..26d34f1a77dafacecc1916f774b85a429804541d 100644 (file)
@@ -63,9 +63,10 @@ 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);
-bool  nouveau_display_scanoutpos(struct drm_device *, unsigned int,
-                                bool, int *, int *, ktime_t *,
-                                ktime_t *, const struct drm_display_mode *);
+bool nouveau_display_scanoutpos(struct drm_crtc *crtc,
+                               bool in_vblank_irq, int *vpos, int *hpos,
+                               ktime_t *stime, ktime_t *etime,
+                               const struct drm_display_mode *mode);
 
 int  nouveau_display_dumb_create(struct drm_file *, struct drm_device *,
                                 struct drm_mode_create_dumb *args);
index 2cd83849600f34b2ff22ca9990af042e4ad8a16b..9fb38a0182401ec23f6b5b57bf6f7c229328fd73 100644 (file)
@@ -1123,7 +1123,6 @@ driver_stub = {
 
        .enable_vblank = nouveau_display_vblank_enable,
        .disable_vblank = nouveau_display_vblank_disable,
-       .get_scanout_position = nouveau_display_scanoutpos,
        .get_vblank_timestamp = drm_calc_vbltimestamp_from_scanoutpos,
 
        .ioctls = nouveau_ioctls,