Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 307137
b: refs/heads/master
c: 5816d64
h: refs/heads/master
i:
  307135: 3bfc0f7
v: v3
  • Loading branch information
Ben Widawsky authored and Daniel Vetter committed Apr 12, 2012
1 parent fe5243d commit 0883888
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 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: f82cfb6bcda164ef3a66b8c3fc549b1f9bdd09ad
refs/heads/master: 5816d648d5f0d496d7bf11ab9174a365c791ccc6
14 changes: 13 additions & 1 deletion trunk/drivers/gpu/drm/i915/i915_gem.c
Original file line number Diff line number Diff line change
Expand Up @@ -1953,6 +1953,18 @@ i915_gem_object_wait_rendering(struct drm_i915_gem_object *obj)
return 0;
}

/**
* i915_gem_object_sync - sync an object to a ring.
*
* @obj: object which may be in use on another ring.
* @to: ring we wish to use the object on. May be NULL.
*
* This code is meant to abstract object synchronization with the GPU.
* Calling with NULL implies synchronizing the object with the CPU
* rather than a particular GPU ring.
*
* Returns 0 if successful, else propagates up the lower layer error.
*/
int
i915_gem_object_sync(struct drm_i915_gem_object *obj,
struct intel_ring_buffer *to)
Expand All @@ -1964,7 +1976,7 @@ i915_gem_object_sync(struct drm_i915_gem_object *obj,
if (from == NULL || to == from)
return 0;

if (!i915_semaphore_is_enabled(obj->base.dev))
if (to == NULL || !i915_semaphore_is_enabled(obj->base.dev))
return i915_gem_object_wait_rendering(obj);

idx = intel_ring_sync_index(from, to);
Expand Down

0 comments on commit 0883888

Please sign in to comment.