Skip to contentSkip to conversation

drm/i915/gtt: reduce overzealous alignment constraints for GGTT

PATCH New Matthew Auld 2 participants 5 messages Mar 1, 2022

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

PATCH 1/3 drm/i915/gtt: reduce overzealous alignment constraints for GGTT

The 2M alignment should only be needed for the ppGTT, when dealing with platforms like DG2. When dealing with the GGTT we can safely limit to 64K.

Cc Stanislav Lisovskiy <[email protected]>
Cc Thomas Hellström <[email protected]>
Cc Robert Beckett <[email protected]>
---
 drivers/gpu/drm/i915/gt/intel_gtt.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/gt/intel_gtt.c +2 -1
index 4bcdfcab3642..a5f5b2dda332 100644
@@ -234,7 +234,8 @@ void i915_address_space_init(struct i915_address_space *vm, int subclass)
 	memset64(vm->min_alignment, I915_GTT_MIN_ALIGNMENT,
 		 ARRAY_SIZE(vm->min_alignment));
 
-	if (HAS_64K_PAGES(vm->i915) && NEEDS_COMPACT_PT(vm->i915)) {
+	if (HAS_64K_PAGES(vm->i915) && NEEDS_COMPACT_PT(vm->i915) &&
+	    subclass == VM_CLASS_PPGTT) {
 		vm->min_alignment[INTEL_MEMORY_LOCAL] = I915_GTT_PAGE_SIZE_2M;
 		vm->min_alignment[INTEL_MEMORY_STOLEN_LOCAL] = I915_GTT_PAGE_SIZE_2M;
 	} else if (HAS_64K_PAGES(vm->i915)) {
Signature · 1 line
2.34.1
#1 lore raw

PATCH 2/3 drm/i915/fbdev: fixup setting screen_size

Since we are actually mapping the object and not the vma, when dealing with LMEM, we should be careful and use the obj->base.size here, since the vma could have all kinds of funny padding constraints.

Cc Stanislav Lisovskiy <[email protected]>
---
 drivers/gpu/drm/i915/display/intel_fbdev.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/display/intel_fbdev.c +4 -1
index 2cd62a187df3..3167ae334684 100644
@@ -290,7 +290,10 @@ static int intelfb_create(struct drm_fb_helper *helper,
 		goto out_unpin;
 	}
 	info->screen_base = vaddr;
-	info->screen_size = vma->node.size;
+	if (i915_gem_object_is_lmem(obj))
+		info->screen_size = vma->obj->base.size;
+	else
+		info->screen_size = vma->node.size;
 
 	drm_fb_helper_fill_info(info, &ifbdev->helper, sizes);
 
Signature · 1 line
2.34.1
#2 lore raw

PATCH 3/3 drm/i915: Use i915_gem_object_pin_map_unlocked function for lmem allocation

In reply to Matthew Auld

From: Stanislav Lisovskiy <[email protected]>

Using i915_gem_object_pin_map_unlocked instead of i915_gem_object_lmem_io_map, would eliminate the need of using I915_BO_ALLOC_CONTIGUOUS, when calling i915_vma_pin_iomap, because it supports non-contiguous allocation as well.

---
 drivers/gpu/drm/i915/i915_vma.c | 27 ++++++++++++++++++++-------
 1 file changed, 20 insertions(+), 7 deletions(-)
drivers/gpu/drm/i915/i915_vma.c +20 -7
index 94fcdb7bd21d..c3bfa1312507 100644
@@ -562,10 +562,16 @@ void __iomem *i915_vma_pin_iomap(struct i915_vma *vma)
 		 * of pages, that way we can also drop the
 		 * I915_BO_ALLOC_CONTIGUOUS when allocating the object.
 		 */
-		if (i915_gem_object_is_lmem(vma->obj))
-			ptr = i915_gem_object_lmem_io_map(vma->obj, 0,
-							  vma->obj->base.size);
-		else
+		if (i915_gem_object_is_lmem(vma->obj)) {
+			ptr = (void __iomem *)
+			       i915_gem_object_pin_map_unlocked(vma->obj,
+								I915_MAP_WC);
+			if (IS_ERR(ptr)) {
+				err = PTR_ERR(ptr);
+				goto err;
+			}
+			ptr = page_pack_bits(ptr, 1);
+		} else
 			ptr = io_mapping_map_wc(&i915_vm_to_ggtt(vma->vm)->iomap,
 						vma->node.start,
 						vma->node.size);
@@ -575,7 +581,10 @@ void __iomem *i915_vma_pin_iomap(struct i915_vma *vma)
 		}
 
 		if (unlikely(cmpxchg(&vma->iomap, NULL, ptr))) {
-			io_mapping_unmap(ptr);
+			if (page_unmask_bits(ptr))
+				__i915_gem_object_release_map(vma->obj);
+			else
+				io_mapping_unmap(ptr);
 			ptr = vma->iomap;
 		}
 	}
