aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/drm/i915/i915_dma.c10
-rw-r--r--drivers/gpu/drm/i915/i915_drv.h3
-rw-r--r--drivers/gpu/drm/i915/i915_irq.c6
3 files changed, 8 insertions, 11 deletions
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
index 9d4278be0ca0..0d215e38606a 100644
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
@@ -445,7 +445,7 @@ static void i915_emit_breadcrumb(struct drm_device *dev)
445 445
446 BEGIN_LP_RING(4); 446 BEGIN_LP_RING(4);
447 OUT_RING(MI_STORE_DWORD_INDEX); 447 OUT_RING(MI_STORE_DWORD_INDEX);
448 OUT_RING(5 << MI_STORE_DWORD_INDEX_SHIFT); 448 OUT_RING(I915_BREADCRUMB_INDEX << MI_STORE_DWORD_INDEX_SHIFT);
449 OUT_RING(dev_priv->counter); 449 OUT_RING(dev_priv->counter);
450 OUT_RING(0); 450 OUT_RING(0);
451 ADVANCE_LP_RING(); 451 ADVANCE_LP_RING();
@@ -576,7 +576,7 @@ static int i915_dispatch_flip(struct drm_device * dev)
576 576
577 BEGIN_LP_RING(4); 577 BEGIN_LP_RING(4);
578 OUT_RING(MI_STORE_DWORD_INDEX); 578 OUT_RING(MI_STORE_DWORD_INDEX);
579 OUT_RING(5 << MI_STORE_DWORD_INDEX_SHIFT); 579 OUT_RING(I915_BREADCRUMB_INDEX << MI_STORE_DWORD_INDEX_SHIFT);
580 OUT_RING(dev_priv->counter); 580 OUT_RING(dev_priv->counter);
581 OUT_RING(0); 581 OUT_RING(0);
582 ADVANCE_LP_RING(); 582 ADVANCE_LP_RING();
@@ -611,7 +611,6 @@ static int i915_batchbuffer(struct drm_device *dev, void *data,
611 struct drm_file *file_priv) 611 struct drm_file *file_priv)
612{ 612{
613 drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; 613 drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
614 u32 *hw_status = dev_priv->hw_status_page;
615 drm_i915_sarea_t *sarea_priv = (drm_i915_sarea_t *) 614 drm_i915_sarea_t *sarea_priv = (drm_i915_sarea_t *)
616 dev_priv->sarea_priv; 615 dev_priv->sarea_priv;
617 drm_i915_batchbuffer_t *batch = data; 616 drm_i915_batchbuffer_t *batch = data;
@@ -637,7 +636,7 @@ static int i915_batchbuffer(struct drm_device *dev, void *data,
637 mutex_unlock(&dev->struct_mutex); 636 mutex_unlock(&dev->struct_mutex);
638 637
639 if (sarea_priv) 638 if (sarea_priv)
640 sarea_priv->last_dispatch = (int)hw_status[5]; 639 sarea_priv->last_dispatch = READ_BREADCRUMB(dev_priv);
641 return ret; 640 return ret;
642} 641}
643 642
@@ -645,7 +644,6 @@ static int i915_cmdbuffer(struct drm_device *dev, void *data,
645 struct drm_file *file_priv) 644 struct drm_file *file_priv)
646{ 645{
647 drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; 646 drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
648 u32 *hw_status = dev_priv->hw_status_page;
649 drm_i915_sarea_t *sarea_priv = (drm_i915_sarea_t *) 647 drm_i915_sarea_t *sarea_priv = (drm_i915_sarea_t *)
650 dev_priv->sarea_priv; 648 dev_priv->sarea_priv;
651 drm_i915_cmdbuffer_t *cmdbuf = data; 649 drm_i915_cmdbuffer_t *cmdbuf = data;
@@ -673,7 +671,7 @@ static int i915_cmdbuffer(struct drm_device *dev, void *data,
673 } 671 }
674 672
675 if (sarea_priv) 673 if (sarea_priv)
676 sarea_priv->last_dispatch = (int)hw_status[5]; 674 sarea_priv->last_dispatch = READ_BREADCRUMB(dev_priv);
677 return 0; 675 return 0;
678} 676}
679 677
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 4afbadb13316..ef1c0b8f8d07 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -608,8 +608,9 @@ static inline void opregion_enable_asle(struct drm_device *dev) { return; }
608 * The area from dword 0x20 to 0x3ff is available for driver usage. 608 * The area from dword 0x20 to 0x3ff is available for driver usage.
609 */ 609 */
610#define READ_HWSP(dev_priv, reg) (((volatile u32*)(dev_priv->hw_status_page))[reg]) 610#define READ_HWSP(dev_priv, reg) (((volatile u32*)(dev_priv->hw_status_page))[reg])
611#define READ_BREADCRUMB(dev_priv) READ_HWSP(dev_priv, 5) 611#define READ_BREADCRUMB(dev_priv) READ_HWSP(dev_priv, I915_BREADCRUMB_INDEX)
612#define I915_GEM_HWS_INDEX 0x20 612#define I915_GEM_HWS_INDEX 0x20
613#define I915_BREADCRUMB_INDEX 0x21
613 614
614extern int i915_wait_ring(struct drm_device * dev, int n, const char *caller); 615extern int i915_wait_ring(struct drm_device * dev, int n, const char *caller);
615 616
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index a75345af62ef..82752d6177a4 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -212,12 +212,10 @@ static int i915_emit_irq(struct drm_device * dev)
212 if (dev_priv->sarea_priv) 212 if (dev_priv->sarea_priv)
213 dev_priv->sarea_priv->last_enqueue = dev_priv->counter; 213 dev_priv->sarea_priv->last_enqueue = dev_priv->counter;
214 214
215 BEGIN_LP_RING(6); 215 BEGIN_LP_RING(4);
216 OUT_RING(MI_STORE_DWORD_INDEX); 216 OUT_RING(MI_STORE_DWORD_INDEX);
217 OUT_RING(5 << MI_STORE_DWORD_INDEX_SHIFT); 217 OUT_RING(I915_BREADCRUMB_INDEX << MI_STORE_DWORD_INDEX_SHIFT);
218 OUT_RING(dev_priv->counter); 218 OUT_RING(dev_priv->counter);
219 OUT_RING(0);
220 OUT_RING(0);
221 OUT_RING(MI_USER_INTERRUPT); 219 OUT_RING(MI_USER_INTERRUPT);
222 ADVANCE_LP_RING(); 220 ADVANCE_LP_RING();
223 221