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

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Eric Anholt <eric@anholt.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20200123135943.24140-18-tzimmermann@suse.de
drivers/gpu/drm/vc4/vc4_crtc.c
drivers/gpu/drm/vc4/vc4_drv.c
drivers/gpu/drm/vc4/vc4_drv.h

index b00e20f..f1e7597 100644 (file)
@@ -84,13 +84,14 @@ static const struct debugfs_reg32 crtc_regs[] = {
        VC4_REG32(PV_HACT_ACT),
 };
 
-bool vc4_crtc_get_scanoutpos(struct drm_device *dev, unsigned int crtc_id,
-                            bool in_vblank_irq, int *vpos, int *hpos,
-                            ktime_t *stime, ktime_t *etime,
-                            const struct drm_display_mode *mode)
+static bool vc4_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 *dev = crtc->dev;
        struct vc4_dev *vc4 = to_vc4_dev(dev);
-       struct drm_crtc *crtc = drm_crtc_from_index(dev, crtc_id);
        struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc);
        u32 val;
        int fifo_lines;
@@ -1039,6 +1040,7 @@ static const struct drm_crtc_helper_funcs vc4_crtc_helper_funcs = {
        .atomic_flush = vc4_crtc_atomic_flush,
        .atomic_enable = vc4_crtc_atomic_enable,
        .atomic_disable = vc4_crtc_atomic_disable,
+       .get_scanout_position = vc4_crtc_get_scanout_position,
 };
 
 static const struct vc4_crtc_data pv0_data = {
index 5e6fb6c..e6982a7 100644 (file)
@@ -190,7 +190,6 @@ static struct drm_driver vc4_drm_driver = {
        .irq_postinstall = vc4_irq_postinstall,
        .irq_uninstall = vc4_irq_uninstall,
 
-       .get_scanout_position = vc4_crtc_get_scanoutpos,
        .get_vblank_timestamp = drm_calc_vbltimestamp_from_scanoutpos,
 
 #if defined(CONFIG_DEBUG_FS)
index 6627b20..f90c0d0 100644 (file)
@@ -743,10 +743,6 @@ void vc4_bo_remove_from_purgeable_pool(struct vc4_bo *bo);
 
 /* vc4_crtc.c */
 extern struct platform_driver vc4_crtc_driver;
-bool vc4_crtc_get_scanoutpos(struct drm_device *dev, unsigned int crtc_id,
-                            bool in_vblank_irq, int *vpos, int *hpos,
-                            ktime_t *stime, ktime_t *etime,
-                            const struct drm_display_mode *mode);
 void vc4_crtc_handle_vblank(struct vc4_crtc *crtc);
 void vc4_crtc_txp_armed(struct drm_crtc_state *state);
 void vc4_crtc_get_margins(struct drm_crtc_state *state,