Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 307188
b: refs/heads/master
c: 1c293ea
h: refs/heads/master
v: v3
  • Loading branch information
Chris Wilson authored and Daniel Vetter committed Apr 18, 2012
1 parent 6a80b25 commit b9d64b7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 15 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: 69963e7c76743bd9e8ef559f955165dd85d9ba72
refs/heads/master: 1c293ea3b1d1c72f1fc5f398e03232d8d302bd23
5 changes: 2 additions & 3 deletions trunk/drivers/gpu/drm/i915/i915_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -930,13 +930,12 @@ struct drm_i915_gem_object {
*/
uint32_t gtt_offset;

/** Breadcrumb of last rendering to the buffer. */
uint32_t last_rendering_seqno;
struct intel_ring_buffer *ring;

/** Breadcrumb of last rendering to the buffer. */
uint32_t last_rendering_seqno;
/** Breadcrumb of last fenced GPU access to the buffer. */
uint32_t last_fenced_seqno;
struct intel_ring_buffer *last_fenced_ring;

/** Current tiling stride for the object, if it's tiled. */
uint32_t stride;
Expand Down
16 changes: 5 additions & 11 deletions trunk/drivers/gpu/drm/i915/i915_gem.c
Original file line number Diff line number Diff line change
Expand Up @@ -1398,7 +1398,6 @@ i915_gem_object_move_to_active(struct drm_i915_gem_object *obj,

if (obj->fenced_gpu_access) {
obj->last_fenced_seqno = seqno;
obj->last_fenced_ring = ring;

/* Bump MRU to take account of the delayed flush */
if (obj->fence_reg != I915_FENCE_REG_NONE) {
Expand Down Expand Up @@ -1445,7 +1444,6 @@ i915_gem_object_move_to_inactive(struct drm_i915_gem_object *obj)
BUG_ON(!list_empty(&obj->gpu_write_list));
BUG_ON(!obj->active);
obj->ring = NULL;
obj->last_fenced_ring = NULL;

i915_gem_object_move_off_active(obj);
obj->fenced_gpu_access = false;
Expand Down Expand Up @@ -1650,7 +1648,6 @@ static void i915_gem_reset_fences(struct drm_device *dev)
reg->obj->fence_reg = I915_FENCE_REG_NONE;
reg->obj->fenced_gpu_access = false;
reg->obj->last_fenced_seqno = 0;
reg->obj->last_fenced_ring = NULL;
i915_gem_clear_fence_reg(dev, reg);
}
}
Expand Down Expand Up @@ -2295,7 +2292,7 @@ i915_gem_object_flush_fence(struct drm_i915_gem_object *obj)

if (obj->fenced_gpu_access) {
if (obj->base.write_domain & I915_GEM_GPU_DOMAINS) {
ret = i915_gem_flush_ring(obj->last_fenced_ring,
ret = i915_gem_flush_ring(obj->ring,
0, obj->base.write_domain);
if (ret)
return ret;
Expand All @@ -2304,18 +2301,17 @@ i915_gem_object_flush_fence(struct drm_i915_gem_object *obj)
obj->fenced_gpu_access = false;
}

if (obj->last_fenced_seqno && NULL != obj->last_fenced_ring) {
if (!ring_passed_seqno(obj->last_fenced_ring,
if (obj->last_fenced_seqno) {
if (!ring_passed_seqno(obj->ring,
obj->last_fenced_seqno)) {
ret = i915_wait_request(obj->last_fenced_ring,
ret = i915_wait_request(obj->ring,
obj->last_fenced_seqno,
true);
if (ret)
return ret;
}

obj->last_fenced_seqno = 0;
obj->last_fenced_ring = NULL;
}

/* Ensure that all CPU reads are completed before installing a fence
Expand Down Expand Up @@ -2382,7 +2378,7 @@ i915_find_fence_reg(struct drm_device *dev)
if (first == NULL)
first = reg;

if (reg->obj->last_fenced_ring == NULL) {
if (reg->obj->last_fenced_seqno == 0) {
avail = reg;
break;
}
Expand Down Expand Up @@ -2458,7 +2454,6 @@ i915_gem_object_get_fence(struct drm_i915_gem_object *obj)
}

old->fence_reg = I915_FENCE_REG_NONE;
old->last_fenced_ring = NULL;
old->last_fenced_seqno = 0;

drm_gem_object_unreference(&old->base);
Expand All @@ -2467,7 +2462,6 @@ i915_gem_object_get_fence(struct drm_i915_gem_object *obj)
reg->obj = obj;
list_move_tail(&reg->lru_list, &dev_priv->mm.fence_list);
obj->fence_reg = reg - dev_priv->fence_regs;
obj->last_fenced_ring = NULL;

update:
obj->tiling_changed = false;
Expand Down

0 comments on commit b9d64b7

Please sign in to comment.