@@ -589,7 +598,7 @@ void __iomem *i915_vma_pin_iomap(struct i915_vma *vma)
 	i915_vma_set_ggtt_write(vma);
 
 	/* NB Access through the GTT requires the device to be awake. */
-	return ptr;
+	return page_mask_bits(ptr);
 
 err_unpin:
 	__i915_vma_unpin(vma);
@@ -1748,7 +1757,11 @@ static void __i915_vma_iounmap(struct i915_vma *vma)
 	if (vma->iomap == NULL)
 		return;
 
-	io_mapping_unmap(vma->iomap);
+	if (page_unmask_bits(vma->iomap))
+		__i915_gem_object_release_map(vma->obj);
+	else
+		io_mapping_unmap(vma->iomap);
+
 	vma->iomap = NULL;
 }
 
Signature · 1 line
2.34.1
#3 lore raw

[Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for series starting with [CI,1/3] drm/i915/gtt: reduce overzealous alignment constraints for GGTT

In reply to Matthew Auld
== Series Details ==

== Series Details ==

Series: series starting with [CI,1/3] drm/i915/gtt: reduce overzealous alignment constraints for GGTT
URL : https://patchwork.freedesktop.org/series/100898/
State : warning

== Summary ==

$ dim checkpatch origin/drm-tip
61b713195d33 drm/i915/gtt: reduce overzealous alignment constraints for GGTT
4144e1582c9f drm/i915/fbdev: fixup setting screen_size
5ba0a226203a drm/i915: Use i915_gem_object_pin_map_unlocked function for lmem allocation
-:36: CHECK:BRACES: Unbalanced braces around else statement
#36: FILE: drivers/gpu/drm/i915/i915_vma.c:574:
+		} else

total: 0 errors, 0 warnings, 1 checks, 51 lines checked

#4 lore raw

[Intel-gfx] ✗ Fi.CI.BAT: failure for series starting with [CI,1/3] drm/i915/gtt: reduce overzealous alignment constraints for GGTT

In reply to Matthew Auld
== Series Details ==

== Series Details ==

Series: series starting with [CI,1/3] drm/i915/gtt: reduce overzealous alignment constraints for GGTT
URL : https://patchwork.freedesktop.org/series/100898/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_11306 -> Patchwork_22449
====================================================

Summary
-------

**FAILURE**

Serious unknown changes coming with Patchwork_22449 absolutely need to be verified manually.

If you think the reported changes have nothing to do with the changes introduced in Patchwork_22449, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.

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

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

Missing (8): fi-kbl-soraka shard-tglu fi-hsw-4200u fi-bsw-cyan fi-ctg-p8600 fi-pnv-d510 bat-jsl-2 fi-bdw-samus

Possible new issues
-------------------

Here are the unknown changes that may have been introduced in Patchwork_22449:

### IGT changes ###

#### Possible regressions ####

* igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a:
- fi-cml-u2: [PASS][1] -> [INCOMPLETE][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11306/fi-cml-u2/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22449/fi-cml-u2/igt@[email protected]

#### Suppressed ####

The following results come from untrusted machines, tests, or statuses. They do not affect the overall result.

* igt@kms_busy@basic@flip:
- {bat-dg2-9}: [INCOMPLETE][3] ([i915#5194]) -> [INCOMPLETE][4]
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11306/bat-dg2-9/igt@kms_busy@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22449/bat-dg2-9/igt@kms_busy@[email protected]

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

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

### IGT changes ###

#### Issues hit ####

* igt@gem_flink_basic@bad-flink:
- fi-skl-6600u: [PASS][5] -> [FAIL][6] ([i915#4547])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11306/fi-skl-6600u/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22449/fi-skl-6600u/igt@[email protected]

* igt@gem_lmem_swapping@random-engines:
- fi-ivb-3770: NOTRUN -> [SKIP][7] ([fdo#109271]) +35 similar issues
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22449/fi-ivb-3770/igt@[email protected]

* igt@i915_selftest@live@hangcheck:
- bat-dg1-5: [PASS][8] -> [DMESG-FAIL][9] ([i915#4494] / [i915#4957])
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11306/bat-dg1-5/igt@i915_selftest@[email protected]
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22449/bat-dg1-5/igt@i915_selftest@[email protected]

* igt@kms_chamelium@dp-hpd-fast:
- fi-ivb-3770: NOTRUN -> [SKIP][10] ([fdo#109271] / [fdo#111827]) +8 similar issues
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22449/fi-ivb-3770/igt@[email protected]

* igt@kms_pipe_crc_basic@read-crc-pipe-c:
- bat-adlp-4: [PASS][11] -> [DMESG-WARN][12] ([i915#3576])
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11306/bat-adlp-4/igt@[email protected]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22449/bat-adlp-4/igt@[email protected]

#### Possible fixes ####

* igt@core_hotunplug@unbind-rebind:
- fi-blb-e6850: [FAIL][13] ([i915#3194]) -> [PASS][14]
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11306/fi-blb-e6850/igt@[email protected]
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22449/fi-blb-e6850/igt@[email protected]

* igt@fbdev@eof:
- {bat-dg2-9}: [FAIL][15] ([i915#5186]) -> [PASS][16]
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11306/bat-dg2-9/igt@[email protected]
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22449/bat-dg2-9/igt@[email protected]

* igt@i915_selftest@live@gt_pm:
- {fi-jsl-1}: [DMESG-FAIL][17] ([i915#1886]) -> [PASS][18]
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11306/fi-jsl-1/igt@i915_selftest@live@gt_pm.html
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22449/fi-jsl-1/igt@i915_selftest@live@gt_pm.html

#### Warnings ####

* igt@i915_selftest@live@hangcheck:
- fi-hsw-4770: [INCOMPLETE][19] ([i915#3303]) -> [INCOMPLETE][20] ([i915#4785])
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11306/fi-hsw-4770/igt@i915_selftest@[email protected]
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22449/fi-hsw-4770/igt@i915_selftest@[email protected]

* igt@runner@aborted:
- fi-skl-6600u: [FAIL][21] ([i915#1436] / [i915#4312]) -> [FAIL][22] ([i915#4312])
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11306/fi-skl-6600u/igt@[email protected]
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22449/fi-skl-6600u/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#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#111827]: https://bugs.freedesktop.org/show_bug.cgi?id=111827
[i915#1436]: https://gitlab.freedesktop.org/drm/intel/issues/1436
[i915#1886]: https://gitlab.freedesktop.org/drm/intel/issues/1886
[i915#3194]: https://gitlab.freedesktop.org/drm/intel/issues/3194
[i915#3303]: https://gitlab.freedesktop.org/drm/intel/issues/3303
[i915#3576]: https://gitlab.freedesktop.org/drm/intel/issues/3576
[i915#4312]: https://gitlab.freedesktop.org/drm/intel/issues/4312
[i915#4494]: https://gitlab.freedesktop.org/drm/intel/issues/4494
[i915#4547]: https://gitlab.freedesktop.org/drm/intel/issues/4547
[i915#4785]: https://gitlab.freedesktop.org/drm/intel/issues/4785
[i915#4957]: https://gitlab.freedesktop.org/drm/intel/issues/4957
[i915#5186]: https://gitlab.freedesktop.org/drm/intel/issues/5186
[i915#5194]: https://gitlab.freedesktop.org/drm/intel/issues/5194

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

* Linux: CI_DRM_11306 -> Patchwork_22449

CI-20190529: 20190529
CI_DRM_11306: 0eb492df610222f39eb2ad5a903626dd3ad9aea2 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_6361: 2372a4beb6a33c5f0799a4a8ccbb93794f52dbca @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
Patchwork_22449: 5ba0a226203a591fd784e820075855f68fc3b157 @ git://anongit.freedesktop.org/gfx-ci/linux

== Linux commits ==

5ba0a226203a drm/i915: Use i915_gem_object_pin_map_unlocked function for lmem allocation 4144e1582c9f drm/i915/fbdev: fixup setting screen_size
61b713195d33 drm/i915/gtt: reduce overzealous alignment constraints for GGTT

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22449/index.html