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

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Philippe Cornu <philippe.cornu@st.com>
Tested-by: Yannick Fertré <yannick.fertre@st.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200123135943.24140-15-tzimmermann@suse.de
drivers/gpu/drm/stm/drv.c
drivers/gpu/drm/stm/ltdc.c
drivers/gpu/drm/stm/ltdc.h

index 5a9f9aca8bc2451450c44e195767f84799367b2d..486985604109f4c51ec1ccfe4453802f50795c12 100644 (file)
@@ -72,7 +72,6 @@ static struct drm_driver drv_driver = {
        .gem_prime_vmap = drm_gem_cma_prime_vmap,
        .gem_prime_vunmap = drm_gem_cma_prime_vunmap,
        .gem_prime_mmap = drm_gem_cma_prime_mmap,
-       .get_scanout_position = ltdc_crtc_scanoutpos,
        .get_vblank_timestamp = drm_calc_vbltimestamp_from_scanoutpos,
 };
 
index 8750ee831beabb5f735511e8d9fea56f64f27caa..b5dafa1c541366514e89a646f7be29f63d2eb380 100644 (file)
@@ -636,43 +636,13 @@ static void ltdc_crtc_atomic_flush(struct drm_crtc *crtc,
        }
 }
 
-static const struct drm_crtc_helper_funcs ltdc_crtc_helper_funcs = {
-       .mode_valid = ltdc_crtc_mode_valid,
-       .mode_fixup = ltdc_crtc_mode_fixup,
-       .mode_set_nofb = ltdc_crtc_mode_set_nofb,
-       .atomic_flush = ltdc_crtc_atomic_flush,
-       .atomic_enable = ltdc_crtc_atomic_enable,
-       .atomic_disable = ltdc_crtc_atomic_disable,
-};
-
-static int ltdc_crtc_enable_vblank(struct drm_crtc *crtc)
-{
-       struct ltdc_device *ldev = crtc_to_ltdc(crtc);
-       struct drm_crtc_state *state = crtc->state;
-
-       DRM_DEBUG_DRIVER("\n");
-
-       if (state->enable)
-               reg_set(ldev->regs, LTDC_IER, IER_LIE);
-       else
-               return -EPERM;
-
-       return 0;
-}
-
-static void ltdc_crtc_disable_vblank(struct drm_crtc *crtc)
-{
-       struct ltdc_device *ldev = crtc_to_ltdc(crtc);
-
-       DRM_DEBUG_DRIVER("\n");
-       reg_clear(ldev->regs, LTDC_IER, IER_LIE);
-}
-
-bool ltdc_crtc_scanoutpos(struct drm_device *ddev, unsigned int pipe,
-                         bool in_vblank_irq, int *vpos, int *hpos,
-                         ktime_t *stime, ktime_t *etime,
-                         const struct drm_display_mode *mode)
+static bool ltdc_crtc_get_scanout_position(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_device *ddev = crtc->dev;
        struct ltdc_device *ldev = ddev->dev_private;
        int line, vactive_start, vactive_end, vtotal;
 
@@ -715,6 +685,39 @@ bool ltdc_crtc_scanoutpos(struct drm_device *ddev, unsigned int pipe,
        return true;
 }
 
+static const struct drm_crtc_helper_funcs ltdc_crtc_helper_funcs = {
+       .mode_valid = ltdc_crtc_mode_valid,
+       .mode_fixup = ltdc_crtc_mode_fixup,
+       .mode_set_nofb = ltdc_crtc_mode_set_nofb,
+       .atomic_flush = ltdc_crtc_atomic_flush,
+       .atomic_enable = ltdc_crtc_atomic_enable,
+       .atomic_disable = ltdc_crtc_atomic_disable,
+       .get_scanout_position = ltdc_crtc_get_scanout_position,
+};
+
+static int ltdc_crtc_enable_vblank(struct drm_crtc *crtc)
+{
+       struct ltdc_device *ldev = crtc_to_ltdc(crtc);
+       struct drm_crtc_state *state = crtc->state;
+
+       DRM_DEBUG_DRIVER("\n");
+
+       if (state->enable)
+               reg_set(ldev->regs, LTDC_IER, IER_LIE);
+       else
+               return -EPERM;
+
+       return 0;
+}
+
+static void ltdc_crtc_disable_vblank(struct drm_crtc *crtc)
+{
+       struct ltdc_device *ldev = crtc_to_ltdc(crtc);
+
+       DRM_DEBUG_DRIVER("\n");
+       reg_clear(ldev->regs, LTDC_IER, IER_LIE);
+}
+
 static const struct drm_crtc_funcs ltdc_crtc_funcs = {
        .destroy = drm_crtc_cleanup,
        .set_config = drm_atomic_helper_set_config,
index 310e87f0667c221b8b1f02079f6fd4b703f7c205..f153b908c70ea3b7bc90312b2dfd5ff161f39bdd 100644 (file)
@@ -40,11 +40,6 @@ struct ltdc_device {
        struct drm_atomic_state *suspend_state;
 };
 
-bool ltdc_crtc_scanoutpos(struct drm_device *dev, unsigned int pipe,
-                         bool in_vblank_irq, int *vpos, int *hpos,
-                         ktime_t *stime, ktime_t *etime,
-                         const struct drm_display_mode *mode);
-
 int ltdc_load(struct drm_device *ddev);
 void ltdc_unload(struct drm_device *ddev);
 void ltdc_suspend(struct drm_device *ddev);