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

v2:
* remove unnecessary include of sti_crtc.h from sti_drv.c

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200123135943.24140-17-tzimmermann@suse.de
drivers/gpu/drm/sti/sti_crtc.c
drivers/gpu/drm/sti/sti_crtc.h
drivers/gpu/drm/sti/sti_drv.c

index dc64fbf..49e6cb8 100644 (file)
@@ -279,12 +279,13 @@ int sti_crtc_vblank_cb(struct notifier_block *nb,
        return 0;
 }
 
-int sti_crtc_enable_vblank(struct drm_device *dev, unsigned int pipe)
+static int sti_crtc_enable_vblank(struct drm_crtc *crtc)
 {
+       struct drm_device *dev = crtc->dev;
+       unsigned int pipe = crtc->index;
        struct sti_private *dev_priv = dev->dev_private;
        struct sti_compositor *compo = dev_priv->compo;
        struct notifier_block *vtg_vblank_nb = &compo->vtg_vblank_nb[pipe];
-       struct drm_crtc *crtc = &compo->mixer[pipe]->drm_crtc;
        struct sti_vtg *vtg = compo->vtg[pipe];
 
        DRM_DEBUG_DRIVER("\n");
@@ -297,8 +298,10 @@ int sti_crtc_enable_vblank(struct drm_device *dev, unsigned int pipe)
        return 0;
 }
 
-void sti_crtc_disable_vblank(struct drm_device *drm_dev, unsigned int pipe)
+static void sti_crtc_disable_vblank(struct drm_crtc *crtc)
 {
+       struct drm_device *drm_dev = crtc->dev;
+       unsigned int pipe = crtc->index;
        struct sti_private *priv = drm_dev->dev_private;
        struct sti_compositor *compo = priv->compo;
        struct notifier_block *vtg_vblank_nb = &compo->vtg_vblank_nb[pipe];
@@ -330,6 +333,8 @@ static const struct drm_crtc_funcs sti_crtc_funcs = {
        .atomic_duplicate_state = drm_atomic_helper_crtc_duplicate_state,
        .atomic_destroy_state = drm_atomic_helper_crtc_destroy_state,
        .late_register = sti_crtc_late_register,
+       .enable_vblank = sti_crtc_enable_vblank,
+       .disable_vblank = sti_crtc_disable_vblank,
 };
 
 bool sti_crtc_is_main(struct drm_crtc *crtc)
index df489ab..1132b45 100644 (file)
@@ -15,8 +15,6 @@ struct sti_mixer;
 
 int sti_crtc_init(struct drm_device *drm_dev, struct sti_mixer *mixer,
                  struct drm_plane *primary, struct drm_plane *cursor);
-int sti_crtc_enable_vblank(struct drm_device *dev, unsigned int pipe);
-void sti_crtc_disable_vblank(struct drm_device *dev, unsigned int pipe);
 int sti_crtc_vblank_cb(struct notifier_block *nb,
                       unsigned long event, void *data);
 bool sti_crtc_is_main(struct drm_crtc *drm_crtc);
index a39fc36..50870d8 100644 (file)
@@ -21,7 +21,6 @@
 #include <drm/drm_of.h>
 #include <drm/drm_probe_helper.h>
 
-#include "sti_crtc.h"
 #include "sti_drv.h"
 #include "sti_plane.h"
 
@@ -146,9 +145,6 @@ static struct drm_driver sti_driver = {
        .dumb_create = drm_gem_cma_dumb_create,
        .fops = &sti_driver_fops,
 
-       .enable_vblank = sti_crtc_enable_vblank,
-       .disable_vblank = sti_crtc_disable_vblank,
-
        .prime_handle_to_fd = drm_gem_prime_handle_to_fd,
        .prime_fd_to_handle = drm_gem_prime_fd_to_handle,
        .gem_prime_get_sg_table = drm_gem_cma_prime_get_sg_table,