summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Pagano <mpagano@gentoo.org>2022-08-31 09:32:29 -0400
committerMike Pagano <mpagano@gentoo.org>2022-08-31 09:32:29 -0400
commitcad5407b6e30efaf8a467c509b29ba5fb67f0cc8 (patch)
treefec0cd4238a3a7fa9245f6de437d9d32e1657546
parentx86/sev: Don't use cc_platform_has() for early SEV-SNP calls (diff)
downloadlinux-patches-cad5407b6e30efaf8a467c509b29ba5fb67f0cc8.tar.gz
linux-patches-cad5407b6e30efaf8a467c509b29ba5fb67f0cc8.tar.bz2
linux-patches-cad5407b6e30efaf8a467c509b29ba5fb67f0cc8.zip
Revert fix from upstream for DRM/i915 thanks to Luigi 'Comio' Mantellini
Bug: https://bugs.gentoo.org/866023 Signed-off-by: Mike Pagano <mpagano@gentoo.org>
-rw-r--r--0000_README4
-rw-r--r--2700_revert-drm-i915-dma-resv-obj-fix.patch107
2 files changed, 111 insertions, 0 deletions
diff --git a/0000_README b/0000_README
index 309b3933..4172ad7c 100644
--- a/0000_README
+++ b/0000_README
@@ -83,6 +83,10 @@ Patch: 2000_BT-Check-key-sizes-only-if-Secure-Simple-Pairing-enabled.patch
From: https://lore.kernel.org/linux-bluetooth/20190522070540.48895-1-marcel@holtmann.org/raw
Desc: Bluetooth: Check key sizes only when Secure Simple Pairing is enabled. See bug #686758
+Patch: 2700_revert-drm-i915-dma-resv-obj-fix.patch
+From: https://bugs.gentoo.org/866023
+Desc: Revert Revert for drm i915 thanks to Luigi 'Comio' Mantellini
+
Patch: 2900_tmp513-Fix-build-issue-by-selecting-CONFIG_REG.patch
From: https://bugs.gentoo.org/710790
Desc: tmp513 requies REGMAP_I2C to build. Select it by default in Kconfig. See bug #710790. Thanks to Phil Stracchino
diff --git a/2700_revert-drm-i915-dma-resv-obj-fix.patch b/2700_revert-drm-i915-dma-resv-obj-fix.patch
new file mode 100644
index 00000000..a9fcaf4a
--- /dev/null
+++ b/2700_revert-drm-i915-dma-resv-obj-fix.patch
@@ -0,0 +1,107 @@
+From d481c481ca7813d688ffcb1c5418b48f83d945c1 Mon Sep 17 00:00:00 2001
+From: Luigi 'Comio' Mantellini <luigi.mantellini@gmail.com>
+Date: Sun, 28 Aug 2022 09:17:35 +0200
+Subject: [PATCH] Revert "drm/i915: Individualize fences before adding to
+ dma_resv obj"
+
+This reverts commit 842d9346b2fdda4d2fb8ccb5b87faef1ac01ab51.
+---
+ .../gpu/drm/i915/gem/i915_gem_execbuffer.c | 3 +-
+ drivers/gpu/drm/i915/i915_vma.c | 48 ++++++++-----------
+ 2 files changed, 21 insertions(+), 30 deletions(-)
+
+diff --git a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
+index 30fe847c6664..c326bd2b444f 100644
+--- a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
++++ b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
+@@ -999,8 +999,7 @@ static int eb_validate_vmas(struct i915_execbuffer *eb)
+ }
+ }
+
+- /* Reserve enough slots to accommodate composite fences */
+- err = dma_resv_reserve_fences(vma->obj->base.resv, eb->num_batches);
++ err = dma_resv_reserve_fences(vma->obj->base.resv, 1);
+ if (err)
+ return err;
+
+diff --git a/drivers/gpu/drm/i915/i915_vma.c b/drivers/gpu/drm/i915/i915_vma.c
+index 16460b169ed2..e71826f0e4b1 100644
+--- a/drivers/gpu/drm/i915/i915_vma.c
++++ b/drivers/gpu/drm/i915/i915_vma.c
+@@ -23,7 +23,6 @@
+ */
+
+ #include <linux/sched/mm.h>
+-#include <linux/dma-fence-array.h>
+ #include <drm/drm_gem.h>
+
+ #include "display/intel_frontbuffer.h"
+@@ -1839,21 +1838,6 @@ int _i915_vma_move_to_active(struct i915_vma *vma,
+ if (unlikely(err))
+ return err;
+
+- /*
+- * Reserve fences slot early to prevent an allocation after preparing
+- * the workload and associating fences with dma_resv.
+- */
+- if (fence && !(flags & __EXEC_OBJECT_NO_RESERVE)) {
+- struct dma_fence *curr;
+- int idx;
+-
+- dma_fence_array_for_each(curr, idx, fence)
+- ;
+- err = dma_resv_reserve_fences(vma->obj->base.resv, idx);
+- if (unlikely(err))
+- return err;
+- }
+-
+ if (flags & EXEC_OBJECT_WRITE) {
+ struct intel_frontbuffer *front;
+
+@@ -1863,23 +1847,31 @@ int _i915_vma_move_to_active(struct i915_vma *vma,
+ i915_active_add_request(&front->write, rq);
+ intel_frontbuffer_put(front);
+ }
+- }
+
+- if (fence) {
+- struct dma_fence *curr;
+- enum dma_resv_usage usage;
+- int idx;
++ if (!(flags & __EXEC_OBJECT_NO_RESERVE)) {
++ err = dma_resv_reserve_fences(vma->obj->base.resv, 1);
++ if (unlikely(err))
++ return err;
++ }
+
+- obj->read_domains = 0;
+- if (flags & EXEC_OBJECT_WRITE) {
+- usage = DMA_RESV_USAGE_WRITE;
++ if (fence) {
++ dma_resv_add_fence(vma->obj->base.resv, fence,
++ DMA_RESV_USAGE_WRITE);
+ obj->write_domain = I915_GEM_DOMAIN_RENDER;
+- } else {
+- usage = DMA_RESV_USAGE_READ;
++ obj->read_domains = 0;
++ }
++ } else {
++ if (!(flags & __EXEC_OBJECT_NO_RESERVE)) {
++ err = dma_resv_reserve_fences(vma->obj->base.resv, 1);
++ if (unlikely(err))
++ return err;
+ }
+
+- dma_fence_array_for_each(curr, idx, fence)
+- dma_resv_add_fence(vma->obj->base.resv, curr, usage);
++ if (fence) {
++ dma_resv_add_fence(vma->obj->base.resv, fence,
++ DMA_RESV_USAGE_READ);
++ obj->write_domain = 0;
++ }
+ }
+
+ if (flags & EXEC_OBJECT_NEEDS_FENCE && vma->fence)
+--
+2.37.2
+