]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
drm/irq: Make drm_vblank_pre/post_modeset internal
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Mon, 14 Nov 2016 09:02:52 +0000 (10:02 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 15 Nov 2016 22:33:47 +0000 (23:33 +0100)
Now that all drivers are switched over to drm_crtc_vblank_on/off we
can relegate pre/post_modeset to the purely drm_irq.c internal role of
supporting old ums userspace.

As usual switch to the drm_legacy_ prefix to make it clear this is
for old drivers only.

v2: Rebase on top of Thierry's s/int crtc/unsigned int pipe/ changes.

Cc: Ben Skeggs <bskeggs@redhat.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
drivers/gpu/drm/drm_irq.c
include/drm/drmP.h

index 48a6167f5e7ba51674ffc17c26cedf5be5b20f22..2fb5861b04b77500f33857140ef1f481a8c10b5c 100644 (file)
@@ -1445,30 +1445,8 @@ void drm_crtc_vblank_on(struct drm_crtc *crtc)
 }
 EXPORT_SYMBOL(drm_crtc_vblank_on);
 
-/**
- * drm_vblank_pre_modeset - account for vblanks across mode sets
- * @dev: DRM device
- * @pipe: CRTC index
- *
- * Account for vblank events across mode setting events, which will likely
- * reset the hardware frame counter.
- *
- * This is done by grabbing a temporary vblank reference to ensure that the
- * vblank interrupt keeps running across the modeset sequence. With this the
- * software-side vblank frame counting will ensure that there are no jumps or
- * discontinuities.
- *
- * Unfortunately this approach is racy and also doesn't work when the vblank
- * interrupt stops running, e.g. across system suspend resume. It is therefore
- * highly recommended that drivers use the newer drm_vblank_off() and
- * drm_vblank_on() instead. drm_vblank_pre_modeset() only works correctly when
- * using "cooked" software vblank frame counters and not relying on any hardware
- * counters.
- *
- * Drivers must call drm_vblank_post_modeset() when re-enabling the same crtc
- * again.
- */
-void drm_vblank_pre_modeset(struct drm_device *dev, unsigned int pipe)
+static void drm_legacy_vblank_pre_modeset(struct drm_device *dev,
+                                         unsigned int pipe)
 {
        struct drm_vblank_crtc *vblank = &dev->vblank[pipe];
 
@@ -1492,17 +1470,9 @@ void drm_vblank_pre_modeset(struct drm_device *dev, unsigned int pipe)
                        vblank->inmodeset |= 0x2;
        }
 }
-EXPORT_SYMBOL(drm_vblank_pre_modeset);
 
-/**
- * drm_vblank_post_modeset - undo drm_vblank_pre_modeset changes
- * @dev: DRM device
- * @pipe: CRTC index
- *
- * This function again drops the temporary vblank reference acquired in
- * drm_vblank_pre_modeset.
- */
-void drm_vblank_post_modeset(struct drm_device *dev, unsigned int pipe)
+static void drm_legacy_vblank_post_modeset(struct drm_device *dev,
+                                          unsigned int pipe)
 {
        struct drm_vblank_crtc *vblank = &dev->vblank[pipe];
        unsigned long irqflags;
@@ -1525,7 +1495,6 @@ void drm_vblank_post_modeset(struct drm_device *dev, unsigned int pipe)
                vblank->inmodeset = 0;
        }
 }
-EXPORT_SYMBOL(drm_vblank_post_modeset);
 
 /*
  * drm_modeset_ctl - handle vblank event counter changes across mode switch
@@ -1558,10 +1527,10 @@ int drm_modeset_ctl(struct drm_device *dev, void *data,
 
        switch (modeset->cmd) {
        case _DRM_PRE_MODESET:
-               drm_vblank_pre_modeset(dev, pipe);
+               drm_legacy_vblank_pre_modeset(dev, pipe);
                break;
        case _DRM_POST_MODESET:
-               drm_vblank_post_modeset(dev, pipe);
+               drm_legacy_vblank_post_modeset(dev, pipe);
                break;
        default:
                return -EINVAL;
index 96a620ffd298997d9ad3bf19409dd25390bb53ff..b352a7b812e6c3ce44d2f08c5e6d4e04b24f55b5 100644 (file)
@@ -727,10 +727,6 @@ void drm_clflush_virt_range(void *addr, unsigned long length);
  * DMA quiscent + idle. DMA quiescent usually requires the hardware lock.
  */
 
-/* Modesetting support */
-extern void drm_vblank_pre_modeset(struct drm_device *dev, unsigned int pipe);
-extern void drm_vblank_post_modeset(struct drm_device *dev, unsigned int pipe);
-
                                /* Debugfs support */
 #if defined(CONFIG_DEBUG_FS)
 extern int drm_debugfs_create_files(const struct drm_info_list *files,