Skip to content
This repository was archived by the owner on Oct 3, 2024. It is now read-only.

Commit 07af135

Browse files
committed
Merge remote-tracking branch 'drm-intel/drm-intel-gt-next' into drm-tip
2 parents 6386227 + 5ac342e commit 07af135

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+1870
-668
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1875,6 +1875,7 @@ i915_gem_user_to_context_sseu(struct intel_gt *gt,
18751875
{
18761876
const struct sseu_dev_info *device = &gt->info.sseu;
18771877
struct drm_i915_private *i915 = gt->i915;
1878+
unsigned int dev_subslice_mask = intel_sseu_get_hsw_subslices(device, 0);
18781879

18791880
/* No zeros in any field. */
18801881
if (!user->slice_mask || !user->subslice_mask ||
@@ -1901,7 +1902,7 @@ i915_gem_user_to_context_sseu(struct intel_gt *gt,
19011902
if (user->slice_mask & ~device->slice_mask)
19021903
return -EINVAL;
19031904

1904-
if (user->subslice_mask & ~device->subslice_mask[0])
1905+
if (user->subslice_mask & ~dev_subslice_mask)
19051906
return -EINVAL;
19061907

19071908
if (user->max_eus_per_subslice > device->max_eus_per_subslice)
@@ -1915,7 +1916,7 @@ i915_gem_user_to_context_sseu(struct intel_gt *gt,
19151916
/* Part specific restrictions. */
19161917
if (GRAPHICS_VER(i915) == 11) {
19171918
unsigned int hw_s = hweight8(device->slice_mask);
1918-
unsigned int hw_ss_per_s = hweight8(device->subslice_mask[0]);
1919+
unsigned int hw_ss_per_s = hweight8(dev_subslice_mask);
19191920
unsigned int req_s = hweight8(context->slice_mask);
19201921
unsigned int req_ss = hweight8(context->subslice_mask);
19211922

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -999,7 +999,8 @@ static int eb_validate_vmas(struct i915_execbuffer *eb)
999999
}
10001000
}
10011001

1002-
err = dma_resv_reserve_fences(vma->obj->base.resv, 1);
1002+
/* Reserve enough slots to accommodate composite fences */
1003+
err = dma_resv_reserve_fences(vma->obj->base.resv, eb->num_batches);
10031004
if (err)
10041005
return err;
10051006

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

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -671,17 +671,10 @@ i915_gem_object_create_shmem_from_data(struct drm_i915_private *dev_priv,
671671

672672
static int init_shmem(struct intel_memory_region *mem)
673673
{
674-
int err;
675-
676-
err = i915_gemfs_init(mem->i915);
677-
if (err) {
678-
DRM_NOTE("Unable to create a private tmpfs mount, hugepage support will be disabled(%d).\n",
679-
err);
680-
}
681-
674+
i915_gemfs_init(mem->i915);
682675
intel_memory_region_set_name(mem, "system");
683676

684-
return 0; /* Don't error, we can simply fallback to the kernel mnt */
677+
return 0; /* We have fallback to the kernel mnt if gemfs init failed. */
685678
}
686679

687680
static int release_shmem(struct intel_memory_region *mem)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ static bool can_release_pages(struct drm_i915_gem_object *obj)
3636
return swap_available() || obj->mm.madv == I915_MADV_DONTNEED;
3737
}
3838

39-
static int drop_pages(struct drm_i915_gem_object *obj,
39+
static bool drop_pages(struct drm_i915_gem_object *obj,
4040
unsigned long shrink, bool trylock_vm)
4141
{
4242
unsigned long flags;

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

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -11,47 +11,47 @@
1111
#include "i915_gemfs.h"
1212
#include "i915_utils.h"
1313

14-
int i915_gemfs_init(struct drm_i915_private *i915)
14+
void i915_gemfs_init(struct drm_i915_private *i915)
1515
{
1616
char huge_opt[] = "huge=within_size"; /* r/w */
1717
struct file_system_type *type;
1818
struct vfsmount *gemfs;
19-
char *opts;
20-
21-
type = get_fs_type("tmpfs");
22-
if (!type)
23-
return -ENODEV;
2419

2520
/*
2621
* By creating our own shmemfs mountpoint, we can pass in
2722
* mount flags that better match our usecase.
2823
*
2924
* One example, although it is probably better with a per-file
3025
* control, is selecting huge page allocations ("huge=within_size").
31-
* However, we only do so to offset the overhead of iommu lookups
32-
* due to bandwidth issues (slow reads) on Broadwell+.
26+
* However, we only do so on platforms which benefit from it, or to
27+
* offset the overhead of iommu lookups, where with latter it is a net
28+
* win even on platforms which would otherwise see some performance
29+
* regressions such a slow reads issue on Broadwell and Skylake.
3330
*/
3431

35-
opts = NULL;
36-
if (i915_vtd_active(i915)) {
37-
if (IS_ENABLED(CONFIG_TRANSPARENT_HUGEPAGE)) {
38-
opts = huge_opt;
39-
drm_info(&i915->drm,
40-
"Transparent Hugepage mode '%s'\n",
41-
opts);
42-
} else {
43-
drm_notice(&i915->drm,
44-
"Transparent Hugepage support is recommended for optimal performance when IOMMU is enabled!\n");
45-
}
46-
}
47-
48-
gemfs = vfs_kern_mount(type, SB_KERNMOUNT, type->name, opts);
32+
if (GRAPHICS_VER(i915) < 11 && !i915_vtd_active(i915))
33+
return;
34+
35+
if (!IS_ENABLED(CONFIG_TRANSPARENT_HUGEPAGE))
36+
goto err;
37+
38+
type = get_fs_type("tmpfs");
39+
if (!type)
40+
goto err;
41+
42+
gemfs = vfs_kern_mount(type, SB_KERNMOUNT, type->name, huge_opt);
4943
if (IS_ERR(gemfs))
50-
return PTR_ERR(gemfs);
44+
goto err;
5145

5246
i915->mm.gemfs = gemfs;
53-
54-
return 0;
47+
drm_info(&i915->drm, "Using Transparent Hugepages\n");
48+
return;
49+
50+
err:
51+
drm_notice(&i915->drm,
52+
"Transparent Hugepage support is recommended for optimal performance%s\n",
53+
GRAPHICS_VER(i915) >= 11 ? " on this platform!" :
54+
" when IOMMU is enabled!");
5555
}
5656

5757
void i915_gemfs_fini(struct drm_i915_private *i915)

drivers/gpu/drm/i915/gem/i915_gemfs.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99

1010
struct drm_i915_private;
1111

12-
int i915_gemfs_init(struct drm_i915_private *i915);
13-
12+
void i915_gemfs_init(struct drm_i915_private *i915);
1413
void i915_gemfs_fini(struct drm_i915_private *i915);
1514

1615
#endif

0 commit comments

Comments
 (0)