[Intel-gfx] [PATCH i-g-t v2 4/6] lib/i915: add gem_create_with_cpu_access_in_memory_regions

2022-02-21 Thread Matthew Auld
it to use in gem_exec_capture, where a proper hint is now required by the kernel on DG2+, for objects marked with EXEC_OBJECT_CAPTURE, that can also be placed in LMEM. Signed-off-by: Matthew Auld Cc: Thomas Hellström --- lib/i915/intel_memory_region.c | 10 +--- lib/i915/intel_memory_region.h

[Intel-gfx] [PATCH i-g-t v2 6/6] lib/i915: request CPU_ACCESS for fb objects

2022-02-21 Thread Matthew Auld
the mappable portion, if possible. XXX: perhaps the kernel needs to somehow handle this better? Signed-off-by: Matthew Auld Cc: Thomas Hellström --- lib/ioctl_wrappers.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ioctl_wrappers.c b/lib/ioctl_wrappers.c index 09eb3ce7

[Intel-gfx] [PATCH i-g-t v2 2/6] lib/i915: wire up optional flags for gem_create_ext

2022-02-21 Thread Matthew Auld
For now limit to direct callers. Signed-off-by: Matthew Auld Cc: Thomas Hellström --- lib/i915/gem_create.c | 9 ++--- lib/i915/gem_create.h | 5 +++-- lib/i915/intel_memory_region.c | 2 +- tests/i915/gem_create.c| 24 tests/i915

[Intel-gfx] [PATCH i-g-t v2 1/6] lib/i915_drm_local: Add I915_GEM_CREATE_EXT_FLAG_NEEDS_CPU_ACCESS

2022-02-21 Thread Matthew Auld
For now dump into i915_drm_local.h. Once the uapi on the kernel side is merged, and is part of drm-next, we can sync the kernel headers and remove this. Signed-off-by: Matthew Auld Cc: Thomas Hellström --- lib/i915/i915_drm_local.h | 27 +++ 1 file changed, 27

[Intel-gfx] [PATCH i-g-t v2 0/6] Exercise NEEDS_CPU_ACCESS

2022-02-21 Thread Matthew Auld
Add some initial tests for the new I915_GEM_CREATE_EXT_FLAG_NEEDS_CPU_ACCESS flag. v2: Add missing cover letter. Likely also needed when using 'Test-with:' -- 2.34.1

[Intel-gfx] [PATCH i-g-t 6/6] lib/i915: request CPU_ACCESS for fb objects

2022-02-21 Thread Matthew Auld
the mappable portion, if possible. XXX: perhaps the kernel needs to somehow handle this better? Signed-off-by: Matthew Auld Cc: Thomas Hellström --- lib/ioctl_wrappers.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ioctl_wrappers.c b/lib/ioctl_wrappers.c index 09eb3ce7

[Intel-gfx] [PATCH i-g-t 5/6] i915/tests/capture: add a negative test for NEEDS_CPU_ACCESS

2022-02-21 Thread Matthew Auld
Sanity check that the kernel does indeed reject LMEM buffers marked with EXEC_OBJECT_CAPTURE, that are not also marked with NEEDS_CPU_ACCESS. Signed-off-by: Matthew Auld Cc: Thomas Hellström --- tests/i915/gem_exec_capture.c | 69 +++ 1 file changed, 69

[Intel-gfx] [PATCH i-g-t 4/6] lib/i915: add gem_create_with_cpu_access_in_memory_regions

2022-02-21 Thread Matthew Auld
it to use in gem_exec_capture, where a proper hint is now required by the kernel on DG2+, for objects marked with EXEC_OBJECT_CAPTURE, that can also be placed in LMEM. Signed-off-by: Matthew Auld Cc: Thomas Hellström --- lib/i915/intel_memory_region.c | 10 +--- lib/i915/intel_memory_region.h

[Intel-gfx] [PATCH i-g-t 3/6] tests/i915/gem_create: test NEEDS_CPU_ACCESS

2022-02-21 Thread Matthew Auld
Add some basic tests for this new flag. Signed-off-by: Matthew Auld Cc: Thomas Hellström --- tests/i915/gem_create.c | 334 1 file changed, 334 insertions(+) diff --git a/tests/i915/gem_create.c b/tests/i915/gem_create.c index a6c3c9d9..318e6491 100644

[Intel-gfx] [PATCH i-g-t 1/6] lib/i915_drm_local: Add I915_GEM_CREATE_EXT_FLAG_NEEDS_CPU_ACCESS

2022-02-21 Thread Matthew Auld
For now dump into i915_drm_local.h. Once the uapi on the kernel side is merged, and is part of drm-next, we can sync the kernel headers and remove this. Signed-off-by: Matthew Auld Cc: Thomas Hellström --- lib/i915/i915_drm_local.h | 27 +++ 1 file changed, 27

[Intel-gfx] [PATCH i-g-t 2/6] lib/i915: wire up optional flags for gem_create_ext

2022-02-21 Thread Matthew Auld
For now limit to direct callers. Signed-off-by: Matthew Auld Cc: Thomas Hellström --- lib/i915/gem_create.c | 9 ++--- lib/i915/gem_create.h | 5 +++-- lib/i915/intel_memory_region.c | 2 +- tests/i915/gem_create.c| 24 tests/i915

[Intel-gfx] [PATCH i-g-t 2/2] test/i915/gem_exec_await: prefer gem_mmap__device_coherent

2022-02-21 Thread Matthew Auld
Make it play nice on at least DG1. Signed-off-by: Matthew Auld Cc: Thomas Hellström --- tests/i915/gem_exec_await.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/i915/gem_exec_await.c b/tests/i915/gem_exec_await.c index bf8eb682..fe176595 100644 --- a/tests/i915

[Intel-gfx] [PATCH i-g-t 1/2] test/i915/gem_ctx_shared: prefer gem_mmap__device_coherent

2022-02-21 Thread Matthew Auld
Make it play nice on at least DG1. Signed-off-by: Matthew Auld Cc: Thomas Hellström --- tests/i915/gem_ctx_shared.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/i915/gem_ctx_shared.c b/tests/i915/gem_ctx_shared.c index 37444185..b38b7f73 100644 --- a/tests/i915

[Intel-gfx] [PATCH v2] drm/i915/ttm: fixup the mock_bo

2022-02-21 Thread Matthew Auld
the alloc() returns successfully Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/5123 Fixes: 0e05fc49c358 ("drm/ttm: add common accounting to the resource mgr v3") Signed-off-by: Matthew Auld Cc: Christian König Cc: Thomas Hellström Acked-by: Christian König --- drivers/gpu/drm

[Intel-gfx] [PATCH 2/2] drm/doc: add rfc section for small BAR uapi

2022-02-18 Thread Matthew Auld
Add an entry for the new uapi needed for small BAR on DG2+. Signed-off-by: Matthew Auld Cc: Thomas Hellström Cc: Jon Bloomfield Cc: Daniel Vetter Cc: Jordan Justen Cc: Kenneth Graunke Cc: mesa-...@lists.freedesktop.org --- Documentation/gpu/rfc/i915_small_bar.h | 153

[Intel-gfx] [PATCH 1/2] drm/doc: remove rfc section for dg1

2022-02-18 Thread Matthew Auld
We already completed the steps for this. Signed-off-by: Matthew Auld Cc: Thomas Hellström Cc: Jon Bloomfield Cc: Daniel Vetter Cc: Jordan Justen Cc: Kenneth Graunke Cc: mesa-...@lists.freedesktop.org --- Documentation/gpu/rfc/i915_gem_lmem.rst | 22 -- Documentation/gpu

[Intel-gfx] [PATCH 0/2] doc/rfc for small BAR support

2022-02-18 Thread Matthew Auld
The new bits of proposed uAPI for the upcoming small BAR support. -- 2.34.1

Re: [Intel-gfx] [PATCH v2] drm/i915: Kill the fake lmem support

2022-02-17 Thread Matthew Auld
On Thu, 17 Feb 2022 at 17:55, Lucas De Marchi wrote: > > This was useful for early development of lmem, but it's not used > anymore, so remove it. > > v2: Remove unneeded fields from struct intel_memory_region > > Cc: Chris Wilson > Cc: Matthew Auld > Signed-off-by

Re: [Intel-gfx] [PATCH] drm/i915: Clarify vma lifetime

2022-02-17 Thread Matthew Auld
rm/i915: Fix a race between vma / object destruction and unbinding") Cc: Maarten Lankhorst Signed-off-by: Thomas Hellström Reviewed-by: Matthew Auld

[Intel-gfx] [PATCH] drm/i915/ttm: fixup the mock_bo

2022-02-16 Thread Matthew Auld
ev, and also wants to store the bo reference. Try to keep both working. The mock_bo is a hack so we can interface directly with the ttm managers alloc() and free() hooks for our mock testing, without invoking other TTM features like eviction, moves, etc. Closes: https://gitlab.freedesktop.or

Re: [Intel-gfx] [PATCH] drm/i915/perf: Skip the i915_perf_init for dg2

2022-02-15 Thread Matthew Auld
On 15/02/2022 05:31, Ramalingam C wrote: i915_perf is not enabled for dg2 yet, hence skip the feature initialization. Signed-off-by: Ramalingam C cc: Umesh Nerlige Ramappa Reviewed-by: Matthew Auld --- drivers/gpu/drm/i915/i915_perf.c | 4 1 file changed, 4 insertions(+) diff

Re: [Intel-gfx] [PATCH v12 1/5] drm: improve drm_buddy_alloc function

2022-02-14 Thread Matthew Auld
en > > - drm_buddy_alloc_range() becomes obsolete and may be removed > > - enable ttm range allocation (fpfn / lpfn) support in i915 driver > > - apply enhanced drm_buddy_alloc() function to i915 driver > > > > v3(Matthew Auld): > >- Fix alignment issues a

[Intel-gfx] [PATCH v3 14/15] drm/i915/uapi: forbid ALLOC_GPU_ONLY for error capture

2022-02-11 Thread Matthew Auld
robot ): - Also update the function signature on !CONFIG_DRM_I915_CAPTURE_ERROR builds. Signed-off-by: Matthew Auld Cc: Thomas Hellström Cc: Jon Bloomfield --- drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c | 14 +++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git

[Intel-gfx] [PATCH v3 12/15] drm/i915/create: apply ALLOC_GPU_ONLY by default

2022-02-11 Thread Matthew Auld
be applied on objects that can be placed in LMEM. The other annoyance would be gem_create_ext vs plain gem_create, if we were to always apply GPU_ONLY. Signed-off-by: Matthew Auld Cc: Thomas Hellström Cc: Jon Bloomfield --- drivers/gpu/drm/i915/gem/i915_gem_create.c | 8 1 file

[Intel-gfx] [PATCH v3 13/15] drm/i915/uapi: add NEEDS_CPU_ACCESS hint

2022-02-11 Thread Matthew Auld
just for the sake of having more complete picture. Signed-off-by: Matthew Auld Cc: Thomas Hellström Cc: Jon Bloomfield --- drivers/gpu/drm/i915/gem/i915_gem_create.c | 26 -- include/uapi/drm/i915_drm.h| 31 +- 2 files changed, 48 insertions

