]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/amdgpu: Convert to struct drm_crtc_helper_funcs.get_scanout_position()
authorThomas Zimmermann <tzimmermann@suse.de>
Thu, 23 Jan 2020 13:59:25 +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
amdgpu over.

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-5-tzimmermann@suse.de
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h
drivers/gpu/drm/amd/amdgpu/dce_v10_0.c
drivers/gpu/drm/amd/amdgpu/dce_v11_0.c
drivers/gpu/drm/amd/amdgpu/dce_v6_0.c
drivers/gpu/drm/amd/amdgpu/dce_v8_0.c
drivers/gpu/drm/amd/amdgpu/dce_virtual.c
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

index 4e699071d1443deefe71aaf3841ac6f6b7bd0788..a1e769d4417dee8ddaaaac46b6f016d38d220a6d 100644 (file)
@@ -914,3 +914,15 @@ int amdgpu_display_crtc_idx_to_irq_type(struct amdgpu_device *adev, int crtc)
                return AMDGPU_CRTC_IRQ_NONE;
        }
 }
+
+bool amdgpu_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;
+       unsigned int pipe = crtc->index;
+
+       return amdgpu_display_get_crtc_scanoutpos(dev, pipe, 0, vpos, hpos,
+                                                 stime, etime, mode);
+}
index 3f6f14ce1511a9bc1ff2741226690c64c1206d4b..0749285dd1c7f575d54801da081282c4a037d4a0 100644 (file)
@@ -1367,16 +1367,6 @@ int amdgpu_file_to_fpriv(struct file *filp, struct amdgpu_fpriv **fpriv)
        return 0;
 }
 
-static bool
-amdgpu_get_crtc_scanout_position(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)
-{
-       return amdgpu_display_get_crtc_scanoutpos(dev, pipe, 0, vpos, hpos,
-                                                 stime, etime, mode);
-}
-
 static struct drm_driver kms_driver = {
        .driver_features =
            DRIVER_USE_AGP | DRIVER_ATOMIC |
@@ -1391,7 +1381,6 @@ static struct drm_driver kms_driver = {
        .enable_vblank = amdgpu_enable_vblank_kms,
        .disable_vblank = amdgpu_disable_vblank_kms,
        .get_vblank_timestamp = drm_calc_vbltimestamp_from_scanoutpos,
-       .get_scanout_position = amdgpu_get_crtc_scanout_position,
        .irq_handler = amdgpu_irq_handler,
        .ioctls = amdgpu_ioctls_kms,
        .gem_free_object_unlocked = amdgpu_gem_object_free,
index eb9975f4decbbc2a079810d7316dab853e607b40..37ba07e2feb545a8e1045a4527955e7aee0c3541 100644 (file)
@@ -612,6 +612,11 @@ void amdgpu_panel_mode_fixup(struct drm_encoder *encoder,
                             struct drm_display_mode *adjusted_mode);
 int amdgpu_display_crtc_idx_to_irq_type(struct amdgpu_device *adev, int crtc);
 
+bool amdgpu_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);
+
 /* fbdev layer */
 int amdgpu_fbdev_init(struct amdgpu_device *adev);
 void amdgpu_fbdev_fini(struct amdgpu_device *adev);
index 40d2ac723dd6ce3df09170551ebbcffb4933ab8d..bdc1e0f036d413f603f86138ea14759dc02b9558 100644 (file)
@@ -2685,6 +2685,7 @@ static const struct drm_crtc_helper_funcs dce_v10_0_crtc_helper_funcs = {
        .prepare = dce_v10_0_crtc_prepare,
        .commit = dce_v10_0_crtc_commit,
        .disable = dce_v10_0_crtc_disable,
+       .get_scanout_position = amdgpu_crtc_get_scanout_position,
 };
 
 static int dce_v10_0_crtc_init(struct amdgpu_device *adev, int index)
index 898ef72d423c213f5c745532c9dacd411556d465..0319da5f7bf9b6fd2031bfff53f2cb7ce73a6abf 100644 (file)
@@ -2793,6 +2793,7 @@ static const struct drm_crtc_helper_funcs dce_v11_0_crtc_helper_funcs = {
        .prepare = dce_v11_0_crtc_prepare,
        .commit = dce_v11_0_crtc_commit,
        .disable = dce_v11_0_crtc_disable,
+       .get_scanout_position = amdgpu_crtc_get_scanout_position,
 };
 
 static int dce_v11_0_crtc_init(struct amdgpu_device *adev, int index)
index db15a112beccc97510815c61f0be12f9c098db1a..78642c3b14fcac97360a902e0b28794b42d877d0 100644 (file)
@@ -2575,6 +2575,7 @@ static const struct drm_crtc_helper_funcs dce_v6_0_crtc_helper_funcs = {
        .prepare = dce_v6_0_crtc_prepare,
        .commit = dce_v6_0_crtc_commit,
        .disable = dce_v6_0_crtc_disable,
+       .get_scanout_position = amdgpu_crtc_get_scanout_position,
 };
 
 static int dce_v6_0_crtc_init(struct amdgpu_device *adev, int index)
index f06c9022c1fd38b5a3c128cc3d481eab4f04366a..1e8d4975435aa15cf67db612daf43c157c737096 100644 (file)
@@ -2593,6 +2593,7 @@ static const struct drm_crtc_helper_funcs dce_v8_0_crtc_helper_funcs = {
        .prepare = dce_v8_0_crtc_prepare,
        .commit = dce_v8_0_crtc_commit,
        .disable = dce_v8_0_crtc_disable,
+       .get_scanout_position = amdgpu_crtc_get_scanout_position,
 };
 
 static int dce_v8_0_crtc_init(struct amdgpu_device *adev, int index)
index e4f94863332c1caf47f97d80c7b68198cea0b954..4b2f915aba47305af44f3e1a1f5d3b1aa6b43f45 100644 (file)
@@ -218,6 +218,7 @@ static const struct drm_crtc_helper_funcs dce_virtual_crtc_helper_funcs = {
        .prepare = dce_virtual_crtc_prepare,
        .commit = dce_virtual_crtc_commit,
        .disable = dce_virtual_crtc_disable,
+       .get_scanout_position = amdgpu_crtc_get_scanout_position,
 };
 
 static int dce_virtual_crtc_init(struct amdgpu_device *adev, int index)
index f2db400a39204c3f257392ed3009951679a98a9d..39c5cf242c1b88c31a9c087656a939d25b61d28b 100644 (file)
@@ -4821,7 +4821,8 @@ static bool dm_crtc_helper_mode_fixup(struct drm_crtc *crtc,
 static const struct drm_crtc_helper_funcs amdgpu_dm_crtc_helper_funcs = {
        .disable = dm_crtc_helper_disable,
        .atomic_check = dm_crtc_helper_atomic_check,
-       .mode_fixup = dm_crtc_helper_mode_fixup
+       .mode_fixup = dm_crtc_helper_mode_fixup,
+       .get_scanout_position = amdgpu_crtc_get_scanout_position,
 };
 
 static void dm_encoder_helper_disable(struct drm_encoder *encoder)