[Intel-gfx] [PATCH 08/50] drm/i915: Rename functions that mention ringbuffers (meaning rings)

oscar.mateo at intel.com oscar.mateo at intel.com
Fri May 9 14:08:38 CEST 2014


From: Oscar Mateo <oscar.mateo at intel.com>

Continue with the refactoring: do not init or clean a "ringbuffer" when
you actually mean a "ring", because they are not the same thing anymore.

Again, no functional changes.

Signed-off-by: Oscar Mateo <oscar.mateo at intel.com>
---
 drivers/gpu/drm/i915/i915_dma.c         |  6 +++---
 drivers/gpu/drm/i915/i915_drv.h         |  2 +-
 drivers/gpu/drm/i915/i915_gem.c         | 30 +++++++++++++++---------------
 drivers/gpu/drm/i915/intel_ringbuffer.c | 30 +++++++++++++++---------------
 drivers/gpu/drm/i915/intel_ringbuffer.h | 14 +++++++-------
 5 files changed, 41 insertions(+), 41 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
index 8ec8963..eb3ce6d 100644
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
@@ -179,7 +179,7 @@ static int i915_dma_cleanup(struct drm_device * dev)
 
 	mutex_lock(&dev->struct_mutex);
 	for (i = 0; i < I915_NUM_RINGS; i++)
-		intel_cleanup_ring_buffer(&dev_priv->ring[i]);
+		intel_cleanup_ring(&dev_priv->ring[i]);
 	mutex_unlock(&dev->struct_mutex);
 
 	/* Clear the HWS virtual address at teardown */
@@ -1383,7 +1383,7 @@ static int i915_load_modeset_init(struct drm_device *dev)
 
 cleanup_gem:
 	mutex_lock(&dev->struct_mutex);
-	i915_gem_cleanup_ringbuffer(dev);
+	i915_gem_cleanup_ring(dev);
 	i915_gem_context_fini(dev);
 	mutex_unlock(&dev->struct_mutex);
 	WARN_ON(dev_priv->mm.aliasing_ppgtt);
@@ -1839,7 +1839,7 @@ int i915_driver_unload(struct drm_device *dev)
 
 		mutex_lock(&dev->struct_mutex);
 		i915_gem_free_all_phys_object(dev);
-		i915_gem_cleanup_ringbuffer(dev);
+		i915_gem_cleanup_ring(dev);
 		i915_gem_context_fini(dev);
 		WARN_ON(dev_priv->mm.aliasing_ppgtt);
 		mutex_unlock(&dev->struct_mutex);
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 3b7a36f9..ee27ce8 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -2266,7 +2266,7 @@ int __must_check i915_gem_init(struct drm_device *dev);
 int __must_check i915_gem_init_hw(struct drm_device *dev);
 int i915_gem_l3_remap(struct intel_engine *ring, int slice);
 void i915_gem_init_swizzling(struct drm_device *dev);
-void i915_gem_cleanup_ringbuffer(struct drm_device *dev);
+void i915_gem_cleanup_ring(struct drm_device *dev);
 int __must_check i915_gpu_idle(struct drm_device *dev);
 int __must_check i915_gem_suspend(struct drm_device *dev);
 int __i915_add_request(struct intel_engine *ring,
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index d9253c4..e7565d9 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -4262,7 +4262,7 @@ i915_gem_stop_ringbuffers(struct drm_device *dev)
 	int i;
 
 	for_each_active_ring(ring, dev_priv, i)
-		intel_stop_ring_buffer(ring);
+		intel_stop_ring(ring);
 }
 
 int
@@ -4384,30 +4384,30 @@ static int i915_gem_init_rings(struct drm_device *dev)
 	struct drm_i915_private *dev_priv = dev->dev_private;
 	int ret;
 
-	ret = intel_init_render_ring_buffer(dev);
+	ret = intel_init_render_ring(dev);
 	if (ret)
 		return ret;
 
 	if (HAS_BSD(dev)) {
-		ret = intel_init_bsd_ring_buffer(dev);
+		ret = intel_init_bsd_ring(dev);
 		if (ret)
 			goto cleanup_render_ring;
 	}
 
 	if (intel_enable_blt(dev)) {
-		ret = intel_init_blt_ring_buffer(dev);
+		ret = intel_init_blt_ring(dev);
 		if (ret)
 			goto cleanup_bsd_ring;
 	}
 
 	if (HAS_VEBOX(dev)) {
-		ret = intel_init_vebox_ring_buffer(dev);
+		ret = intel_init_vebox_ring(dev);
 		if (ret)
 			goto cleanup_blt_ring;
 	}
 
 	if (HAS_BSD2(dev)) {
-		ret = intel_init_bsd2_ring_buffer(dev);
+		ret = intel_init_bsd2_ring(dev);
 		if (ret)
 			goto cleanup_vebox_ring;
 	}
