summaryrefslogtreecommitdiff
path: root/linux-core
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2008-05-25 20:44:19 -0700
committerKeith Packard <keithp@keithp.com>2008-05-25 20:44:19 -0700
commit6d1d11704ab36e4ee50b2c1d3b984ab6bb691417 (patch)
treed723c4f4259009cef3ecf3fb106b15947bf5bcbf /linux-core
parentc69b81df62cb7e04f956f2cf77091216754c3632 (diff)
[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.
Diffstat (limited to 'linux-core')
-rw-r--r--linux-core/i915_gem.c2
1 files changed, 1 insertions, 1 deletions
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);