[Intel-gfx] [PATCH v3 15/15] drm/i915/lmem: don't treat small BAR as an error

2022-02-11 Thread Matthew Auld
Just pass along the probed io_size. The backend should be able to utilize the entire range here, even if some of it is non-mappable. It does leave open with what to do with stolen local-memory. Signed-off-by: Matthew Auld Cc: Thomas Hellström Reviewed-by: Thomas Hellström --- drivers/gpu/drm

[Intel-gfx] [PATCH v3 11/15] drm/i915/selftests: handle allocation failures

2022-02-11 Thread Matthew Auld
will return -ENOMEM, in ttm_bo_mem_space() after exhausting all possible placements. Signed-off-by: Matthew Auld Cc: Thomas Hellström Reviewed-by: Thomas Hellström Acked-by: Nirmoy Das --- drivers/gpu/drm/i915/gem/selftests/huge_pages.c | 2 +- drivers/gpu/drm/i915/selftests

[Intel-gfx] [PATCH v3 10/15] drm/i915/selftests: exercise mmap migration

2022-02-11 Thread Matthew Auld
Exercise each of the migration scenarios, verifying that the final placement and buffer contents match our expectations. v2(Thomas): Replace for_i915_gem_ww() block with simpler object_lock() Signed-off-by: Matthew Auld Cc: Thomas Hellström Reviewed-by: Thomas Hellström --- .../drm/i915/gem

[Intel-gfx] [PATCH v3 04/15] drm/i915/buddy: track available visible size

2022-02-11 Thread Matthew Auld
off-by: Matthew Auld Cc: Thomas Hellström Reviewed-by: Thomas Hellström Acked-by: Nirmoy Das --- drivers/gpu/drm/i915/i915_ttm_buddy_manager.c | 68 ++- drivers/gpu/drm/i915/i915_ttm_buddy_manager.h | 8 ++- drivers/gpu/drm/i915/intel_region_ttm.c | 1 + 3 files changed,

[Intel-gfx] [PATCH v3 09/15] drm/i915/ttm: mappable migration on fault

2022-02-11 Thread Matthew Auld
placements permit it. Signed-off-by: Matthew Auld Cc: Thomas Hellström Reviewed-by: Thomas Hellström --- drivers/gpu/drm/i915/gem/i915_gem_ttm.c | 54 ++--- 1 file changed, 48 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/i915/gem/i915_gem_ttm.c b/drivers/gpu

[Intel-gfx] [PATCH v3 07/15] drm/i915/selftests: mock test io_size

2022-02-11 Thread Matthew Auld
Check that mappable vs non-mappable matches our expectations. Signed-off-by: Matthew Auld Cc: Thomas Hellström Reviewed-by: Thomas Hellström --- .../drm/i915/selftests/intel_memory_region.c | 143 ++ 1 file changed, 143 insertions(+) diff --git a/drivers/gpu/drm/i915

[Intel-gfx] [PATCH v3 08/15] drm/i915/ttm: make eviction mappable aware

2022-02-11 Thread Matthew Auld
hopefully victimize these last. v2(Thomas): s/TTM_PL_PRIV/I915_PL_LMEM0/ Signed-off-by: Matthew Auld Cc: Thomas Hellström Reviewed-by: Thomas Hellström --- drivers/gpu/drm/i915/gem/i915_gem_ttm.c | 65 - 1 file changed, 63 insertions(+), 2 deletions(-) diff --git

[Intel-gfx] [PATCH v3 06/15] drm/i915/buddy: tweak 2big check

2022-02-11 Thread Matthew Auld
Otherwise we get -EINVAL, instead of the more useful -E2BIG if the allocation doesn't fit within the pfn range, like with mappable lmem. The hugepages selftest, for example, needs this to know if a smaller size is needed. Signed-off-by: Matthew Auld Cc: Thomas Hellström Reviewed-by: Thomas

[Intel-gfx] [PATCH v3 05/15] drm/i915/buddy: adjust res->start

2022-02-11 Thread Matthew Auld
result in an actual move, instead of being turned into a noop. Signed-off-by: Matthew Auld Cc: Thomas Hellström Reviewed-by: Thomas Hellström Acked-by: Nirmoy Das --- drivers/gpu/drm/i915/i915_ttm_buddy_manager.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/gpu/dr

[Intel-gfx] [PATCH v3 02/15] drm/i915/ttm: require mappable by default

2022-02-11 Thread Matthew Auld
this behaviour. Signed-off-by: Matthew Auld Cc: Thomas Hellström Reviewed-by: Thomas Hellström Acked-by: Nirmoy Das --- drivers/gpu/drm/i915/gem/i915_gem_ttm.c | 4 drivers/gpu/drm/i915/intel_region_ttm.c | 5 + 2 files changed, 9 insertions(+) diff --git a/drivers/gpu/drm/i915/gem

[Intel-gfx] [PATCH v3 03/15] drm/i915: add I915_BO_ALLOC_GPU_ONLY

2022-02-11 Thread Matthew Auld
even have small BAR. A better name is GPU_ONLY, which is accurate regardless of the configuration. Signed-off-by: Matthew Auld Cc: Thomas Hellström Reviewed-by: Thomas Hellström Acked-by: Nirmoy Das --- .../gpu/drm/i915/gem/i915_gem_object_types.h| 17 - drivers/gpu/drm

[Intel-gfx] [PATCH v3 01/15] drm/i915: add io_size plumbing

2022-02-11 Thread Matthew Auld
With small LMEM-BAR we need to be able to differentiate between the total size of LMEM, and how much of it is CPU mappable. The end goal is to be able to utilize the entire range, even if part of is it not CPU accessible. v2: also update intelfb_create Signed-off-by: Matthew Auld Cc: Thomas

