Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 115711
b: refs/heads/master
c: c99b058
h: refs/heads/master
i:
  115709: a00ab96
  115707: 6119a0c
  115703: 8729b0c
  115695: 929d913
  115679: 11aa85e
  115647: c13184b
  115583: 8990739
  115455: 316cdde
  115199: 2949486
  114687: b5e6a13
v: v3
  • Loading branch information
Kristian Høgsberg authored and Dave Airlie committed Oct 17, 2008
1 parent f3a67aa commit e281c12
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 546b0974c39657017407c86fe79811100b60700d
refs/heads/master: c99b058f132388a666544d293392d52d1def6b12
21 changes: 14 additions & 7 deletions trunk/drivers/gpu/drm/i915/i915_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ int i915_wait_ring(struct drm_device * dev, int n, const char *caller)
if (ring->space >= n)
return 0;

dev_priv->sarea_priv->perf_boxes |= I915_BOX_WAIT;
if (dev_priv->sarea_priv)
dev_priv->sarea_priv->perf_boxes |= I915_BOX_WAIT;

if (ring->head != last_head)
i = 0;
Expand Down Expand Up @@ -128,7 +129,7 @@ void i915_kernel_lost_context(struct drm_device * dev)
if (ring->space < 0)
ring->space += ring->Size;

if (ring->head == ring->tail)
if (ring->head == ring->tail && dev_priv->sarea_priv)
dev_priv->sarea_priv->perf_boxes |= I915_BOX_RING_EMPTY;
}

Expand Down Expand Up @@ -433,10 +434,11 @@ static void i915_emit_breadcrumb(struct drm_device *dev)
drm_i915_private_t *dev_priv = dev->dev_private;
RING_LOCALS;

dev_priv->sarea_priv->last_enqueue = ++dev_priv->counter;

dev_priv->counter++;
if (dev_priv->counter > 0x7FFFFFFFUL)
dev_priv->sarea_priv->last_enqueue = dev_priv->counter = 1;
dev_priv->counter = 0;
if (dev_priv->sarea_priv)
dev_priv->sarea_priv->last_enqueue = dev_priv->counter;

BEGIN_LP_RING(4);
OUT_RING(MI_STORE_DWORD_INDEX);
Expand Down Expand Up @@ -534,6 +536,9 @@ static int i915_dispatch_flip(struct drm_device * dev)
drm_i915_private_t *dev_priv = dev->dev_private;
RING_LOCALS;

if (!dev_priv->sarea_priv)
return -EINVAL;

DRM_DEBUG("%s: page=%d pfCurrentPage=%d\n",
__func__,
dev_priv->current_page,
Expand Down Expand Up @@ -628,7 +633,8 @@ static int i915_batchbuffer(struct drm_device *dev, void *data,
ret = i915_dispatch_batchbuffer(dev, batch);
mutex_unlock(&dev->struct_mutex);

sarea_priv->last_dispatch = (int)hw_status[5];
if (sarea_priv)
sarea_priv->last_dispatch = (int)hw_status[5];
return ret;
}

Expand Down Expand Up @@ -663,7 +669,8 @@ static int i915_cmdbuffer(struct drm_device *dev, void *data,
return ret;
}

sarea_priv->last_dispatch = (int)hw_status[5];
if (sarea_priv)
sarea_priv->last_dispatch = (int)hw_status[5];
return 0;
}

Expand Down
25 changes: 17 additions & 8 deletions trunk/drivers/gpu/drm/i915/i915_irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,9 @@ irqreturn_t i915_driver_irq_handler(DRM_IRQ_ARGS)
I915_WRITE(IMR, dev_priv->irq_mask_reg);
(void) I915_READ(IIR); /* Flush posted writes */

dev_priv->sarea_priv->last_dispatch = READ_BREADCRUMB(dev_priv);
if (dev_priv->sarea_priv)
dev_priv->sarea_priv->last_dispatch =
READ_BREADCRUMB(dev_priv);

if (iir & I915_USER_INTERRUPT) {
dev_priv->mm.irq_gem_seqno = i915_get_gem_seqno(dev);
Expand Down Expand Up @@ -456,10 +458,11 @@ static int i915_emit_irq(struct drm_device * dev)

DRM_DEBUG("\n");

dev_priv->sarea_priv->last_enqueue = ++dev_priv->counter;

dev_priv->counter++;
if (dev_priv->counter > 0x7FFFFFFFUL)
dev_priv->sarea_priv->last_enqueue = dev_priv->counter = 1;
dev_priv->counter = 1;
if (dev_priv->sarea_priv)
dev_priv->sarea_priv->last_enqueue = dev_priv->counter;

BEGIN_LP_RING(6);
OUT_RING(MI_STORE_DWORD_INDEX);
Expand Down Expand Up @@ -503,11 +506,15 @@ static int i915_wait_irq(struct drm_device * dev, int irq_nr)
READ_BREADCRUMB(dev_priv));

if (READ_BREADCRUMB(dev_priv) >= irq_nr) {
dev_priv->sarea_priv->last_dispatch = READ_BREADCRUMB(dev_priv);
if (dev_priv->sarea_priv) {
dev_priv->sarea_priv->last_dispatch =
READ_BREADCRUMB(dev_priv);
}
return 0;
}

dev_priv->sarea_priv->perf_boxes |= I915_BOX_WAIT;
if (dev_priv->sarea_priv)
dev_priv->sarea_priv->perf_boxes |= I915_BOX_WAIT;

i915_user_irq_get(dev);
DRM_WAIT_ON(ret, dev_priv->irq_queue, 3 * DRM_HZ,
Expand All @@ -519,7 +526,9 @@ static int i915_wait_irq(struct drm_device * dev, int irq_nr)
READ_BREADCRUMB(dev_priv), (int)dev_priv->counter);
}

dev_priv->sarea_priv->last_dispatch = READ_BREADCRUMB(dev_priv);
if (dev_priv->sarea_priv)
dev_priv->sarea_priv->last_dispatch =
READ_BREADCRUMB(dev_priv);

return ret;
}
Expand Down Expand Up @@ -682,7 +691,7 @@ int i915_vblank_swap(struct drm_device *dev, void *data,
struct list_head *list;
int ret;

if (!dev_priv) {
if (!dev_priv || !dev_priv->sarea_priv) {
DRM_ERROR("%s called with no initialization\n", __func__);
return -EINVAL;
}
Expand Down

0 comments on commit e281c12

Please sign in to comment.