Re: [PATCH 09/13] drm/i915: Compact Gen8 semaphore initialization

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jun 27, 2016 at 03:04:16PM +0100, Tvrtko Ursulin wrote:
> From: Tvrtko Ursulin <tvrtko.ursulin@xxxxxxxxx>
> 
> Replace the macro initializer with a programatic loop which
> results in smaller code and hopefully just as clear.
> 
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@xxxxxxxxx>
> ---
>  drivers/gpu/drm/i915/intel_ringbuffer.c | 16 +++++++++++++++-
>  drivers/gpu/drm/i915/intel_ringbuffer.h | 12 ------------
>  2 files changed, 15 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
> index 691f82199d3c..088d75397d1b 100644
> --- a/drivers/gpu/drm/i915/intel_ringbuffer.c
> +++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
> @@ -2876,13 +2876,27 @@ static int gen6_ring_flush(struct drm_i915_gem_request *req,
>  static void intel_ring_init_semaphores(struct drm_i915_private *dev_priv,
>  				       struct intel_engine_cs *engine)
>  {
> +	int i;
> +
>  	if (!i915_semaphore_is_enabled(dev_priv))
>  		return;
>  
>  	if (INTEL_GEN(dev_priv) >= 8) {
>  		engine->semaphore.sync_to = gen8_ring_sync;
>  		engine->semaphore.signal = gen8_xcs_signal;
> -		GEN8_RING_SEMAPHORE_INIT(engine);
> +
> +		if (dev_priv->semaphore_obj) {

Something is broken if we reach here without semaphore_obj and
semaphores enabled.

Hmm. Currently we create the semaphore_obj before creating initialising
the semaphore vfuncs on the render ring. Don't you need to do the same
here?

intel_ring_init_seamphores() {
	if (!semaphores_is_enabled(dev_priv))
		return;
	
	if (INTEL_GEN(dev_priv) >= 8 && !dev_priv->semaphore_obj) {
		semaphore_obj = i915_gem_object_create()
		if (!semaphore_obj)
			i915.enable_semaphores = 0;
		return;
	}

	if (INTEL_GEN(dev_priv) >= 8) {
	} else { /* semaphores_is_enabled() should not be true for < 6 */
	}
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux