[Intel-gfx] [PATCH 05/66] drm/i915: Don't clear gtt with 0 entries

Ben Widawsky ben at bwidawsk.net
Fri Jun 28 01:30:06 CEST 2013


This will help keep the next patch cleaner which will conditionally clear
the guard page, and use 0 num_entries when not actually clear space for
guard page.

Signed-off-by: Ben Widawsky <ben at bwidawsk.net>
---
 drivers/gpu/drm/i915/i915_gem_gtt.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
index 216e7a1..0fce8d0 100644
--- a/drivers/gpu/drm/i915/i915_gem_gtt.c
+++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
@@ -516,6 +516,9 @@ static void gen6_ggtt_clear_range(struct drm_device *dev,
 	const int max_entries = gtt_total_entries(dev_priv->gtt) - first_entry;
 	int i;
 
+	if (num_entries == 0)
+		return;
+
 	if (WARN(num_entries > max_entries,
 		 "First entry = %d; Num entries = %d (max=%d)\n",
 		 first_entry, num_entries, max_entries))
@@ -546,6 +549,9 @@ static void i915_ggtt_clear_range(struct drm_device *dev,
 				  unsigned int first_entry,
 				  unsigned int num_entries)
 {
+	if (num_entries == 0)
+		return;
+
 	intel_gtt_clear_range(first_entry, num_entries);
 }
 
-- 
1.8.3.1




More information about the Intel-gfx mailing list