All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] RFC: i915: Drop relocation support on Gen12+
@ 2020-05-07 15:36 ` Jason Ekstrand
  0 siblings, 0 replies; 64+ messages in thread
From: Jason Ekstrand @ 2020-05-07 15:36 UTC (permalink / raw)
  To: intel-gfx, dri-devel
  Cc: Dave Airlie, Chris Wilson, Jason Ekstrand, Daniel Vetter

The Vulkan driver in Mesa for Intel hardware never uses relocations if
it's running on a version of i915 that supports at least softpin which
all versions of i915 supporting Gen12 do.  On the OpenGL side, Gen12 is
only supported by iris which never uses relocations.  The older i965
driver in Mesa does use relocations but it only supports Intel hardware
through Gen11 and has been deprecated for all hardware Gen9+. The entire
relocation UAPI and related infrastructure, therefore, doesn't have any
open-source userspace consumer starting with Gen12.

Rejecting relocations starting with Gen12 has the benefit that we don't
have to bother supporting it on platforms with local memory.  Given how
much CPU touching of memory is required for relocations, not having to
do so on platforms where not all memory is directly CPU-accessible
carries significant advantages.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Cc: Dave Airlie <airlied@redhat.com>
Cc: Daniel Vetter <daniel.vetter@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
index 4f9c1f5a4dedb..e10c93aff945d 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
@@ -1533,7 +1533,8 @@ eb_relocate_vma_slow(struct i915_execbuffer *eb, struct i915_vma *vma)
 	return err;
 }
 
-static int check_relocations(const struct drm_i915_gem_exec_object2 *entry)
+static int check_relocations(const struct i915_execbuffer *eb,
+			     const struct drm_i915_gem_exec_object2 *entry)
 {
 	const char __user *addr, *end;
 	unsigned long size;
@@ -1543,6 +1544,9 @@ static int check_relocations(const struct drm_i915_gem_exec_object2 *entry)
 	if (size == 0)
 		return 0;
 
+	if (size && eb->reloc_cache.gen >= 12)
+		return -EINVAL;
+
 	if (size > N_RELOC(ULONG_MAX))
 		return -EINVAL;
 
@@ -1576,7 +1580,7 @@ static int eb_copy_relocations(const struct i915_execbuffer *eb)
 		if (nreloc == 0)
 			continue;
 
-		err = check_relocations(&eb->exec[i]);
+		err = check_relocations(eb, &eb->exec[i]);
 		if (err)
 			goto err;
 
-- 
2.26.2

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 64+ messages in thread

end of thread, other threads:[~2021-03-12 15:20 UTC | newest]

Thread overview: 64+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-07 15:36 [PATCH] RFC: i915: Drop relocation support on Gen12+ Jason Ekstrand
2020-05-07 15:36 ` [Intel-gfx] " Jason Ekstrand
2020-05-07 15:44 ` Chris Wilson
2020-05-07 15:44   ` [Intel-gfx] " Chris Wilson
2020-05-07 16:00   ` Jason Ekstrand
2020-05-07 16:00     ` [Intel-gfx] " Jason Ekstrand
2020-05-07 18:27   ` Dave Airlie
2020-05-07 18:27     ` [Intel-gfx] " Dave Airlie
2020-05-08  5:58     ` Joonas Lahtinen
2020-05-08  5:58       ` [Intel-gfx] " Joonas Lahtinen
2020-06-25 17:22       ` Dave Airlie
2020-06-25 17:22         ` [Intel-gfx] " Dave Airlie
2020-05-07 16:27 ` [Intel-gfx] ✗ Fi.CI.BUILD: failure for " Patchwork
2021-03-10 21:26 ` [PATCH] i915: Drop relocation support on all new hardware Jason Ekstrand
2021-03-10 21:26   ` [Intel-gfx] " Jason Ekstrand
2021-03-10 21:50   ` [PATCH] i915: Drop relocation support on all new hardware (v3) Jason Ekstrand
2021-03-10 21:50     ` [Intel-gfx] " Jason Ekstrand
2021-03-10 22:56     ` Jason Ekstrand
2021-03-10 22:56       ` [Intel-gfx] " Jason Ekstrand
2021-03-11  8:14     ` Lucas De Marchi
2021-03-11  8:14       ` Lucas De Marchi
2021-03-11 10:20       ` Matthew Auld
2021-03-11 10:20         ` Matthew Auld
2021-03-11  9:54     ` Tvrtko Ursulin
2021-03-11  9:54       ` Tvrtko Ursulin
2021-03-11 11:44     ` Zbigniew Kempczyński
2021-03-11 11:44       ` [Intel-gfx] " Zbigniew Kempczyński
2021-03-11 15:50       ` Jason Ekstrand
2021-03-11 15:50         ` [Intel-gfx] " Jason Ekstrand
2021-03-11 15:57         ` Daniel Vetter
2021-03-11 15:57           ` [Intel-gfx] " Daniel Vetter
2021-03-11 16:24           ` Jason Ekstrand
2021-03-11 16:24             ` [Intel-gfx] " Jason Ekstrand
2021-03-11 16:50             ` Zbigniew Kempczyński
2021-03-11 16:50               ` [Intel-gfx] " Zbigniew Kempczyński
2021-03-11 17:18               ` Jason Ekstrand
2021-03-11 17:18                 ` [Intel-gfx] " Jason Ekstrand
2021-03-11 18:19                 ` Zbigniew Kempczyński
2021-03-11 18:19                   ` [Intel-gfx] " Zbigniew Kempczyński
2021-03-11 18:57                   ` Jason Ekstrand
2021-03-11 18:57                     ` [Intel-gfx] " Jason Ekstrand
2021-03-12 14:16                     ` Daniel Vetter
2021-03-12 14:16                       ` [Intel-gfx] " Daniel Vetter
2021-03-11 16:31       ` Chris Wilson
2021-03-11 16:31         ` [Intel-gfx] " Chris Wilson
2021-03-11 16:40         ` Jason Ekstrand
2021-03-11 16:40           ` [Intel-gfx] " Jason Ekstrand
2021-03-11 16:26     ` [PATCH] drm/i915/gem: Drop relocation support on all new hardware (v4) Jason Ekstrand
2021-03-11 18:17     ` [Intel-gfx] " Jason Ekstrand
2021-03-12  9:28       ` Zbigniew Kempczyński
2021-03-12  9:50       ` Tvrtko Ursulin
2021-03-12 10:56         ` Matthew Auld
2021-03-12 11:33           ` Maarten Lankhorst
2021-03-12 11:52             ` Tvrtko Ursulin
2021-03-12 11:47           ` Tvrtko Ursulin
2021-03-12 12:16             ` Matthew Auld
2021-03-12 14:52               ` Jason Ekstrand
2021-03-12 15:20                 ` Tvrtko Ursulin
2021-03-10 21:42 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for RFC: i915: Drop relocation support on Gen12+ (rev2) Patchwork
2021-03-10 22:11 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2021-03-10 23:47 ` [Intel-gfx] ✓ Fi.CI.BAT: success for RFC: i915: Drop relocation support on Gen12+ (rev3) Patchwork
2021-03-11  2:32 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2021-03-11 18:41 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for RFC: i915: Drop relocation support on Gen12+ (rev4) Patchwork
2021-03-11 19:10 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.