[PATCH] drm/shmem-helper: Don't remove the offset in vm_area_struct pgoff

2021-02-17 Thread Neil Roberts
set 0. drm_vma_node_unmap is being used by the shmem helpers when purging the buffer. It looks like panfrost is using drm_gem_shmem_purge so this might fix a potential bug there. Signed-off-by: Neil Roberts --- drivers/gpu/drm/drm_gem_shmem_helper.c | 12 +++- 1 file changed, 7 insertions(

Re: [PATCH] drm/shmem-helper: Don't remove the offset in vm_area_struct pgoff

2021-02-23 Thread Neil Roberts
Daniel Vetter writes: > Yeah plus Cc: stable for backporting and I think an igt or similar for > panfrost to check this works correctly would be pretty good too. Since > if it took us over 1 year to notice this bug it's pretty clear that > normal testing doesn't catch this. So very likely we'll b

[PATCH 0/2] Fix purging buffers in the shmem helpers

2021-02-23 Thread Neil Roberts
other buffers. This is currently affecting Panfrost. The second patch is a v2 from a patch that was sent standalone. There is a WIP IGT test for Panfrost which demonstrates the bug here: https://gitlab.freedesktop.org/nroberts/igt-gpu-tools/-/commits/panfrost-purgemap/ Neil Roberts (2): drm/shmem-h

[PATCH 1/2] drm/shmem-helper: Check for purged buffers in fault handler

2021-02-23 Thread Neil Roberts
When a buffer is madvised as not needed and then purged, any attempts to access the buffer from user-space should cause a bus fault. This patch adds a check for that. Cc: sta...@vger.kernel.org Fixes: 17acb9f35ed7 ("drm/shmem: Add madvise state and purge helpers") Signed-off-by: Ne

[PATCH v2 2/2] drm/shmem-helper: Don't remove the offset in vm_area_struct pgoff

2021-02-23 Thread Neil Roberts
hether the unsigned page_offset is less than 0. Cc: sta...@vger.kernel.org Fixes: 17acb9f35ed7 ("drm/shmem: Add madvise state and purge helpers") Signed-off-by: Neil Roberts --- drivers/gpu/drm/drm_gem_shmem_helper.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff

Re: [PATCH] drm/shmem-helper: Don't remove the offset in vm_area_struct pgoff

2021-02-23 Thread Neil Roberts
Daniel Vetter writes: > drm_gem_shmem_fault() does not seem to check for purged objects at all. > > No idea how this works, or if it ever worked, but yeah something is > clearly still busted. Oh of course, the fault handler doesn’t check this. I’ve added a second patch to make it check and poste

Re: [PATCH RESEND] drm/vc4: Fix an error code vc4_create_object()

2021-02-25 Thread Neil Roberts
em_obj = drm->driver->gem_create_object(drm, size); /* … */ if (!gem_obj) return ERR_PTR(-ENOMEM); Reviewed-by: Neil Roberts Regards, - Neil ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

[PATCH i-g-t 0/2] panfrost: Test accessing a purged buffer via mmap

2021-03-05 Thread Neil Roberts
there are other tests that use the same method as in this series (eg, igt_vc4_trigger_purge). Seeing as there is already a precedent for IGT tests to do this, I wonder if we could leave that as a later change for someone who is more active in Panfrost development. Neil Roberts (2): lib/panfrost

[PATCH i-g-t 1/2] lib/panfrost: Add a utility to madvise a buffer

2021-03-05 Thread Neil Roberts
Signed-off-by: Neil Roberts --- lib/igt_panfrost.c | 12 lib/igt_panfrost.h | 1 + 2 files changed, 13 insertions(+) diff --git a/lib/igt_panfrost.c b/lib/igt_panfrost.c index 8b0c2b77..ffce66a2 100644 --- a/lib/igt_panfrost.c +++ b/lib/igt_panfrost.c @@ -127,6 +127,18 @@ void

[PATCH i-g-t 2/2] tests/panfrost: Add a test for accessing a purged buffer

2021-03-05 Thread Neil Roberts
-by: Neil Roberts --- tests/meson.build | 1 + tests/panfrost_purgemap.c | 146 ++ 2 files changed, 147 insertions(+) create mode 100644 tests/panfrost_purgemap.c diff --git a/tests/meson.build b/tests/meson.build index 825e0183..af24427a 100644 --- a

[PATCH libdrm] intel: Allow some codenames in INTEL_DEVID_OVERRIDE

2015-11-09 Thread Neil Roberts
As well as allowing a hexadecimal PCI ID number, the INTEL_DEVID_OVERRIDE environment variable can now contain one of a few short codenames. The codenames are stored in a small table to map them to a corresponding PCI ID. This makes it easier to use without having to look up the PCI IDs manually.

[PATCH] i915: Add I915_PARAM_REVISION

2015-03-04 Thread Neil Roberts
This is a new parameter for DRM_I915_GETPARAM to query the GPU revision. Signed-off-by: Neil Roberts --- include/drm/i915_drm.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/drm/i915_drm.h b/include/drm/i915_drm.h index 15dd01d..943a9d9 100644 --- a/include/drm/i915_drm.h +++ b

[PATCH] intel: Merge latest i915_drm.h

2015-03-05 Thread Neil Roberts
The main incentive to do this is to get I915_PARAM_REVISION. --- include/drm/i915_drm.h | 48 ++-- 1 file changed, 42 insertions(+), 6 deletions(-) diff --git a/include/drm/i915_drm.h b/include/drm/i915_drm.h index 15dd01d..afa110c 100644 --- a/include/

[PATCH v2] intel: Merge latest i915_drm.h

2015-03-19 Thread Neil Roberts
The main incentive to do this is to get I915_PARAM_REVISION. v2: Rebase on top of some changes that were made to the header without copying the whole file from the kernel source. Signed-off-by: Neil Roberts --- Here is a v2 of the patch just to rebase it on the changes that were added