Commit 3df2c830 authored by Matthew Auld's avatar Matthew Auld Committed by Chris Wilson

drm/i915/blt: fixup block_size rounding

There is nothing to say that the obj->base.size is actually a multiple
of the block_size.

v2: Use round_up() as block_size is a power-of-two
Reported-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: default avatarMatthew Auld <matthew.auld@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20191028220325.9325-1-chris@chris-wilson.co.uk
parent 953d57eb
...@@ -30,7 +30,7 @@ struct i915_vma *intel_emit_vma_fill_blt(struct intel_context *ce, ...@@ -30,7 +30,7 @@ struct i915_vma *intel_emit_vma_fill_blt(struct intel_context *ce,
GEM_BUG_ON(intel_engine_is_virtual(ce->engine)); GEM_BUG_ON(intel_engine_is_virtual(ce->engine));
intel_engine_pm_get(ce->engine); intel_engine_pm_get(ce->engine);
count = div_u64(vma->size, block_size); count = div_u64(round_up(vma->size, block_size), block_size);
size = (1 + 8 * count) * sizeof(u32); size = (1 + 8 * count) * sizeof(u32);
size = round_up(size, PAGE_SIZE); size = round_up(size, PAGE_SIZE);
pool = intel_engine_get_pool(ce->engine, size); pool = intel_engine_get_pool(ce->engine, size);
...@@ -214,7 +214,7 @@ struct i915_vma *intel_emit_vma_copy_blt(struct intel_context *ce, ...@@ -214,7 +214,7 @@ struct i915_vma *intel_emit_vma_copy_blt(struct intel_context *ce,
GEM_BUG_ON(intel_engine_is_virtual(ce->engine)); GEM_BUG_ON(intel_engine_is_virtual(ce->engine));
intel_engine_pm_get(ce->engine); intel_engine_pm_get(ce->engine);
count = div_u64(dst->size, block_size); count = div_u64(round_up(dst->size, block_size), block_size);
size = (1 + 11 * count) * sizeof(u32); size = (1 + 11 * count) * sizeof(u32);
size = round_up(size, PAGE_SIZE); size = round_up(size, PAGE_SIZE);
pool = intel_engine_get_pool(ce->engine, size); pool = intel_engine_get_pool(ce->engine, size);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment