aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_irq.c
diff options
context:
space:
mode:
authorZou Nan hai <nanhai.zou@intel.com>2010-05-20 21:08:55 -0400
committerEric Anholt <eric@anholt.net>2010-05-26 16:24:49 -0400
commit8187a2b70e34c727a06617441f74f202b6fefaf9 (patch)
tree48622c6f95282dc0a0fa668110aac4efa6e89066 /drivers/gpu/drm/i915/i915_irq.c
parentd3301d86b4bf2bcf649982ae464211d8bcf9575a (diff)
drm/i915: introduce intel_ring_buffer structure (V2)
Introduces a more complete intel_ring_buffer structure with callbacks for setup and management of a particular ringbuffer, and converts the render ring buffer consumers to use it. Signed-off-by: Zou Nan hai <nanhai.zou@intel.com> Signed-off-by: Xiang Hai hao <haihao.xiang@intel.com> [anholt: Fixed up whitespace fail and rebased against prep patches] Signed-off-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_irq.c')
-rw-r--r--drivers/gpu/drm/i915/i915_irq.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index dd91c97de968..e07c643c8365 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -545,7 +545,8 @@ i915_ringbuffer_last_batch(struct drm_device *dev)
545 } 545 }
546 546
547 if (bbaddr == 0) { 547 if (bbaddr == 0) {
548 ring = (u32 *)(dev_priv->render_ring.virtual_start + dev_priv->render_ring.Size); 548 ring = (u32 *)(dev_priv->render_ring.virtual_start
549 + dev_priv->render_ring.size);
549 while (--ring >= (u32 *)dev_priv->render_ring.virtual_start) { 550 while (--ring >= (u32 *)dev_priv->render_ring.virtual_start) {
550 bbaddr = i915_get_bbaddr(dev, ring); 551 bbaddr = i915_get_bbaddr(dev, ring);
551 if (bbaddr) 552 if (bbaddr)
@@ -639,7 +640,8 @@ static void i915_capture_error_state(struct drm_device *dev)
639 error->batchbuffer[1] = i915_error_object_create(dev, batchbuffer[1]); 640 error->batchbuffer[1] = i915_error_object_create(dev, batchbuffer[1]);
640 641
641 /* Record the ringbuffer */ 642 /* Record the ringbuffer */
642 error->ringbuffer = i915_error_object_create(dev, dev_priv->render_ring.ring_obj); 643 error->ringbuffer = i915_error_object_create(dev,
644 dev_priv->render_ring.gem_object);
643 645
644 /* Record buffers on the active list. */ 646 /* Record buffers on the active list. */
645 error->active_bo = NULL; 647 error->active_bo = NULL;
@@ -984,7 +986,6 @@ static int i915_emit_irq(struct drm_device * dev)
984{ 986{
985 drm_i915_private_t *dev_priv = dev->dev_private; 987 drm_i915_private_t *dev_priv = dev->dev_private;
986 struct drm_i915_master_private *master_priv = dev->primary->master->driver_priv; 988 struct drm_i915_master_private *master_priv = dev->primary->master->driver_priv;
987 RING_LOCALS;
988 989
989 i915_kernel_lost_context(dev); 990 i915_kernel_lost_context(dev);
990 991
@@ -1009,9 +1010,10 @@ static int i915_emit_irq(struct drm_device * dev)
1009void i915_trace_irq_get(struct drm_device *dev, u32 seqno) 1010void i915_trace_irq_get(struct drm_device *dev, u32 seqno)
1010{ 1011{
1011 drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; 1012 drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
1013 struct intel_ring_buffer *render_ring = &dev_priv->render_ring;
1012 1014
1013 if (dev_priv->trace_irq_seqno == 0) 1015 if (dev_priv->trace_irq_seqno == 0)
1014 i915_user_irq_get(dev); 1016 render_ring->user_irq_get(dev, render_ring);
1015 1017
1016 dev_priv->trace_irq_seqno = seqno; 1018 dev_priv->trace_irq_seqno = seqno;
1017} 1019}
@@ -1021,6 +1023,7 @@ static int i915_wait_irq(struct drm_device * dev, int irq_nr)
1021 drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; 1023 drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
1022 struct drm_i915_master_private *master_priv = dev->primary->master->driver_priv; 1024 struct drm_i915_master_private *master_priv = dev->primary->master->driver_priv;
1023 int ret = 0; 1025 int ret = 0;
1026 struct intel_ring_buffer *render_ring = &dev_priv->render_ring;
1024 1027
1025 DRM_DEBUG_DRIVER("irq_nr=%d breadcrumb=%d\n", irq_nr, 1028 DRM_DEBUG_DRIVER("irq_nr=%d breadcrumb=%d\n", irq_nr,
1026 READ_BREADCRUMB(dev_priv)); 1029 READ_BREADCRUMB(dev_priv));
@@ -1034,10 +1037,10 @@ static int i915_wait_irq(struct drm_device * dev, int irq_nr)
1034 if (master_priv->sarea_priv) 1037 if (master_priv->sarea_priv)
1035 master_priv->sarea_priv->perf_boxes |= I915_BOX_WAIT; 1038 master_priv->sarea_priv->perf_boxes |= I915_BOX_WAIT;
1036 1039
1037 i915_user_irq_get(dev); 1040 render_ring->user_irq_get(dev, render_ring);
1038 DRM_WAIT_ON(ret, dev_priv->irq_queue, 3 * DRM_HZ, 1041 DRM_WAIT_ON(ret, dev_priv->irq_queue, 3 * DRM_HZ,
1039 READ_BREADCRUMB(dev_priv) >= irq_nr); 1042 READ_BREADCRUMB(dev_priv) >= irq_nr);
1040 i915_user_irq_put(dev); 1043 render_ring->user_irq_put(dev, render_ring);
1041 1044
1042 if (ret == -EBUSY) { 1045 if (ret == -EBUSY) {
1043 DRM_ERROR("EBUSY -- rec: %d emitted: %d\n", 1046 DRM_ERROR("EBUSY -- rec: %d emitted: %d\n",