فهرست منبع

drm/i915: Updating comments.

ring index calculation table was out of date after other rings were added,
although the formula is flexible and scale when adding new rings.

So this patch just update the comments and add a brief explanation
why to use sync_seqno[ring index].

Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Rodrigo Vivi 11 سال پیش
والد
کامیت
ddd4dbc6c1
2فایلهای تغییر یافته به همراه7 افزوده شده و 3 حذف شده
  1. 2 0
      drivers/gpu/drm/i915/i915_gem.c
  2. 5 3
      drivers/gpu/drm/i915/intel_ringbuffer.h

+ 2 - 0
drivers/gpu/drm/i915/i915_gem.c

@@ -2842,6 +2842,8 @@ i915_gem_object_sync(struct drm_i915_gem_object *obj,
 	idx = intel_ring_sync_index(from, to);
 	idx = intel_ring_sync_index(from, to);
 
 
 	seqno = obj->last_read_seqno;
 	seqno = obj->last_read_seqno;
+	/* Optimization: Avoid semaphore sync when we are sure we already
+	 * waited for an object with higher seqno */
 	if (seqno <= from->semaphore.sync_seqno[idx])
 	if (seqno <= from->semaphore.sync_seqno[idx])
 		return 0;
 		return 0;
 
 

+ 5 - 3
drivers/gpu/drm/i915/intel_ringbuffer.h

@@ -238,9 +238,11 @@ intel_ring_sync_index(struct intel_engine_cs *ring,
 	int idx;
 	int idx;
 
 
 	/*
 	/*
-	 * cs -> 0 = vcs, 1 = bcs
-	 * vcs -> 0 = bcs, 1 = cs,
-	 * bcs -> 0 = cs, 1 = vcs.
+	 * rcs -> 0 = vcs, 1 = bcs, 2 = vecs, 3 = vcs2;
+	 * vcs -> 0 = bcs, 1 = vecs, 2 = vcs2, 3 = rcs;
+	 * bcs -> 0 = vecs, 1 = vcs2. 2 = rcs, 3 = vcs;
+	 * vecs -> 0 = vcs2, 1 = rcs, 2 = vcs, 3 = bcs;
+	 * vcs2 -> 0 = rcs, 1 = vcs, 2 = bcs, 3 = vecs;
 	 */
 	 */
 
 
 	idx = (other - ring) - 1;
 	idx = (other - ring) - 1;