@@ -4419,15 +4419,15 @@ static int i915_gem_init_rings(struct drm_device *dev)
 	return 0;
 
 cleanup_bsd2_ring:
-	intel_cleanup_ring_buffer(&dev_priv->ring[VCS2]);
+	intel_cleanup_ring(&dev_priv->ring[VCS2]);
 cleanup_vebox_ring:
-	intel_cleanup_ring_buffer(&dev_priv->ring[VECS]);
+	intel_cleanup_ring(&dev_priv->ring[VECS]);
 cleanup_blt_ring:
-	intel_cleanup_ring_buffer(&dev_priv->ring[BCS]);
+	intel_cleanup_ring(&dev_priv->ring[BCS]);
 cleanup_bsd_ring:
-	intel_cleanup_ring_buffer(&dev_priv->ring[VCS]);
+	intel_cleanup_ring(&dev_priv->ring[VCS]);
 cleanup_render_ring:
-	intel_cleanup_ring_buffer(&dev_priv->ring[RCS]);
+	intel_cleanup_ring(&dev_priv->ring[RCS]);
 
 	return ret;
 }
@@ -4479,7 +4479,7 @@ i915_gem_init_hw(struct drm_device *dev)
 	ret = i915_gem_context_enable(dev_priv);
 	if (ret && ret != -EIO) {
 		DRM_ERROR("Context enable failed %d\n", ret);
-		i915_gem_cleanup_ringbuffer(dev);
+		i915_gem_cleanup_ring(dev);
 	}
 
 	return ret;
@@ -4529,14 +4529,14 @@ int i915_gem_init(struct drm_device *dev)
 }
 
 void
-i915_gem_cleanup_ringbuffer(struct drm_device *dev)
+i915_gem_cleanup_ring(struct drm_device *dev)
 {
 	struct drm_i915_private *dev_priv = dev->dev_private;
 	struct intel_engine *ring;
 	int i;
 
 	for_each_active_ring(ring, dev_priv, i)
-		intel_cleanup_ring_buffer(ring);
+		intel_cleanup_ring(ring);
 }
 
 int
@@ -4573,7 +4573,7 @@ i915_gem_entervt_ioctl(struct drm_device *dev, void *data,
 	return 0;
 
 cleanup_ringbuffer:
-	i915_gem_cleanup_ringbuffer(dev);
+	i915_gem_cleanup_ring(dev);
 	dev_priv->ums.mm_suspended = 1;
 	mutex_unlock(&dev->struct_mutex);
 
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
index f02c21e..6d14dcb 100644
--- a/drivers/gpu/drm/i915/intel_ringbuffer.c
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
@@ -1431,8 +1431,8 @@ err_unref:
 	return ret;
 }
 
-static int intel_init_ring_buffer(struct drm_device *dev,
-				  struct intel_engine *ring)
+static int intel_init_ring(struct drm_device *dev,
+			   struct intel_engine *ring)
 {
 	struct intel_ringbuffer *ringbuf = __get_ringbuf(ring);
 	int ret;
@@ -1474,7 +1474,7 @@ static int intel_init_ring_buffer(struct drm_device *dev,
 	return ring->init(ring);
 }
 
-void intel_cleanup_ring_buffer(struct intel_engine *ring)
+void intel_cleanup_ring(struct intel_engine *ring)
 {
 	struct drm_i915_private *dev_priv = to_i915(ring->dev);
 	struct intel_ringbuffer *ringbuf = __get_ringbuf(ring);
@@ -1482,7 +1482,7 @@ void intel_cleanup_ring_buffer(struct intel_engine *ring)
 	if (ringbuf->obj == NULL)
 		return;
 
-	intel_stop_ring_buffer(ring);
+	intel_stop_ring(ring);
 	WARN_ON((I915_READ_MODE(ring) & MODE_IDLE) == 0);
 
 	intel_destroy_ring_buffer(ring);
@@ -1925,7 +1925,7 @@ static int gen6_ring_flush(struct intel_engine *ring,
 	return 0;
 }
 
-int intel_init_render_ring_buffer(struct drm_device *dev)
+int intel_init_render_ring(struct drm_device *dev)
 {
 	struct drm_i915_private *dev_priv = dev->dev_private;
 	struct intel_engine *ring = &dev_priv->ring[RCS];
@@ -2028,7 +2028,7 @@ int intel_init_render_ring_buffer(struct drm_device *dev)
 		ring->scratch.gtt_offset = i915_gem_obj_ggtt_offset(obj);
 	}
 
-	return intel_init_ring_buffer(dev, ring);
+	return intel_init_ring(dev, ring);
 }
 
 int intel_render_ring_init_dri(struct drm_device *dev, u64 start, u32 size)
@@ -2095,7 +2095,7 @@ int intel_render_ring_init_dri(struct drm_device *dev, u64 start, u32 size)
 	return 0;
 }
 