[Intel-gfx] [PATCH v3 00/15] Initial support for small BAR recovery

2022-02-11 Thread Matthew Auld
Starting from DG2 we will have resizable BAR support for device local-memory, but in some cases the final BAR size might still be smaller than the total local-memory size. In such cases only part of local-memory will be CPU accessible, while the remainder is only accessible via the GPU. This

Re: [Intel-gfx] [PATCH v2 12/15] drm/i915/create: apply ALLOC_GPU_ONLY by default

2022-02-11 Thread Matthew Auld
On Fri, 11 Feb 2022 at 09:56, Thomas Hellström wrote: > > > On 2/11/22 10:52, Matthew Auld wrote: > > On Fri, 11 Feb 2022 at 09:49, Thomas Hellström > > wrote: > >> > >> On 2/10/22 13:13, Matthew Auld wrote: > >>> Starting from DG2+, when dea

Re: [Intel-gfx] [PATCH v2 12/15] drm/i915/create: apply ALLOC_GPU_ONLY by default

2022-02-11 Thread Matthew Auld
On Fri, 11 Feb 2022 at 09:49, Thomas Hellström wrote: > > > On 2/10/22 13:13, Matthew Auld wrote: > > Starting from DG2+, when dealing with LMEM, we assume that by default > > all userspace allocations should be placed in the non-mappable portion > > of LM

Re: [Intel-gfx] [PATCH v11 5/5] drm/amdgpu: add drm buddy support to amdgpu

2022-02-10 Thread Matthew Auld
On 08/02/2022 11:20, Arunpravin wrote: On 04/02/22 6:53 pm, Christian König wrote: Am 04.02.22 um 12:22 schrieb Arunpravin: On 28/01/22 7:48 pm, Matthew Auld wrote: On Thu, 27 Jan 2022 at 14:11, Arunpravin wrote: - Remove drm_mm references and replace with drm buddy functionalities - Add

Re: [Intel-gfx] [PATCH v11 1/5] drm: improve drm_buddy_alloc function

2022-02-10 Thread Matthew Auld
to i915 driver v3(Matthew Auld): - Fix alignment issues and remove unnecessary list_empty check - add more validation checks for input arguments - make alloc_range() block allocations as bottom-up - optimize order computation logic - replace uint64_t with u64, which is preferred

[Intel-gfx] [PATCH v2 15/15] drm/i915/lmem: don't treat small BAR as an error

2022-02-10 Thread Matthew Auld
Just pass along the probed io_size. The backend should be able to utilize the entire range here, even if some of it is non-mappable. It does leave open with what to do with stolen local-memory. Signed-off-by: Matthew Auld Cc: Thomas Hellström --- drivers/gpu/drm/i915/gt/intel_region_lmem.c

[Intel-gfx] [PATCH v2 14/15] drm/i915/uapi: forbid ALLOC_GPU_ONLY for error capture

2022-02-10 Thread Matthew Auld
robot ): - Also update the function signature on !CONFIG_DRM_I915_CAPTURE_ERROR builds. Signed-off-by: Matthew Auld Cc: Thomas Hellström --- drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c | 13 ++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915

[Intel-gfx] [PATCH v2 13/15] drm/i915/uapi: add NEEDS_CPU_ACCESS hint

2022-02-10 Thread Matthew Auld
IGTs. Including now just for the sake of having more complete picture. Signed-off-by: Matthew Auld Cc: Thomas Hellström --- drivers/gpu/drm/i915/gem/i915_gem_create.c | 28 --- include/uapi/drm/i915_drm.h| 31 +- 2 files changed, 49 insertions

[Intel-gfx] [PATCH v2 09/15] drm/i915/ttm: mappable migration on fault

2022-02-10 Thread Matthew Auld
placements permit it. Signed-off-by: Matthew Auld Cc: Thomas Hellström Reviewed-by: Thomas Hellström --- drivers/gpu/drm/i915/gem/i915_gem_ttm.c | 54 ++--- 1 file changed, 48 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/i915/gem/i915_gem_ttm.c b/drivers/gpu

[Intel-gfx] [PATCH v2 12/15] drm/i915/create: apply ALLOC_GPU_ONLY by default

2022-02-10 Thread Matthew Auld
userspace will be able to provide a hint if CPU access to the buffer is needed. Signed-off-by: Matthew Auld Cc: Thomas Hellström --- drivers/gpu/drm/i915/gem/i915_gem_create.c | 9 + 1 file changed, 9 insertions(+) diff --git a/drivers/gpu/drm/i915/gem/i915_gem_create.c b/drivers/gpu/dr

[Intel-gfx] [PATCH v2 05/15] drm/i915/buddy: adjust res->start

2022-02-10 Thread Matthew Auld
result in an actual move, instead of being turned into a noop. Signed-off-by: Matthew Auld Cc: Thomas Hellström Reviewed-by: Thomas Hellström --- drivers/gpu/drm/i915/i915_ttm_buddy_manager.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/gpu/drm/i915/i915_ttm_buddy_manager.c b/d

[Intel-gfx] [PATCH v2 06/15] drm/i915/buddy: tweak 2big check

2022-02-10 Thread Matthew Auld
Otherwise we get -EINVAL, instead of the more useful -E2BIG if the allocation doesn't fit within the pfn range, like with mappable lmem. The hugepages selftest, for example, needs this to know if a smaller size is needed. Signed-off-by: Matthew Auld Cc: Thomas Hellström Reviewed-by: Thomas

[Intel-gfx] [PATCH v2 08/15] drm/i915/ttm: make eviction mappable aware

