drm: qxl: use vblank hooks in struct drm_crtc_funcs
authorShawn Guo <shawn.guo@linaro.org>
Tue, 7 Feb 2017 09:16:27 +0000 (17:16 +0800)
committerSean Paul <seanpaul@chromium.org>
Tue, 21 Feb 2017 16:17:55 +0000 (11:17 -0500)
The vblank hooks in struct drm_driver are deprecated and only meant for
legacy drivers.  For modern drivers with DRIVER_MODESET flag, the hooks
in struct drm_crtc_funcs should be used instead.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Cc: Dave Airlie <airlied@redhat.com>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Link: http://patchwork.freedesktop.org/patch/msgid/1486458995-31018-16-git-send-email-shawnguo@kernel.org
drivers/gpu/drm/qxl/qxl_display.c
drivers/gpu/drm/qxl/qxl_drv.c

index 1094cd33eb06e9d78009c4fc91c0423da6df1182..2ce805a7ce5e179bf21f2f2390136fd368175df6 100644 (file)
@@ -548,6 +548,19 @@ static int qxl_crtc_cursor_move(struct drm_crtc *crtc,
        return 0;
 }
 
+static u32 qxl_noop_get_vblank_counter(struct drm_crtc *crtc)
+{
+       return 0;
+}
+
+static int qxl_noop_enable_vblank(struct drm_crtc *crtc)
+{
+       return 0;
+}
+
+static void qxl_noop_disable_vblank(struct drm_crtc *crtc)
+{
+}
 
 static const struct drm_crtc_funcs qxl_crtc_funcs = {
        .cursor_set2 = qxl_crtc_cursor_set2,
@@ -555,6 +568,9 @@ static const struct drm_crtc_funcs qxl_crtc_funcs = {
        .set_config = drm_crtc_helper_set_config,
        .destroy = qxl_crtc_destroy,
        .page_flip = qxl_crtc_page_flip,
+       .get_vblank_counter = qxl_noop_get_vblank_counter,
+       .enable_vblank = qxl_noop_enable_vblank,
+       .disable_vblank = qxl_noop_disable_vblank,
 };
 
 void qxl_user_framebuffer_destroy(struct drm_framebuffer *fb)
index 8e17c241e63c7681e5ab4b31f43c3c47e7f8c35c..48d51a2f3bd8035d7663b2bd39d87ce6d92494ef 100644 (file)
@@ -247,21 +247,6 @@ static int qxl_pm_restore(struct device *dev)
        return qxl_drm_resume(drm_dev, false);
 }
 
-static u32 qxl_noop_get_vblank_counter(struct drm_device *dev,
-                                      unsigned int pipe)
-{
-       return 0;
-}
-
-static int qxl_noop_enable_vblank(struct drm_device *dev, unsigned int pipe)
-{
-       return 0;
-}
-
-static void qxl_noop_disable_vblank(struct drm_device *dev, unsigned int pipe)
-{
-}
-
 static const struct dev_pm_ops qxl_pm_ops = {
        .suspend = qxl_pm_suspend,
        .resume = qxl_pm_resume,
@@ -281,9 +266,6 @@ static struct pci_driver qxl_pci_driver = {
 static struct drm_driver qxl_driver = {
        .driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_PRIME |
                           DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED,
-       .get_vblank_counter = qxl_noop_get_vblank_counter,
-       .enable_vblank = qxl_noop_enable_vblank,
-       .disable_vblank = qxl_noop_disable_vblank,
 
        .set_busid = drm_pci_set_busid,