From: Daniel Vetter <daniel.vetter@ffwll.ch>
To: Intel Graphics Development <intel-gfx@lists.freedesktop.org>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Subject: [PATCH 01/17] drm/i915: move dri1 vblank stubs to i915_dma.c
Date: Thu, 26 Apr 2012 23:28:01 +0200 [thread overview]
Message-ID: <1335475697-3069-2-git-send-email-daniel.vetter@ffwll.ch> (raw)
In-Reply-To: <1335475697-3069-1-git-send-email-daniel.vetter@ffwll.ch>
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.
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
drivers/gpu/drm/i915/i915_dma.c | 44 +++++++++++++++++++++++++++-
drivers/gpu/drm/i915/i915_drv.h | 7 ----
drivers/gpu/drm/i915/i915_irq.c | 61 ---------------------------------------
3 files changed, 43 insertions(+), 69 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
index 7a55abb..653fc86 100644
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
@@ -721,6 +721,48 @@ fail_batch_free:
return ret;
}
+static int i915_vblank_pipe_get(struct drm_device *dev, void *data,
+ struct drm_file *file_priv)
+{
+ drm_i915_private_t *dev_priv = dev->dev_private;
+ drm_i915_vblank_pipe_t *pipe = data;
+
+ if (drm_core_check_feature(dev, DRIVER_MODESET))
+ return -ENODEV;
+
+ if (!dev_priv) {
+ DRM_ERROR("called with no initialization\n");
+ return -EINVAL;
+ }
+
+ pipe->pipe = DRM_I915_VBLANK_PIPE_A | DRM_I915_VBLANK_PIPE_B;
+
+ return 0;
+}
+
+/**
+ * Schedule buffer swap at given vertical blank.
+ */
+static int i915_vblank_swap(struct drm_device *dev, void *data,
+ struct drm_file *file_priv)
+{
+ /* The delayed swap mechanism was fundamentally racy, and has been
+ * removed. The model was that the client requested a delayed flip/swap
+ * from the kernel, then waited for vblank before continuing to perform
+ * rendering. The problem was that the kernel might wake the client
+ * up before it dispatched the vblank swap (since the lock has to be
+ * held while touching the ringbuffer), in which case the client would
+ * clear and start the next frame before the swap occurred, and
+ * flicker would occur in addition to likely missing the vblank.
+ *
+ * In the absence of this ioctl, userland falls back to a correct path
+ * of waiting for a vblank, then dispatching the swap on its own.
+ * Context switching to userland and back is plenty fast enough for
+ * meeting the requirements of vblank swapping.
+ */
+ return -EINVAL;
+}
+
static int i915_flip_bufs(struct drm_device *dev, void *data,
struct drm_file *file_priv)
{
@@ -2156,7 +2198,7 @@ struct drm_ioctl_desc i915_ioctls[] = {
DRM_IOCTL_DEF_DRV(I915_INIT_HEAP, drm_noop, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY),
DRM_IOCTL_DEF_DRV(I915_CMDBUFFER, i915_cmdbuffer, DRM_AUTH),
DRM_IOCTL_DEF_DRV(I915_DESTROY_HEAP, drm_noop, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY),
- DRM_IOCTL_DEF_DRV(I915_SET_VBLANK_PIPE, i915_vblank_pipe_set, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY),
+ DRM_IOCTL_DEF_DRV(I915_SET_VBLANK_PIPE, drm_noop, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY),
DRM_IOCTL_DEF_DRV(I915_GET_VBLANK_PIPE, i915_vblank_pipe_get, DRM_AUTH),
DRM_IOCTL_DEF_DRV(I915_VBLANK_SWAP, i915_vblank_swap, DRM_AUTH),
DRM_IOCTL_DEF_DRV(I915_HWS_ADDR, i915_set_status_page, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY),
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 0095c8d..d60b573 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -1155,13 +1155,6 @@ extern int i915_irq_wait(struct drm_device *dev, void *data,
extern void intel_irq_init(struct drm_device *dev);
-extern int i915_vblank_pipe_set(struct drm_device *dev, void *data,
- struct drm_file *file_priv);
-extern int i915_vblank_pipe_get(struct drm_device *dev, void *data,
- struct drm_file *file_priv);
-extern int i915_vblank_swap(struct drm_device *dev, void *data,
- struct drm_file *file_priv);
-
void
i915_enable_pipestat(drm_i915_private_t *dev_priv, int pipe, u32 mask);
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index 5c360ee..874956c 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -1628,67 +1628,6 @@ static void valleyview_disable_vblank(struct drm_device *dev, int pipe)
spin_unlock_irqrestore(&dev_priv->irq_lock, irqflags);
}
-
-/* Set the vblank monitor pipe
- */
-int i915_vblank_pipe_set(struct drm_device *dev, void *data,
- struct drm_file *file_priv)
-{
- drm_i915_private_t *dev_priv = dev->dev_private;
-
- if (drm_core_check_feature(dev, DRIVER_MODESET))
- return -ENODEV;
-
- if (!dev_priv) {
- DRM_ERROR("called with no initialization\n");
- return -EINVAL;
- }
-
- return 0;
-}
-
-int i915_vblank_pipe_get(struct drm_device *dev, void *data,
- struct drm_file *file_priv)
-{
- drm_i915_private_t *dev_priv = dev->dev_private;
- drm_i915_vblank_pipe_t *pipe = data;
-
- if (drm_core_check_feature(dev, DRIVER_MODESET))
- return -ENODEV;
-
- if (!dev_priv) {
- DRM_ERROR("called with no initialization\n");
- return -EINVAL;
- }
-
- pipe->pipe = DRM_I915_VBLANK_PIPE_A | DRM_I915_VBLANK_PIPE_B;
-
- return 0;
-}
-
-/**
- * Schedule buffer swap at given vertical blank.
- */
-int i915_vblank_swap(struct drm_device *dev, void *data,
- struct drm_file *file_priv)
-{
- /* The delayed swap mechanism was fundamentally racy, and has been
- * removed. The model was that the client requested a delayed flip/swap
- * from the kernel, then waited for vblank before continuing to perform
- * rendering. The problem was that the kernel might wake the client
- * up before it dispatched the vblank swap (since the lock has to be
- * held while touching the ringbuffer), in which case the client would
- * clear and start the next frame before the swap occurred, and
- * flicker would occur in addition to likely missing the vblank.
- *
- * In the absence of this ioctl, userland falls back to a correct path
- * of waiting for a vblank, then dispatching the swap on its own.
- * Context switching to userland and back is plenty fast enough for
- * meeting the requirements of vblank swapping.
- */
- return -EINVAL;
-}
-
static u32
ring_last_seqno(struct intel_ring_buffer *ring)
{
--
1.7.7.6
next prev parent reply other threads:[~2012-04-26 22:32 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-26 21:28 [PATCH 00/17] dri1 dragon slaughtering, v2 Daniel Vetter
2012-04-26 21:28 ` Daniel Vetter [this message]
2012-04-26 21:28 ` [PATCH 02/17] drm/i915: create dev_priv->dri1 dragon dungeon^W^W sub-struct Daniel Vetter
2012-04-26 21:28 ` [PATCH 03/17] drm/i915 disallow physical batchbuffers for KMS Daniel Vetter
2012-04-26 21:28 ` [PATCH 04/17] drm/i915: rip out dev_priv->tex_lru_log_granularity Daniel Vetter
2012-04-26 21:28 ` [PATCH 05/17] drm/i915: remove LP_RING&friends from modeset code Daniel Vetter
2012-04-26 21:28 ` [PATCH 06/17] drm/i915: kill intel_clear_scanline_wait Daniel Vetter
2012-04-26 21:28 ` [PATCH 07/17] drm/i915: rip out dri1 breadcrumb updates from gen5+ irq handlers Daniel Vetter
2012-04-26 21:28 ` [PATCH 08/17] drm/i915: move dri1 irq ioctl code to i915_dma.c Daniel Vetter
2012-04-26 21:28 ` [PATCH 09/17] drm/i915: extract dri1 breadcrumb update from irq handler Daniel Vetter
2012-04-26 21:28 ` [PATCH 10/17] drm/i915: move LP_RING&friends to i915_dma.c Daniel Vetter
2012-04-26 21:28 ` [PATCH 11/17] drm/i915: disallow clip rects on gen5+ Daniel Vetter
2012-04-26 21:28 ` [PATCH 12/17] drm/i915: move the ips code to intel_pm.c Daniel Vetter
2012-04-26 21:28 ` [PATCH 13/17] drm/i915: move rps/emon function declarations Daniel Vetter
2012-04-26 21:28 ` [PATCH 14/17] drm/i915: kill pointless clearing of dev_priv->hws_map Daniel Vetter
2012-04-26 21:28 ` [PATCH 15/17] drm/i915: rework legacy GFX HWS handling Daniel Vetter
2012-04-26 21:28 ` [PATCH 16/17] drm/i915: fixup __iomem mixups in ringbuffer.c Daniel Vetter
2012-04-26 21:28 ` [PATCH 17/17] drm/i915: move pnv|ilk_gem_mem_freq to intel_pm.c Daniel Vetter
2012-05-02 11:49 ` [PATCH 00/17] dri1 dragon slaughtering, v2 Daniel Vetter
-- strict thread matches above, loose matches on Subject: below --
2012-04-26 21:19 Daniel Vetter
[not found] ` <1335475164-2933-2-git-send-email-daniel.vetter@ffwll.ch>
2012-04-26 22:34 ` [PATCH 01/17] drm/i915: move dri1 vblank stubs to i915_dma.c Daniel Vetter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1335475697-3069-2-git-send-email-daniel.vetter@ffwll.ch \
--to=daniel.vetter@ffwll.ch \
--cc=intel-gfx@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox