From 674a42e208f0a7a01da7e3b2c128e6cb47c6a61d Mon Sep 17 00:00:00 2001 From: Owain Ainsworth Date: Wed, 28 Apr 2010 00:40:23 +0000 Subject: Deal with a non-incremented iterator by changing a while (condition) { do_stuff() increment_condition /* this was missing */ } To a for loop like it always should have been. I have no idea what I was smoking when I wrote this function. Fixes the crash on hardware that does bit 17 swizzling (turns out the three I know of are all 945s) as soon as we first unbind an object. Thank you very much to Brandon Mercer for actually managing to get me a crash dump so i could debug this, and also for testing the fix. --- sys/dev/pci/drm/i915_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sys/dev/pci/drm/i915_drv.c') diff --git a/sys/dev/pci/drm/i915_drv.c b/sys/dev/pci/drm/i915_drv.c index 7760c2b5ce9..fe8ce3cd507 100644 --- a/sys/dev/pci/drm/i915_drv.c +++ b/sys/dev/pci/drm/i915_drv.c @@ -4591,7 +4591,7 @@ i915_gem_save_bit_17_swizzle(struct drm_obj *obj) segp = &obj_priv->dma_segs[0]; n = 0; i = 0; - while (i < page_count) { + for (i = 0; i < page_count; i++) { if ((segp->ds_addr + (n * PAGE_SIZE)) & (1 << 17)) set_bit(i, obj_priv->bit_17); else -- cgit v1.2.3