[Intel-gfx] [PATCH 12/13] drm/i915: Remove redundant warning and consolidate gen8 render semaphore vfunc

Tvrtko Ursulin tvrtko.ursulin at linux.intel.com
Mon Jun 27 14:04:19 UTC 2016


From: Tvrtko Ursulin <tvrtko.ursulin at intel.com>

Warning could not trigger due code just above it making sure the
semaphores revert to disabled state if the object allocation has
failed. Move the relevant vfunc on the success path for clarity
as well.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
---
 drivers/gpu/drm/i915/intel_ringbuffer.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
index cadc00797965..847cd5ef9aea 100644
--- a/drivers/gpu/drm/i915/intel_ringbuffer.c
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
@@ -3017,8 +3017,10 @@ int intel_init_render_ring_buffer(struct drm_device *dev)
 					drm_gem_object_unreference(&obj->base);
 					DRM_ERROR("Failed to pin semaphore bo. Disabling semaphores\n");
 					i915.semaphores = 0;
-				} else
+				} else {
 					dev_priv->semaphore_obj = obj;
+					engine->semaphore.signal = gen8_rcs_signal;
+				}
 			}
 		}
 
@@ -3026,10 +3028,6 @@ int intel_init_render_ring_buffer(struct drm_device *dev)
 		engine->add_request = gen8_render_add_request;
 		engine->flush = gen8_render_ring_flush;
 		engine->irq_enable_mask = GT_RENDER_USER_INTERRUPT;
-		if (i915_semaphore_is_enabled(dev_priv)) {
-			WARN_ON(!dev_priv->semaphore_obj);
-			engine->semaphore.signal = gen8_rcs_signal;
-		}
 	} else if (INTEL_GEN(dev_priv) >= 6) {
 		engine->init_context = intel_rcs_ctx_init;
 		engine->flush = gen7_render_ring_flush;
-- 
1.9.1



More information about the Intel-gfx mailing list