[Intel-gfx] [PATCH 6/7] drm/i915: Remove intel_flip_work infrastructure

2017-07-20 Thread Daniel Vetter
This gets rid of all the interactions between the legacy flip code and
the modeset code. Yay!

This highlights an ommission in the atomic paths, where we fail to
apply a boost to the pending rendering when we miss the target vblank.
But the existing code is still dead and can be removed.

v2: Note that the boosting doesn't work in atomic (Chris).

Cc: Maarten Lankhorst 
Cc: Ville Syrjälä 
Reviewed-by: Maarten Lankhorst 
Signed-off-by: Daniel Vetter 
---
 drivers/gpu/drm/i915/i915_debugfs.c  |  70 -
 drivers/gpu/drm/i915/i915_drv.c  |   1 -
 drivers/gpu/drm/i915/i915_drv.h  |   4 --
 drivers/gpu/drm/i915/i915_gem.c  |   2 -
 drivers/gpu/drm/i915/intel_display.c | 117 +--
 drivers/gpu/drm/i915/intel_drv.h |  21 +--
 drivers/gpu/drm/i915/intel_sprite.c  |   8 +--
 7 files changed, 3 insertions(+), 220 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_debugfs.c 
b/drivers/gpu/drm/i915/i915_debugfs.c
index 2ef75c1a6119..c25f42c60d61 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -543,75 +543,6 @@ static int i915_gem_gtt_info(struct seq_file *m, void 
*data)
return 0;
 }
 
-static int i915_gem_pageflip_info(struct seq_file *m, void *data)
-{
-   struct drm_i915_private *dev_priv = node_to_i915(m->private);
-   struct drm_device *dev = _priv->drm;
-   struct intel_crtc *crtc;
-   int ret;
-
-   ret = mutex_lock_interruptible(>struct_mutex);
-   if (ret)
-   return ret;
-
-   for_each_intel_crtc(dev, crtc) {
-   const char pipe = pipe_name(crtc->pipe);
-   const char plane = plane_name(crtc->plane);
-   struct intel_flip_work *work;
-
-   spin_lock_irq(>event_lock);
-   work = crtc->flip_work;
-   if (work == NULL) {
-   seq_printf(m, "No flip due on pipe %c (plane %c)\n",
-  pipe, plane);
-   } else {
-   u32 pending;
-   u32 addr;
-
-   pending = atomic_read(>pending);
-   if (pending) {
-   seq_printf(m, "Flip ioctl preparing on pipe %c 
(plane %c)\n",
-  pipe, plane);
-   } else {
-   seq_printf(m, "Flip pending (waiting for vsync) 
on pipe %c (plane %c)\n",
-  pipe, plane);
-   }
-   if (work->flip_queued_req) {
-   struct intel_engine_cs *engine = 
work->flip_queued_req->engine;
-
-   seq_printf(m, "Flip queued on %s at seqno %x, 
last submitted seqno %x [current breadcrumb %x], completed? %d\n",
-  engine->name,
-  work->flip_queued_req->global_seqno,
-  intel_engine_last_submit(engine),
-  intel_engine_get_seqno(engine),
-  
i915_gem_request_completed(work->flip_queued_req));
-   } else
-   seq_printf(m, "Flip not associated with any 
ring\n");
-   seq_printf(m, "Flip queued on frame %d, (was ready on 
frame %d), now %d\n",
-  work->flip_queued_vblank,
-  work->flip_ready_vblank,
-  intel_crtc_get_vblank_counter(crtc));
-   seq_printf(m, "%d prepares\n", 
atomic_read(>pending));
-
-   if (INTEL_GEN(dev_priv) >= 4)
-   addr = 
I915_HI_DISPBASE(I915_READ(DSPSURF(crtc->plane)));
-   else
-   addr = I915_READ(DSPADDR(crtc->plane));
-   seq_printf(m, "Current scanout address 0x%08x\n", addr);
-
-   if (work->pending_flip_obj) {
-   seq_printf(m, "New framebuffer address 
0x%08lx\n", (long)work->gtt_offset);
-   seq_printf(m, "MMIO update completed? %d\n",  
addr == work->gtt_offset);
-   }
-   }
-   spin_unlock_irq(>event_lock);
-   }
-
-   mutex_unlock(>struct_mutex);
-
-   return 0;
-}
-
 static int i915_gem_batch_pool_info(struct seq_file *m, void *data)
 {
struct drm_i915_private *dev_priv = node_to_i915(m->private);
@@ -4854,7 +4785,6 @@ static const struct drm_info_list i915_debugfs_list[] = {
{"i915_gem_gtt", i915_gem_gtt_info, 0},
{"i915_gem_pin_display", i915_gem_gtt_info, 0, (void *)1},

[Intel-gfx] [PATCH 6/7] drm/i915: Remove intel_flip_work infrastructure

2017-07-20 Thread Daniel Vetter
This gets rid of all the interactions between the legacy flip code and
the modeset code. Yay!

This highlights an ommission in the atomic paths, where we fail to
apply a boost to the pending rendering when we miss the target vblank.
But the existing code is still dead and can be removed.

v2: Note that the boosting doesn't work in atomic (Chris).

Cc: Maarten Lankhorst 
Cc: Ville Syrjälä 
Reviewed-by: Maarten Lankhorst 
Signed-off-by: Daniel Vetter 
---
 drivers/gpu/drm/i915/i915_debugfs.c  |  70 -
 drivers/gpu/drm/i915/i915_drv.c  |   1 -
 drivers/gpu/drm/i915/i915_drv.h  |   4 --
 drivers/gpu/drm/i915/i915_gem.c  |   2 -
 drivers/gpu/drm/i915/intel_display.c | 117 +--
 drivers/gpu/drm/i915/intel_drv.h |  21 +--
 drivers/gpu/drm/i915/intel_sprite.c  |   8 +--
 7 files changed, 3 insertions(+), 220 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_debugfs.c 
b/drivers/gpu/drm/i915/i915_debugfs.c
index 2ef75c1a6119..c25f42c60d61 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -543,75 +543,6 @@ static int i915_gem_gtt_info(struct seq_file *m, void 
*data)
return 0;
 }
 
-static int i915_gem_pageflip_info(struct seq_file *m, void *data)
-{
-   struct drm_i915_private *dev_priv = node_to_i915(m->private);
-   struct drm_device *dev = _priv->drm;
-   struct intel_crtc *crtc;
-   int ret;
-
-   ret = mutex_lock_interruptible(>struct_mutex);
-   if (ret)
-   return ret;
-
-   for_each_intel_crtc(dev, crtc) {
-   const char pipe = pipe_name(crtc->pipe);
-   const char plane = plane_name(crtc->plane);
-   struct intel_flip_work *work;
-
-   spin_lock_irq(>event_lock);
-   work = crtc->flip_work;
-   if (work == NULL) {
-   seq_printf(m, "No flip due on pipe %c (plane %c)\n",
-  pipe, plane);
-   } else {
-   u32 pending;
-   u32 addr;
-
-   pending = atomic_read(>pending);
-   if (pending) {
-   seq_printf(m, "Flip ioctl preparing on pipe %c 
(plane %c)\n",
-  pipe, plane);
-   } else {
-   seq_printf(m, "Flip pending (waiting for vsync) 
on pipe %c (plane %c)\n",
-  pipe, plane);
-   }
-   if (work->flip_queued_req) {
-   struct intel_engine_cs *engine = 
work->flip_queued_req->engine;
-
-   seq_printf(m, "Flip queued on %s at seqno %x, 
last submitted seqno %x [current breadcrumb %x], completed? %d\n",
-  engine->name,
-  work->flip_queued_req->global_seqno,
-  intel_engine_last_submit(engine),
-  intel_engine_get_seqno(engine),
-  
i915_gem_request_completed(work->flip_queued_req));
-   } else
-   seq_printf(m, "Flip not associated with any 
ring\n");
-   seq_printf(m, "Flip queued on frame %d, (was ready on 
frame %d), now %d\n",
-  work->flip_queued_vblank,
-  work->flip_ready_vblank,
-  intel_crtc_get_vblank_counter(crtc));
-   seq_printf(m, "%d prepares\n", 
atomic_read(>pending));
-
-   if (INTEL_GEN(dev_priv) >= 4)
-   addr = 
I915_HI_DISPBASE(I915_READ(DSPSURF(crtc->plane)));
-   else
-   addr = I915_READ(DSPADDR(crtc->plane));
-   seq_printf(m, "Current scanout address 0x%08x\n", addr);
-
-   if (work->pending_flip_obj) {
-   seq_printf(m, "New framebuffer address 
0x%08lx\n", (long)work->gtt_offset);
-   seq_printf(m, "MMIO update completed? %d\n",  
addr == work->gtt_offset);
-   }
-   }
-   spin_unlock_irq(>event_lock);
-   }
-
-   mutex_unlock(>struct_mutex);
-
-   return 0;
-}
-
 static int i915_gem_batch_pool_info(struct seq_file *m, void *data)
 {
struct drm_i915_private *dev_priv = node_to_i915(m->private);
@@ -4854,7 +4785,6 @@ static const struct drm_info_list i915_debugfs_list[] = {
{"i915_gem_gtt", i915_gem_gtt_info, 0},
{"i915_gem_pin_display", i915_gem_gtt_info, 0, (void *)1},