Skip to contentSkip to conversation

drm/i915/blt: fixup block_size rounding

PATCH In review Matthew Auld 4 participants 4 messages Oct 28, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 drivers/gpu/drm/i915/gem/i915_gem_object_blt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/gem/i915_gem_object_blt.c +2 -2
index 516e61e99212..5597f1345a63 100644
@@ -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));
 	intel_engine_pm_get(ce->engine);
 
-	count = div_u64(vma->size, block_size);
+	count = DIV64_U64_ROUND_UP(vma->size, block_size);
 	size = (1 + 8 * count) * sizeof(u32);
 	size = round_up(size, PAGE_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,
 	GEM_BUG_ON(intel_engine_is_virtual(ce->engine));
 	intel_engine_pm_get(ce->engine);
 
-	count = div_u64(dst->size, block_size);
+	count = DIV64_U64_ROUND_UP(dst->size, block_size);
 	size = (1 + 11 * count) * sizeof(u32);
 	size = round_up(size, PAGE_SIZE);
 	pool = intel_engine_get_pool(ce->engine, size);
Signature · 6 lines
2.20.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw
Quoted 15 lines · Matthew Auld

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

---
 drivers/gpu/drm/i915/gem/i915_gem_object_blt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/gem/i915_gem_object_blt.c +0 -0
index 516e61e99212..5597f1345a63 100644

drivers/gpu/drm/i915/gem/i915_gem_object_blt.c struct i915_vma *intel_emit_vma_fill_blt(struct intel_context *ce, · line 33

Quoted 5 lines
drivers/gpu/drm/i915/gem/i915_gem_object_blt.c +1 -1
@@ -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));
 	intel_engine_pm_get(ce->engine);
 
-	count = div_u64(vma->size, block_size);
+	count = DIV64_U64_ROUND_UP(vma->size, block_size);

block_size size look to be u32?

Quoted 19 lines
drivers/gpu/drm/i915/gem/i915_gem_object_blt.c +1 -1
 	size = (1 + 8 * count) * sizeof(u32);
 	size = round_up(size, PAGE_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,
 	GEM_BUG_ON(intel_engine_is_virtual(ce->engine));
 	intel_engine_pm_get(ce->engine);
 
-	count = div_u64(dst->size, block_size);
+	count = DIV64_U64_ROUND_UP(dst->size, block_size);
 	size = (1 + 11 * count) * sizeof(u32);
 	size = round_up(size, PAGE_SIZE);
 	pool = intel_engine_get_pool(ce->engine, size);
Signature · 6 lines
2.20.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 6 lines
Ville Syrjälä
Intel
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#2 lore raw

Quoting Ville Syrjälä (2019-10-28 16:46:46)

Quoted 19 lines · Matthew Auld
Quoted 18 lines

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

---
 drivers/gpu/drm/i915/gem/i915_gem_object_blt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/gem/i915_gem_object_blt.c +0 -0
index 516e61e99212..5597f1345a63 100644
@@ -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));
      intel_engine_pm_get(ce->engine);
 
Quoted 4 lines

drivers/gpu/drm/i915/gem/i915_gem_object_blt.c struct i915_vma *intel_emit_vma_fill_blt(struct intel_context *ce, · line 33

Quoted 2 lines
drivers/gpu/drm/i915/gem/i915_gem_object_blt.c +1 -1
-     count = div_u64(vma->size, block_size);
+     count = DIV64_U64_ROUND_UP(vma->size, block_size);

block_size size look to be u32?

And we can control it to be a pot.
-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#3 lore raw

✓ Fi.CI.BAT: success for drm/i915/blt: fixup block_size rounding

In reply to Matthew Auld
== Series Details ==

== Series Details ==

Series: drm/i915/blt: fixup block_size rounding
URL : https://patchwork.freedesktop.org/series/68670/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_7204 -> Patchwork_15028
====================================================

Summary
-------

**SUCCESS**

No regressions found.

External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15028/index.html

Known issues
------------

Here are the changes found in Patchwork_15028 that come from known issues:

### IGT changes ###

#### Issues hit ####

* igt@gem_ctx_create@basic-files:
- fi-apl-guc: [PASS][1] -> [INCOMPLETE][2] ([fdo#103927])
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7204/fi-apl-guc/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15028/fi-apl-guc/igt@[email protected]

* igt@gem_mmap@basic-small-bo:
- fi-icl-u3: [PASS][3] -> [DMESG-WARN][4] ([fdo#107724])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7204/fi-icl-u3/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15028/fi-icl-u3/igt@[email protected]

#### Possible fixes ####

* igt@gem_mmap_gtt@basic:
- fi-icl-u3: [DMESG-WARN][5] ([fdo#107724]) -> [PASS][6] +1 similar issue
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7204/fi-icl-u3/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15028/fi-icl-u3/igt@[email protected]

{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).

[fdo#103927]: https://bugs.freedesktop.org/show_bug.cgi?id=103927
[fdo#107713]: https://bugs.freedesktop.org/show_bug.cgi?id=107713
[fdo#107724]: https://bugs.freedesktop.org/show_bug.cgi?id=107724

Participating hosts (50 -> 42)
------------------------------

Additional (1): fi-kbl-soraka
Missing (9): fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-icl-u2 fi-bsw-cyan fi-icl-y fi-tgl-y fi-byt-clapper fi-bdw-samus

Build changes
-------------

* CI: CI-20190529 -> None
* Linux: CI_DRM_7204 -> Patchwork_15028

CI-20190529: 20190529
CI_DRM_7204: 2ec2c26b76ebf320dfecf692a928ed85797dc6b9 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5248: 81e55f1f97d73e48f00caa7e4fb98295023c5afa @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_15028: e8c18c56739789adcdb63d279683f7b49c9563b3 @ git://anongit.freedesktop.org/gfx-ci/linux

== Linux commits ==

e8c18c567397 drm/i915/blt: fixup block_size rounding

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15028/index.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx