Re: [PATCH] drm/i915: Replace has_bsd/blt/vebox with a mask

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

 



On Mon, Oct 14, 2013 at 08:46:22PM -0700, Ben Widawsky wrote:
> -cleanup_vebox_ring:
> -	intel_cleanup_ring_buffer(&dev_priv->ring[VECS]);
> -cleanup_blt_ring:
> -	intel_cleanup_ring_buffer(&dev_priv->ring[BCS]);
> -cleanup_bsd_ring:
> -	intel_cleanup_ring_buffer(&dev_priv->ring[VCS]);
> -cleanup_render_ring:
> -	intel_cleanup_ring_buffer(&dev_priv->ring[RCS]);
> +cleanup:
> +	for_each_ring(ring, dev_priv, i) {
> +		if (!(INTEL_INFO(dev)->ring_mask & (1<<i)) ||
> +		    !ring->name)
> +			continue;

This looks dubious. You don't need to check ring_mask here as that will
be implicit in whatever we test for completeness. ring->name is set at
the start of initialisation and is not cleaned upon error. A better
choice is ring->obj, which we already check in
intel_cleanup_ring_buffer.

So this becomes:
cleanup:
  for_each_ring(ring, dev_priv, i)
> +		intel_cleanup_ring_buffer(ring);

-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
http://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