diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-04-26 17:28:01 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-05-03 05:18:24 -0400 |
commit | d1c1edbc741924b8983ebad1329f4b761664e48b (patch) | |
tree | 8e9b07a828a710c19bd0459df07967ac194dc4f0 /drivers/gpu/drm/i915/i915_dma.c | |
parent | 7001f22f7c96bfcaa7d043dbb75b12c27880607d (diff) |
drm/i915: move dri1 vblank stubs to i915_dma.c
i915_dma.c contains most of the old dri1 horror-show, so move
the remaining bits there, too. The code has been removed and
the only thing left are some stubs to ensure that userspace
doesn't try to use this stuff. vblank_pipe_set only returns 0
without any side-effects, so we can even stub it out with
the canonical drm_noop.
v2: Rebase against ENODEV changes.
Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_dma.c')
-rw-r--r-- | drivers/gpu/drm/i915/i915_dma.c | 44 |
1 files changed, 43 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c index 0d99a16ff47b..5fde7ed86b17 100644 --- a/drivers/gpu/drm/i915/i915_dma.c +++ b/drivers/gpu/drm/i915/i915_dma.c | |||
@@ -721,6 +721,48 @@ fail_batch_free: | |||
721 | return ret; | 721 | return ret; |
722 | } | 722 | } |
723 | 723 | ||
724 | static int i915_vblank_pipe_get(struct drm_device *dev, void *data, | ||
725 | struct drm_file *file_priv) | ||
726 | { | ||
727 | drm_i915_private_t *dev_priv = dev->dev_private; | ||
728 | drm_i915_vblank_pipe_t *pipe = data; | ||
729 | |||
730 | if (drm_core_check_feature(dev, DRIVER_MODESET)) | ||
731 | return -ENODEV; | ||
732 | |||
733 | if (!dev_priv) { | ||
734 | DRM_ERROR("called with no initialization\n"); | ||
735 | return -EINVAL; | ||
736 | } | ||
737 | |||
738 | pipe->pipe = DRM_I915_VBLANK_PIPE_A | DRM_I915_VBLANK_PIPE_B; | ||
739 | |||
740 | return 0; | ||
741 | } | ||
742 | |||
743 | /** | ||
744 | * Schedule buffer swap at given vertical blank. | ||
745 | */ | ||
746 | static int i915_vblank_swap(struct drm_device *dev, void *data, | ||
747 | struct drm_file *file_priv) | ||
748 | { | ||
749 | /* The delayed swap mechanism was fundamentally racy, and has been | ||
750 | * removed. The model was that the client requested a delayed flip/swap | ||
751 | * from the kernel, then waited for vblank before continuing to perform | ||
752 | * rendering. The problem was that the kernel might wake the client | ||
753 | * up before it dispatched the vblank swap (since the lock has to be | ||
754 | * held while touching the ringbuffer), in which case the client would | ||
755 | * clear and start the next frame before the swap occurred, and | ||
756 | * flicker would occur in addition to likely missing the vblank. | ||
757 | * | ||
758 | * In the absence of this ioctl, userland falls back to a correct path | ||
759 | * of waiting for a vblank, then dispatching the swap on its own. | ||
760 | * Context switching to userland and back is plenty fast enough for | ||
761 | * meeting the requirements of vblank swapping. | ||
762 | */ | ||
763 | return -EINVAL; | ||
764 | } | ||
765 | |||
724 | static int i915_flip_bufs(struct drm_device *dev, void *data, | 766 | static int i915_flip_bufs(struct drm_device *dev, void *data, |
725 | struct drm_file *file_priv) | 767 | struct drm_file *file_priv) |
726 | { | 768 | { |
@@ -2162,7 +2204,7 @@ struct drm_ioctl_desc i915_ioctls[] = { | |||
2162 | DRM_IOCTL_DEF_DRV(I915_INIT_HEAP, drm_noop, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY), | 2204 | DRM_IOCTL_DEF_DRV(I915_INIT_HEAP, drm_noop, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY), |
2163 | DRM_IOCTL_DEF_DRV(I915_CMDBUFFER, i915_cmdbuffer, DRM_AUTH), | 2205 | DRM_IOCTL_DEF_DRV(I915_CMDBUFFER, i915_cmdbuffer, DRM_AUTH), |
2164 | DRM_IOCTL_DEF_DRV(I915_DESTROY_HEAP, drm_noop, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY), | 2206 | DRM_IOCTL_DEF_DRV(I915_DESTROY_HEAP, drm_noop, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY), |
2165 | DRM_IOCTL_DEF_DRV(I915_SET_VBLANK_PIPE, i915_vblank_pipe_set, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY), | 2207 | DRM_IOCTL_DEF_DRV(I915_SET_VBLANK_PIPE, drm_noop, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY), |
2166 | DRM_IOCTL_DEF_DRV(I915_GET_VBLANK_PIPE, i915_vblank_pipe_get, DRM_AUTH), | 2208 | DRM_IOCTL_DEF_DRV(I915_GET_VBLANK_PIPE, i915_vblank_pipe_get, DRM_AUTH), |
2167 | DRM_IOCTL_DEF_DRV(I915_VBLANK_SWAP, i915_vblank_swap, DRM_AUTH), | 2209 | DRM_IOCTL_DEF_DRV(I915_VBLANK_SWAP, i915_vblank_swap, DRM_AUTH), |
2168 | DRM_IOCTL_DEF_DRV(I915_HWS_ADDR, i915_set_status_page, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY), | 2210 | DRM_IOCTL_DEF_DRV(I915_HWS_ADDR, i915_set_status_page, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY), |