From 6d1d11704ab36e4ee50b2c1d3b984ab6bb691417 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sun, 25 May 2008 20:44:19 -0700 Subject: [intel-gem] Compute npages instead of nbytes in flush_pwrite i915_gem_flush_pwrite optimizes short writes to the buffer by clflushing only the modified pages, but it was miscomputing the number of pages. --- linux-core/i915_gem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'linux-core') diff --git a/linux-core/i915_gem.c b/linux-core/i915_gem.c index c53a39ec..b5c87747 100644 --- a/linux-core/i915_gem.c +++ b/linux-core/i915_gem.c @@ -1523,7 +1523,7 @@ i915_gem_flush_pwrite(struct drm_gem_object *obj, if ((size < obj->size >> 1) && obj_priv->page_list != NULL) { unsigned long first_page = offset / PAGE_SIZE; - unsigned long beyond_page = roundup(offset + size, PAGE_SIZE); + unsigned long beyond_page = roundup(offset + size, PAGE_SIZE) / PAGE_SIZE; drm_ttm_cache_flush(obj_priv->page_list + first_page, beyond_page - first_page); -- cgit v1.2.3