[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.
main
Keith Packard 2008-05-25 20:44:19 -07:00
parent c69b81df62
commit 6d1d11704a
1 changed files with 1 additions and 1 deletions

View File

@ -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);