-int intel_init_bsd_ring_buffer(struct drm_device *dev)
+int intel_init_bsd_ring(struct drm_device *dev)
 {
 	struct drm_i915_private *dev_priv = dev->dev_private;
 	struct intel_engine *ring = &dev_priv->ring[VCS];
@@ -2159,14 +2159,14 @@ int intel_init_bsd_ring_buffer(struct drm_device *dev)
 	}
 	ring->init = init_ring_common;
 
-	return intel_init_ring_buffer(dev, ring);
+	return intel_init_ring(dev, ring);
 }
 
 /**
  * Initialize the second BSD ring for Broadwell GT3.
  * It is noted that this only exists on Broadwell GT3.
  */
-int intel_init_bsd2_ring_buffer(struct drm_device *dev)
+int intel_init_bsd2_ring(struct drm_device *dev)
 {
 	struct drm_i915_private *dev_priv = dev->dev_private;
 	struct intel_engine *ring = &dev_priv->ring[VCS2];
@@ -2207,10 +2207,10 @@ int intel_init_bsd2_ring_buffer(struct drm_device *dev)
 
 	ring->init = init_ring_common;
 
-	return intel_init_ring_buffer(dev, ring);
+	return intel_init_ring(dev, ring);
 }
 
-int intel_init_blt_ring_buffer(struct drm_device *dev)
+int intel_init_blt_ring(struct drm_device *dev)
 {
 	struct drm_i915_private *dev_priv = dev->dev_private;
 	struct intel_engine *ring = &dev_priv->ring[BCS];
@@ -2252,10 +2252,10 @@ int intel_init_blt_ring_buffer(struct drm_device *dev)
 	ring->semaphore.mbox.signal[VCS2] = GEN6_NOSYNC;
 	ring->init = init_ring_common;
 
-	return intel_init_ring_buffer(dev, ring);
+	return intel_init_ring(dev, ring);
 }
 
-int intel_init_vebox_ring_buffer(struct drm_device *dev)
+int intel_init_vebox_ring(struct drm_device *dev)
 {
 	struct drm_i915_private *dev_priv = dev->dev_private;
 	struct intel_engine *ring = &dev_priv->ring[VECS];
@@ -2292,7 +2292,7 @@ int intel_init_vebox_ring_buffer(struct drm_device *dev)
 	ring->semaphore.mbox.signal[VCS2] = GEN6_NOSYNC;
 	ring->init = init_ring_common;
 
-	return intel_init_ring_buffer(dev, ring);
+	return intel_init_ring(dev, ring);
 }
 
 int
@@ -2334,7 +2334,7 @@ intel_ring_invalidate_all_caches(struct intel_engine *ring)
 }
 
 void
-intel_stop_ring_buffer(struct intel_engine *ring)
+intel_stop_ring(struct intel_engine *ring)
 {
 	int ret;
 
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.h b/drivers/gpu/drm/i915/intel_ringbuffer.h
index 7299bff..c9328fd 100644
--- a/drivers/gpu/drm/i915/intel_ringbuffer.h
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.h
@@ -286,8 +286,8 @@ intel_write_status_page(struct intel_engine *ring,
 #define I915_GEM_HWS_SCRATCH_INDEX	0x30
 #define I915_GEM_HWS_SCRATCH_ADDR (I915_GEM_HWS_SCRATCH_INDEX << MI_STORE_DWORD_INDEX_SHIFT)
 
-void intel_stop_ring_buffer(struct intel_engine *ring);
-void intel_cleanup_ring_buffer(struct intel_engine *ring);
+void intel_stop_ring(struct intel_engine *ring);
+void intel_cleanup_ring(struct intel_engine *ring);
 
 int __must_check intel_ring_begin(struct intel_engine *ring, int n);
 int __must_check intel_ring_cacheline_align(struct intel_engine *ring);
@@ -313,11 +313,11 @@ int intel_ring_flush_all_caches(struct intel_engine *ring);
 int intel_ring_invalidate_all_caches(struct intel_engine *ring);
 
 void intel_init_rings_early(struct drm_device *dev);
-int intel_init_render_ring_buffer(struct drm_device *dev);
-int intel_init_bsd_ring_buffer(struct drm_device *dev);
-int intel_init_bsd2_ring_buffer(struct drm_device *dev);
-int intel_init_blt_ring_buffer(struct drm_device *dev);
-int intel_init_vebox_ring_buffer(struct drm_device *dev);
+int intel_init_render_ring(struct drm_device *dev);
+int intel_init_bsd_ring(struct drm_device *dev);
+int intel_init_bsd2_ring(struct drm_device *dev);
+int intel_init_blt_ring(struct drm_device *dev);
+int intel_init_vebox_ring(struct drm_device *dev);
 
 u64 intel_ring_get_active_head(struct intel_engine *ring);
 void intel_ring_setup_status_page(struct intel_engine *ring);
-- 
1.9.0




More information about the Intel-gfx mailing list