Skip to content

Commit ce13c78

Browse files
committed
drm/i915: Disable gpu relocations
Media userspace was the last userspace to still use them, and they converted now too: intel/media-driver@144020c This means no reason anymore to make relocations faster than they've been for the first 9 years of gem. This code was added in commit 7dd4f67 Author: Chris Wilson <[email protected]> Date: Fri Jun 16 15:05:24 2017 +0100 drm/i915: Async GPU relocation processing Furthermore there's pretty strong indications it's buggy, since the code to use it by default as the only option had to be reverted: commit ad5d95e Author: Dave Airlie <[email protected]> Date: Tue Sep 8 15:41:17 2020 +1000 Revert "drm/i915/gem: Async GPU relocations only" This code just disables gpu relocations, leaving the garbage collection for later patches and more importantly, much less confusing diff. Also given how much headaches this code has caused in the past, letting this soak for a bit seems justified. Acked-by: Dave Airlie <[email protected]> Reviewed-by: Maarten Lankhorst <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Cc: Jon Bloomfield <[email protected]> Cc: Chris Wilson <[email protected]> Cc: Maarten Lankhorst <[email protected]> Cc: Joonas Lahtinen <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: "Thomas Hellström" <[email protected]> Cc: Matthew Auld <[email protected]> Cc: Lionel Landwerlin <[email protected]> Cc: Dave Airlie <[email protected]> Cc: Jason Ekstrand <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent ab49840 commit ce13c78

File tree

1 file changed

+18
-25
lines changed

1 file changed

+18
-25
lines changed

drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c

Lines changed: 18 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1577,7 +1577,7 @@ static int __reloc_entry_gpu(struct i915_execbuffer *eb,
15771577
return true;
15781578
}
15791579

1580-
static int reloc_entry_gpu(struct i915_execbuffer *eb,
1580+
static int __maybe_unused reloc_entry_gpu(struct i915_execbuffer *eb,
15811581
struct i915_vma *vma,
15821582
u64 offset,
15831583
u64 target_addr)
@@ -1599,32 +1599,25 @@ relocate_entry(struct i915_vma *vma,
15991599
{
16001600
u64 target_addr = relocation_target(reloc, target);
16011601
u64 offset = reloc->offset;
1602-
int reloc_gpu = reloc_entry_gpu(eb, vma, offset, target_addr);
1603-
1604-
if (reloc_gpu < 0)
1605-
return reloc_gpu;
1606-
1607-
if (!reloc_gpu) {
1608-
bool wide = eb->reloc_cache.use_64bit_reloc;
1609-
void *vaddr;
1602+
bool wide = eb->reloc_cache.use_64bit_reloc;
1603+
void *vaddr;
16101604

16111605
repeat:
1612-
vaddr = reloc_vaddr(vma->obj, eb,
1613-
offset >> PAGE_SHIFT);
1614-
if (IS_ERR(vaddr))
1615-
return PTR_ERR(vaddr);
1616-
1617-
GEM_BUG_ON(!IS_ALIGNED(offset, sizeof(u32)));
1618-
clflush_write32(vaddr + offset_in_page(offset),
1619-
lower_32_bits(target_addr),
1620-
eb->reloc_cache.vaddr);
1621-
1622-
if (wide) {
1623-
offset += sizeof(u32);
1624-
target_addr >>= 32;
1625-
wide = false;
1626-
goto repeat;
1627-
}
1606+
vaddr = reloc_vaddr(vma->obj, eb,
1607+
offset >> PAGE_SHIFT);
1608+
if (IS_ERR(vaddr))
1609+
return PTR_ERR(vaddr);
1610+
1611+
GEM_BUG_ON(!IS_ALIGNED(offset, sizeof(u32)));
1612+
clflush_write32(vaddr + offset_in_page(offset),
1613+
lower_32_bits(target_addr),
1614+
eb->reloc_cache.vaddr);
1615+
1616+
if (wide) {
1617+
offset += sizeof(u32);
1618+
target_addr >>= 32;
1619+
wide = false;
1620+
goto repeat;
16281621
}
16291622

16301623
return target->node.start | UPDATE;

0 commit comments

Comments
 (0)