2022-02-10 Thread Matthew Auld
hopefully victimize these last. v2(Thomas): s/TTM_PL_PRIV/I915_PL_LMEM0/ Signed-off-by: Matthew Auld Cc: Thomas Hellström Reviewed-by: Thomas Hellström --- drivers/gpu/drm/i915/gem/i915_gem_ttm.c | 65 - 1 file changed, 63 insertions(+), 2 deletions(-) diff --git

[Intel-gfx] [PATCH v2 10/15] drm/i915/selftests: exercise mmap migration

2022-02-10 Thread Matthew Auld
Exercise each of the migration scenarios, verifying that the final placement and buffer contents match our expectations. v2(Thomas): Replace for_i915_gem_ww() block with simpler object_lock() Signed-off-by: Matthew Auld Cc: Thomas Hellström --- drivers/gpu/drm/i915/gem/i915_gem_ttm.c

[Intel-gfx] [PATCH v2 11/15] drm/i915/selftests: handle allocation failures

2022-02-10 Thread Matthew Auld
will return -ENOMEM, in ttm_bo_mem_space() after exhausting all possible placements. Signed-off-by: Matthew Auld Cc: Thomas Hellström --- drivers/gpu/drm/i915/gem/selftests/huge_pages.c | 2 +- drivers/gpu/drm/i915/selftests/intel_memory_region.c | 8 +++- 2 files changed, 8 insertions(+), 2

[Intel-gfx] [PATCH v2 04/15] drm/i915/buddy: track available visible size

2022-02-10 Thread Matthew Auld
off-by: Matthew Auld Cc: Thomas Hellström --- drivers/gpu/drm/i915/i915_ttm_buddy_manager.c | 68 ++- drivers/gpu/drm/i915/i915_ttm_buddy_manager.h | 8 ++- drivers/gpu/drm/i915/intel_region_ttm.c | 1 + 3 files changed, 75 insertions(+), 2 deletions(-) diff --git a/drivers/

[Intel-gfx] [PATCH v2 07/15] drm/i915/selftests: mock test io_size

2022-02-10 Thread Matthew Auld
Check that mappable vs non-mappable matches our expectations. Signed-off-by: Matthew Auld Cc: Thomas Hellström Reviewed-by: Thomas Hellström --- .../drm/i915/selftests/intel_memory_region.c | 143 ++ 1 file changed, 143 insertions(+) diff --git a/drivers/gpu/drm/i915

[Intel-gfx] [PATCH v2 02/15] drm/i915/ttm: require mappable by default

2022-02-10 Thread Matthew Auld
this behaviour. Signed-off-by: Matthew Auld Cc: Thomas Hellström --- drivers/gpu/drm/i915/gem/i915_gem_ttm.c | 4 drivers/gpu/drm/i915/intel_region_ttm.c | 5 + 2 files changed, 9 insertions(+) diff --git a/drivers/gpu/drm/i915/gem/i915_gem_ttm.c b/drivers/gpu/drm/i915/gem

[Intel-gfx] [PATCH v2 03/15] drm/i915: add I915_BO_ALLOC_GPU_ONLY

2022-02-10 Thread Matthew Auld
even have small BAR. A better name is GPU_ONLY, which is accurate regardless of the configuration. Signed-off-by: Matthew Auld Cc: Thomas Hellström --- .../gpu/drm/i915/gem/i915_gem_object_types.h| 17 - drivers/gpu/drm/i915/gem/i915_gem_pages.c | 3 +++ drivers

[Intel-gfx] [PATCH v2 01/15] drm/i915: add io_size plumbing

2022-02-10 Thread Matthew Auld
With small LMEM-BAR we need to be able to differentiate between the total size of LMEM, and how much of it is CPU mappable. The end goal is to be able to utilize the entire range, even if part of is it not CPU accessible. v2: also update intelfb_create Signed-off-by: Matthew Auld Cc: Thomas

[Intel-gfx] [PATCH v2 00/15] Initial support for small BAR recovery

2022-02-10 Thread Matthew Auld
Starting from DG2 we will have resizable BAR support for device local-memory, but in some cases the final BAR size might still be smaller than the total local-memory size. In such cases only part of local-memory will be CPU accessible, while the remainder is only accessible via the GPU. This

[Intel-gfx] [PATCH] drm/i915/ttm: tweak priority hint selection

2022-02-09 Thread Matthew Auld
For some reason we are selecting PRIO_HAS_PAGES when we don't have mm.pages, and vice versa. v2(Thomas): - Add missing fixes tag Fixes: 213d50927763 ("drm/i915/ttm: Introduce a TTM i915 gem object backend") Signed-off-by: Matthew Auld Cc: Thomas Hellström Reviewed-by: Thomas

[Intel-gfx] [PATCH] drm/doc: pull in drm_buddy.c

2022-02-08 Thread Matthew Auld
Make sure we pull in the kernel-doc for this. Reported-by: Daniel Vetter Signed-off-by: Matthew Auld Cc: Arunpravin Cc: Christian König --- Documentation/gpu/drm-mm.rst | 9 + 1 file changed, 9 insertions(+) diff --git a/Documentation/gpu/drm-mm.rst b/Documentation/gpu/drm-mm.rst

[Intel-gfx] [PATCH] drm/buddy: fixup potential uaf

2022-02-08 Thread Matthew Auld
on i915_buddy removal Fixes: 14d1b9a6247c ("drm/i915: buddy allocator") Signed-off-by: Matthew Auld Cc: Arunpravin Cc: Christian König --- drivers/gpu/drm/drm_buddy.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_buddy.c b/drivers/gpu/drm/d

Re: [Intel-gfx] [PATCH 1/7] drm/selftests: Move i915 buddy selftests into drm

2022-02-08 Thread Matthew Auld
in .config Signed-off-by: Arunpravin At some point I guess we also want some IGT that picks this up? Like we do in tests/drm_mm.c? That way this can get picked up by CI? Acked-by: Matthew Auld --- drivers/gpu/drm/Kconfig | 1 + drivers/gpu/drm/selftests/Makefile

Re: [Intel-gfx] [PATCH 7/7] drm/selftests: add drm buddy pathological testcase

2022-02-08 Thread Matthew Auld
err = drm_buddy_alloc_blocks(, start, mm_size, size, min_page_size, , flags); + if (err) { + pr_info("buddy_alloc hit -ENOME for hole\n"); ENOMEM Reviewed-by: Matthew Auld + goto err; +

Re: [Intel-gfx] [PATCH 6/7] drm/selftests: add drm buddy smoke testcase

2022-02-08 Thread Matthew Auld
pr_err("alloc_blocks has no blocks\n"); + err = -EINVAL; + break; + } + + list_del(>link); + list_add_tail(>link, ); Could just make this list_move_ta

Re: [Intel-gfx] [PATCH 5/7] drm/selftests: add drm buddy pessimistic testcase

2022-02-08 Thread Matthew Auld
link); + if (!block) { + pr_err("alloc_blocks has no blocks\n"); + err = -EINVAL; + goto err; + } + + list_del(>link); + drm_buddy_free_block(, block); + + if (!err) Always true? Reviewed-by: Matthew Auld + pr_info("%

Re: [Intel-gfx] [PATCH 4/7] drm/selftests: add drm buddy optimistic testcase

2022-02-08 Thread Matthew Auld
On 03/02/2022 13:32, Arunpravin wrote: create a mm with one block of each order available, and try to allocate them all. Signed-off-by: Arunpravin Reviewed-by: Matthew Auld

Re: [Intel-gfx] [PATCH 3/7] drm/selftests: add drm buddy alloc range testcase

2022-02-08 Thread Matthew Auld
erations." ? Anyway, Reviewed-by: Matthew Auld + * + * @block: DRM buddy block + */ +struct drm_buddy_block * +drm_get_buddy(struct drm_buddy_block *block) +{ + return __get_buddy(block); +} +EXPORT_SYMBOL(drm_get_buddy); + static void __drm_buddy_free(struct

Re: [Intel-gfx] [PATCH 2/7] drm/selftests: add drm buddy alloc limit testcase

2022-02-08 Thread Matthew Auld
if (!err) Always true AFAICT? + pr_info("%s - succeeded\n", __func__); I guess this could be made part of the run_selftests()? It looks like it already prints the current test, perhaps that is already enough? With the err = -EINVAL change, feel free to add,

Re: [Intel-gfx] [PATCH 1/5] drm/i915/dg2: Add Wa_22011450934

2022-02-07 Thread Matthew Auld
On 07/02/2022 11:48, Matthew Auld wrote: On Fri, 28 Jan 2022 at 18:52, Ramalingam C wrote: An indirect ctx wabb is implemented as per Wa_22011450934 to avoid rcs restore hang during context restore of a preempted context in GPGPU mode Signed-off-by: Ramalingam C cc: Chris Wilson Acked

Re: [Intel-gfx] [PATCH 1/5] drm/i915/dg2: Add Wa_22011450934

2022-02-07 Thread Matthew Auld
On Fri, 28 Jan 2022 at 18:52, Ramalingam C wrote: > > An indirect ctx wabb is implemented as per Wa_22011450934 to avoid rcs > restore hang during context restore of a preempted context in GPGPU mode > > Signed-off-by: Ramalingam C > cc: Chris Wilson Acked-by: Matthew Auld

Re: [Intel-gfx] [PATCH 19/20] drm/i915/lmem: don't treat small BAR as an error

2022-02-03 Thread Matthew Auld
On 03/02/2022 13:56, Thomas Hellström wrote: On Thu, 2022-02-03 at 11:18 +, Matthew Auld wrote: On 03/02/2022 09:48, Thomas Hellström wrote: On 1/26/22 16:21, Matthew Auld wrote: Just pass along the probed io_size. The backend should be able to utilize the entire range here, even if some

Re: [Intel-gfx] [PATCH 17/20] drm/i915/uapi: add NEEDS_CPU_ACCESS hint

2022-02-03 Thread Matthew Auld
On 03/02/2022 09:28, Thomas Hellström wrote: On 1/26/22 16:21, Matthew Auld wrote: If set, force the allocation to be placed in the mappable portion of LMEM. One big restriction here is that system memory must be given as a potential placement for the object, that way we can always spill

Re: [Intel-gfx] [PATCH 19/20] drm/i915/lmem: don't treat small BAR as an error

2022-02-03 Thread Matthew Auld
On 03/02/2022 09:48, Thomas Hellström wrote: On 1/26/22 16:21, Matthew Auld wrote: Just pass along the probed io_size. The backend should be able to utilize the entire range here, even if some of it is non-mappable. Changes here LGTM. It does leave open with what to do with stolen local

Re: [Intel-gfx] [PATCH 18/20] drm/i915/uapi: forbid ALLOC_TOPDOWN for error capture

2022-02-03 Thread Matthew Auld
On 03/02/2022 09:43, Thomas Hellström wrote: On 1/26/22 16:21, Matthew Auld wrote: On platforms where there might be non-mappable LMEM, force userspace to mark the buffers with the correct hint. When dumping the BO contents during capture we need CPU access. Note this only applies to buffers

Re: [Intel-gfx] [PATCH 16/20] drm/i915/create: apply ALLOC_TOPDOWN by default

2022-02-03 Thread Matthew Auld
On 03/02/2022 09:17, Thomas Hellström wrote: On 1/26/22 16:21, Matthew Auld wrote: Starting from DG2+, when dealing with LMEM, we assume that by default all userspace allocations should be placed in the non-mappable portion of LMEM.  Note that dumb buffers are not included here, since

Re: [Intel-gfx] [PATCH 14/20] drm/i915/selftests: exercise mmap migration

2022-02-03 Thread Matthew Auld
On 03/02/2022 09:01, Thomas Hellström wrote: On 1/26/22 16:21, Matthew Auld wrote: Exercise each of the migration scenarios, verifying that the final placement and buffer contents match our expectations. Signed-off-by: Matthew Auld Cc: Thomas Hellström ---   .../drm/i915/gem/selftests

Re: [Intel-gfx] [PATCH 15/20] drm/i915/selftests: handle allocation failures

2022-02-03 Thread Matthew Auld
On 03/02/2022 09:05, Thomas Hellström wrote: On 1/26/22 16:21, Matthew Auld wrote: If we have to contend with non-mappable LMEM, then we need to ensure the object fits within the mappable portion, like in the selftests, where we later try to CPU access the pages. However if it can't then we

[Intel-gfx] [PATCH] drm/i915: opportunistically apply ALLOC_CONTIGIOUS

2022-02-02 Thread Matthew Auld
this might prove to be potentially useful. Signed-off-by: Matthew Auld Cc: Thomas Hellström --- drivers/gpu/drm/i915/gem/i915_gem_region.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/i915/gem/i915_gem_region.c b/drivers/gpu/drm/i915/gem/i915_gem_region.c index a4350227e9ae

Re: [Intel-gfx] [PATCH v5 07/19] drm/i915/migrate: add acceleration support for DG2

2022-02-01 Thread Matthew Auld
On 01/02/2022 10:41, Ramalingam C wrote: From: Matthew Auld This is all kinds of awkward since we now have to contend with using 64K GTT pages when mapping anything in LMEM(including the page-tables themselves). v2: Rebased [Ram] Signed-off-by: Matthew Auld Cc: Thomas Hellström Cc

Re: [Intel-gfx] [PATCH] drm/i915/ttm: Return some errors instead of trying memcpy move

2022-02-01 Thread Matthew Auld
propagate those codes, rather than retrying with a memcpy move. Fixes: 2b0a750caf33 ("drm/i915/ttm: Failsafe migration blits") Cc: Matthew Auld Signed-off-by: Thomas Hellström Reviewed-by: Matthew Auld

Re: [Intel-gfx] [PATCH 06/20] drm/i915: add I915_BO_ALLOC_TOPDOWN

2022-01-31 Thread Matthew Auld
On 31/01/2022 15:28, Thomas Hellström wrote: On 1/26/22 16:21, Matthew Auld wrote: If the user doesn't require CPU access for the buffer, then ALLOC_TOPDOWN should be used, in order to prioritise allocating in the non-mappable portion of LMEM. Signed-off-by: Matthew Auld Cc: Thomas Hellström

Re: [Intel-gfx] [PATCH 4/5] drm/i915/dg2: Add Wa_22011100796

2022-01-31 Thread Matthew Auld
ed-off-by: Ramalingam C Acked-by: Matthew Auld

Re: [Intel-gfx] [PATCH 2/5] drm/i915: align the plane_vma to min_page_size of stolen mem

2022-01-31 Thread Matthew Auld
On Mon, 31 Jan 2022 at 10:18, Matthew Auld wrote: > > On 28/01/2022 18:52, Ramalingam C wrote: > > Align the plane vma size to the stolem memory regions' min_page_size. > > > > Signed-off-by: Ramalingam C > > cc: Matthew Auld > > cc: Chris P Wilson >

Re: [Intel-gfx] [PATCH 3/5] drm/i915: More gt idling time with guc submission

2022-01-31 Thread Matthew Auld
. Idling of the gt has to wait for all this to complete which is taking ~3sec for this test. Hence we are increasing the igt_flush_test's timeout for gt idling to 3Sec. Signed-off-by: Ramalingam C cc: Matthew Brost Acked-by: Matthew Auld

Re: [Intel-gfx] [PATCH 2/5] drm/i915: align the plane_vma to min_page_size of stolen mem

2022-01-31 Thread Matthew Auld
On 28/01/2022 18:52, Ramalingam C wrote: Align the plane vma size to the stolem memory regions' min_page_size. Signed-off-by: Ramalingam C cc: Matthew Auld cc: Chris P Wilson Reviewed-by: Matthew Auld

Re: [Intel-gfx] [PATCH v11 5/5] drm/amdgpu: add drm buddy support to amdgpu

2022-01-28 Thread Matthew Auld
On Thu, 27 Jan 2022 at 14:11, Arunpravin wrote: > > - Remove drm_mm references and replace with drm buddy functionalities > - Add res cursor support for drm buddy > > v2(Matthew Auld): > - replace spinlock with mutex as we call kmem_cache_zalloc > (..., GFP_KERNE

Re: [Intel-gfx] [PATCH 2/2] drm/i915/gt: Re-work invalidate_csb_entries

2022-01-28 Thread Matthew Auld
clflush((void *)first); > - clflush((void *)last); > + drm_clflush_virt_range((void *)first, sizeof(*first)); > + drm_clflush_virt_range((void *)last, sizeof(*last)); Could maybe drop the (void *) casting, Reviewed-by: Matthew Auld > } > > /* > -- > 2.25.1 >

Re: [Intel-gfx] [PATCH 1/2] drm/i915/gt: Re-work intel_write_status_page

2022-01-28 Thread Matthew Auld
On Thu, 27 Jan 2022 at 23:41, Michael Cheng wrote: > > Re-work intel_write_status_page to use drm_clflush_virt_range. This > will prevent compiler errors when building for non-x86 architectures. > > Signed-off-by: Michael Cheng > --- > drivers/gpu/drm/i915/gt/intel_engine.h | 13 - >

[Intel-gfx] [PATCH 20/20] HAX: DG1 small BAR

2022-01-26 Thread Matthew Auld
Just for CI. Signed-off-by: Matthew Auld --- drivers/gpu/drm/i915/gem/i915_gem_create.c | 5 ++--- drivers/gpu/drm/i915/gt/intel_region_lmem.c | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/i915/gem/i915_gem_create.c b/drivers/gpu/drm/i915/gem

[Intel-gfx] [PATCH 17/20] drm/i915/uapi: add NEEDS_CPU_ACCESS hint

2022-01-26 Thread Matthew Auld
IGTs. Including now just for the sake of having more complete picture. Signed-off-by: Matthew Auld Cc: Thomas Hellström --- drivers/gpu/drm/i915/gem/i915_gem_create.c | 28 --- include/uapi/drm/i915_drm.h| 31 +- 2 files changed, 49 insertions

[Intel-gfx] [PATCH 13/20] drm/i915/ttm: mappable migration on fault

2022-01-26 Thread Matthew Auld
placements permit it. Signed-off-by: Matthew Auld Cc: Thomas Hellström --- drivers/gpu/drm/i915/gem/i915_gem_ttm.c | 58 ++--- 1 file changed, 52 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/i915/gem/i915_gem_ttm.c b/drivers/gpu/drm/i915/gem/i915_gem_ttm.c index

[Intel-gfx] [PATCH 16/20] drm/i915/create: apply ALLOC_TOPDOWN by default

2022-01-26 Thread Matthew Auld
userspace will be able to provide a hint if CPU access to the buffer is needed. Signed-off-by: Matthew Auld Cc: Thomas Hellström --- drivers/gpu/drm/i915/gem/i915_gem_create.c | 9 + 1 file changed, 9 insertions(+) diff --git a/drivers/gpu/drm/i915/gem/i915_gem_create.c b/drivers/gpu/dr

[Intel-gfx] [PATCH 19/20] drm/i915/lmem: don't treat small BAR as an error

2022-01-26 Thread Matthew Auld
Just pass along the probed io_size. The backend should be able to utilize the entire range here, even if some of it is non-mappable. It does leave open with what to do with stolen local-memory. Signed-off-by: Matthew Auld Cc: Thomas Hellström --- drivers/gpu/drm/i915/gt/intel_region_lmem.c

[Intel-gfx] [PATCH 15/20] drm/i915/selftests: handle allocation failures

2022-01-26 Thread Matthew Auld
will return -ENOMEM if the object can't be placed. Signed-off-by: Matthew Auld Cc: Thomas Hellström --- drivers/gpu/drm/i915/gem/selftests/huge_pages.c | 2 +- drivers/gpu/drm/i915/selftests/intel_memory_region.c | 8 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers

[Intel-gfx] [PATCH 18/20] drm/i915/uapi: forbid ALLOC_TOPDOWN for error capture

2022-01-26 Thread Matthew Auld
On platforms where there might be non-mappable LMEM, force userspace to mark the buffers with the correct hint. When dumping the BO contents during capture we need CPU access. Note this only applies to buffers that can be placed in LMEM, and also doesn't impact DG1. Signed-off-by: Matthew Auld

[Intel-gfx] [PATCH 14/20] drm/i915/selftests: exercise mmap migration

2022-01-26 Thread Matthew Auld
Exercise each of the migration scenarios, verifying that the final placement and buffer contents match our expectations. Signed-off-by: Matthew Auld Cc: Thomas Hellström --- .../drm/i915/gem/selftests/i915_gem_mman.c| 306 ++ 1 file changed, 306 insertions(+) diff --git

[Intel-gfx] [PATCH 09/20] drm/i915/buddy: tweak 2big check

2022-01-26 Thread Matthew Auld
Otherwise we get -EINVAL, instead of the more useful -E2BIG if the allocation doesn't fit within the pfn range, like with mappable lmem. The hugepages selftest, for example, needs this to know if a smaller size is needed. Signed-off-by: Matthew Auld Cc: Thomas Hellström --- drivers/gpu/drm

[Intel-gfx] [PATCH 12/20] drm/i915/ttm: make eviction mappable aware

2022-01-26 Thread Matthew Auld
we hopefully victimize these last. Signed-off-by: Matthew Auld Cc: Thomas Hellström --- drivers/gpu/drm/i915/gem/i915_gem_ttm.c | 65 - 1 file changed, 63 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/gem/i915_gem_ttm.c b/drivers/gpu/drm/i915/gem

[Intel-gfx] [PATCH 08/20] drm/i915/buddy: adjust res->start

2022-01-26 Thread Matthew Auld
result in an actual move, instead of being turned into a noop. Signed-off-by: Matthew Auld Cc: Thomas Hellström --- drivers/gpu/drm/i915/i915_ttm_buddy_manager.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/gpu/drm/i915/i915_ttm_buddy_manager.c b/drivers/gpu/dr

[Intel-gfx] [PATCH 11/20] drm/i915/ttm: tweak priority hint selection

2022-01-26 Thread Matthew Auld
For some reason we are selecting PRIO_HAS_PAGES when we don't have mm.pages, and vice versa. Perhaps something else is going on here. Signed-off-by: Matthew Auld Cc: Thomas Hellström --- drivers/gpu/drm/i915/gem/i915_gem_ttm.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff

<    3   4   5   6   7   8   9   10   11   12   >