[Intel-gfx] [PATCH] drm/i915: Reject fence stride=0 on gen4+

ville.syrjala at linux.intel.com ville.syrjala at linux.intel.com
Tue Apr 9 16:46:45 CEST 2013


From: Ville Syrjälä <ville.syrjala at linux.intel.com>

Our checks for an invalid fence stride forgot to guard against
zero stride on gen4+. Fix it.

Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
---
 drivers/gpu/drm/i915/i915_gem_tiling.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_gem_tiling.c b/drivers/gpu/drm/i915/i915_gem_tiling.c
index 139d17d..16ff6e7 100644
--- a/drivers/gpu/drm/i915/i915_gem_tiling.c
+++ b/drivers/gpu/drm/i915/i915_gem_tiling.c
@@ -240,6 +240,8 @@ i915_tiling_ok(struct drm_device *dev, int stride, int size, int tiling_mode)
 
 	/* 965+ just needs multiples of tile width */
 	if (INTEL_INFO(dev)->gen >= 4) {
+		if (stride < tile_width)
+			return false;
 		if (stride & (tile_width - 1))
 			return false;
 		return true;
-- 
1.8.1.5




More information about the Intel-gfx mailing list