Message ID | 20220629121427.353800-10-matthew.auld@intel.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | small BAR uapi bits | expand |
On 6/29/22 14:14, Matthew Auld wrote: > It's not supported, and just skips later anyway. With small-BAR things > get more complicated since all of stolen is likely not even CPU > accessible, hence not passing I915_BO_ALLOC_GPU_ONLY just results in the > object create failing. > > Signed-off-by: Matthew Auld <matthew.auld@intel.com> > Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com> > Cc: Lionel Landwerlin <lionel.g.landwerlin@intel.com> > Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com> > Cc: Jon Bloomfield <jon.bloomfield@intel.com> > Cc: Daniel Vetter <daniel.vetter@ffwll.ch> > Cc: Jordan Justen <jordan.l.justen@intel.com> > Cc: Kenneth Graunke <kenneth@whitecape.org> > Cc: Akeem G Abodunrin <akeem.g.abodunrin@intel.com> > --- > drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c | 12 ++++++++++++ > 1 file changed, 12 insertions(+) This reminds me, Is there a problem for fbdev (and hence things like plymouth) if the initial fbdev image ends up as a stolen memory object which in turn ends up not being mappable? I remember we discussed this before but can't recall what the answer was. Anyway, for this patch Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com> > > diff --git a/drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c b/drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c > index 5bc93a1ce3e3..388c85b0f764 100644 > --- a/drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c > +++ b/drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c > @@ -979,6 +979,9 @@ static int igt_mmap(void *arg) > }; > int i; > > + if (mr->private) > + continue; > + > for (i = 0; i < ARRAY_SIZE(sizes); i++) { > struct drm_i915_gem_object *obj; > int err; > @@ -1435,6 +1438,9 @@ static int igt_mmap_access(void *arg) > struct drm_i915_gem_object *obj; > int err; > > + if (mr->private) > + continue; > + > obj = __i915_gem_object_create_user(i915, PAGE_SIZE, &mr, 1); > if (obj == ERR_PTR(-ENODEV)) > continue; > @@ -1580,6 +1586,9 @@ static int igt_mmap_gpu(void *arg) > struct drm_i915_gem_object *obj; > int err; > > + if (mr->private) > + continue; > + > obj = __i915_gem_object_create_user(i915, PAGE_SIZE, &mr, 1); > if (obj == ERR_PTR(-ENODEV)) > continue; > @@ -1727,6 +1736,9 @@ static int igt_mmap_revoke(void *arg) > struct drm_i915_gem_object *obj; > int err; > > + if (mr->private) > + continue; > + > obj = __i915_gem_object_create_user(i915, PAGE_SIZE, &mr, 1); > if (obj == ERR_PTR(-ENODEV)) > continue;
On 29/06/2022 17:22, Thomas Hellström wrote: > > On 6/29/22 14:14, Matthew Auld wrote: >> It's not supported, and just skips later anyway. With small-BAR things >> get more complicated since all of stolen is likely not even CPU >> accessible, hence not passing I915_BO_ALLOC_GPU_ONLY just results in the >> object create failing. >> >> Signed-off-by: Matthew Auld <matthew.auld@intel.com> >> Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com> >> Cc: Lionel Landwerlin <lionel.g.landwerlin@intel.com> >> Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com> >> Cc: Jon Bloomfield <jon.bloomfield@intel.com> >> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> >> Cc: Jordan Justen <jordan.l.justen@intel.com> >> Cc: Kenneth Graunke <kenneth@whitecape.org> >> Cc: Akeem G Abodunrin <akeem.g.abodunrin@intel.com> >> --- >> drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c | 12 ++++++++++++ >> 1 file changed, 12 insertions(+) > > This reminds me, > > Is there a problem for fbdev (and hence things like plymouth) if the > initial fbdev image ends up as a stolen memory object which in turn ends > up not being mappable? I remember we discussed this before but can't > recall what the answer was. On discrete the initial-fb looks to be allocated directly from lmem (at least on the machines I've seen in CI). See 7fe7c2a679dc ("drm/i915: fixup the initial fb base on DGFX"). And from what I could tell the offset in lmem is always at the beginning somewhere, which makes sense given stuff like small-BAR. But yeah, the create_at() helper should complain if someone tried to allocate the initial-fb or similar outside the mappable part. IIRC the only user of stolen-lmem is fbc, but that doesn't seem to need CPU access. > > Anyway, for this patch > > Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com> > > > > > >> >> diff --git a/drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c >> b/drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c >> index 5bc93a1ce3e3..388c85b0f764 100644 >> --- a/drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c >> +++ b/drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c >> @@ -979,6 +979,9 @@ static int igt_mmap(void *arg) >> }; >> int i; >> + if (mr->private) >> + continue; >> + >> for (i = 0; i < ARRAY_SIZE(sizes); i++) { >> struct drm_i915_gem_object *obj; >> int err; >> @@ -1435,6 +1438,9 @@ static int igt_mmap_access(void *arg) >> struct drm_i915_gem_object *obj; >> int err; >> + if (mr->private) >> + continue; >> + >> obj = __i915_gem_object_create_user(i915, PAGE_SIZE, &mr, 1); >> if (obj == ERR_PTR(-ENODEV)) >> continue; >> @@ -1580,6 +1586,9 @@ static int igt_mmap_gpu(void *arg) >> struct drm_i915_gem_object *obj; >> int err; >> + if (mr->private) >> + continue; >> + >> obj = __i915_gem_object_create_user(i915, PAGE_SIZE, &mr, 1); >> if (obj == ERR_PTR(-ENODEV)) >> continue; >> @@ -1727,6 +1736,9 @@ static int igt_mmap_revoke(void *arg) >> struct drm_i915_gem_object *obj; >> int err; >> + if (mr->private) >> + continue; >> + >> obj = __i915_gem_object_create_user(i915, PAGE_SIZE, &mr, 1); >> if (obj == ERR_PTR(-ENODEV)) >> continue;
diff --git a/drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c b/drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c index 5bc93a1ce3e3..388c85b0f764 100644 --- a/drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c +++ b/drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c @@ -979,6 +979,9 @@ static int igt_mmap(void *arg) }; int i; + if (mr->private) + continue; + for (i = 0; i < ARRAY_SIZE(sizes); i++) { struct drm_i915_gem_object *obj; int err; @@ -1435,6 +1438,9 @@ static int igt_mmap_access(void *arg) struct drm_i915_gem_object *obj; int err; + if (mr->private) + continue; + obj = __i915_gem_object_create_user(i915, PAGE_SIZE, &mr, 1); if (obj == ERR_PTR(-ENODEV)) continue; @@ -1580,6 +1586,9 @@ static int igt_mmap_gpu(void *arg) struct drm_i915_gem_object *obj; int err; + if (mr->private) + continue; + obj = __i915_gem_object_create_user(i915, PAGE_SIZE, &mr, 1); if (obj == ERR_PTR(-ENODEV)) continue; @@ -1727,6 +1736,9 @@ static int igt_mmap_revoke(void *arg) struct drm_i915_gem_object *obj; int err; + if (mr->private) + continue; + obj = __i915_gem_object_create_user(i915, PAGE_SIZE, &mr, 1); if (obj == ERR_PTR(-ENODEV)) continue;
It's not supported, and just skips later anyway. With small-BAR things get more complicated since all of stolen is likely not even CPU accessible, hence not passing I915_BO_ALLOC_GPU_ONLY just results in the object create failing. Signed-off-by: Matthew Auld <matthew.auld@intel.com> Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com> Cc: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com> Cc: Jon Bloomfield <jon.bloomfield@intel.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Kenneth Graunke <kenneth@whitecape.org> Cc: Akeem G Abodunrin <akeem.g.abodunrin@intel.com> --- drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)