Re: [PATCH v10 00/23] drm/i915/vm_bind: Add VM_BIND functionality

2023-04-13 Thread Niranjana Vishwanathapura
On Tue, Jan 17, 2023 at 11:15:46PM -0800, Niranjana Vishwanathapura wrote: DRM_I915_GEM_VM_BIND/UNBIND ioctls allows UMD to bind/unbind GEM buffer objects (BOs) or sections of a BOs at specified GPU virtual addresses on a specified address space (VM). Multiple mappings can map to the same

Re: [PATCH drm-next 03/14] drm: manager to keep track of GPUs VA mappings

2023-01-24 Thread Niranjana Vishwanathapura
On Tue, Jan 24, 2023 at 01:11:55AM +0100, Danilo Krummrich wrote: On 1/24/23 00:23, Niranjana Vishwanathapura wrote: On Wed, Jan 18, 2023 at 07:12:45AM +0100, Danilo Krummrich wrote: This adds the infrastructure for a manager implementation to keep track of GPU virtual address (VA) mappings

Re: [PATCH drm-next 03/14] drm: manager to keep track of GPUs VA mappings

2023-01-23 Thread Niranjana Vishwanathapura
On Wed, Jan 18, 2023 at 07:12:45AM +0100, Danilo Krummrich wrote: This adds the infrastructure for a manager implementation to keep track of GPU virtual address (VA) mappings. New UAPIs, motivated by Vulkan sparse memory bindings graphics drivers start implementing, allow userspace applications

Re: [PATCH v10 23/23] drm/i915/vm_bind: Support capture of persistent mappings

2023-01-18 Thread Niranjana Vishwanathapura
On Wed, Jan 18, 2023 at 12:45:08PM +, Matthew Auld wrote: On 18/01/2023 07:16, Niranjana Vishwanathapura wrote: Support dump capture of persistent mappings upon user request. Capture of a mapping is requested with the VM_BIND ioctl and processed during the GPU error handling

[PATCH v10 21/23] drm/i915/vm_bind: Async vm_unbind support

2023-01-17 Thread Niranjana Vishwanathapura
with the unbind completion. v2: use i915_vma_destroy_async in vm_unbind ioctl v3: Add force_unbind function variants Reviewed-by: Matthew Auld Reviewed-by: Andi Shyti Signed-off-by: Niranjana Vishwanathapura --- .../drm/i915/gem/i915_gem_vm_bind_object.c| 2 +- drivers/gpu/drm/i915/i915_vma.c

[PATCH v10 23/23] drm/i915/vm_bind: Support capture of persistent mappings

2023-01-17 Thread Niranjana Vishwanathapura
lty Signed-off-by: Niranjana Vishwanathapura --- .../drm/i915/gem/i915_gem_vm_bind_object.c| 13 + drivers/gpu/drm/i915/gt/intel_gtt.c | 5 ++ drivers/gpu/drm/i915/gt/intel_gtt.h | 7 +++ drivers/gpu/drm/i915/i915_gem.c | 14 - drivers/gpu/drm/i

[PATCH v10 19/23] drm/i915/vm_bind: Add uapi for user to enable vm_bind_mode

2023-01-17 Thread Niranjana Vishwanathapura
atthew Auld Signed-off-by: Niranjana Vishwanathapura Signed-off-by: Andi Shyti --- drivers/gpu/drm/i915/gem/i915_gem_context.c | 25 ++-- drivers/gpu/drm/i915/gem/i915_gem_context.h | 3 +-- drivers/gpu/drm/i915/gt/intel_gtt.c | 2 ++ drivers/gpu/drm/i915/i915

[PATCH v10 15/23] drm/i915/vm_bind: Expose i915_request_await_bind()

2023-01-17 Thread Niranjana Vishwanathapura
Rename __i915_request_await_bind() as i915_request_await_bind() and make it non-static as it will be used in execbuf3 ioctl path. v2: add documentation Reviewed-by: Matthew Auld Reviewed-by: Andi Shyti Signed-off-by: Niranjana Vishwanathapura --- drivers/gpu/drm/i915/i915_vma.c | 8

[PATCH v10 17/23] drm/i915/vm_bind: userptr dma-resv changes

2023-01-17 Thread Niranjana Vishwanathapura
ed-off-by: Niranjana Vishwanathapura Signed-off-by: Andi Shyti --- .../gpu/drm/i915/gem/i915_gem_execbuffer3.c | 84 ++- drivers/gpu/drm/i915/gem/i915_gem_userptr.c | 19 + .../drm/i915/gem/i915_gem_vm_bind_object.c| 15 drivers/gpu/drm/i915/gt/intel_gtt.c | 2 + d

[PATCH v10 20/23] drm/i915/vm_bind: Render VM_BIND documentation

2023-01-17 Thread Niranjana Vishwanathapura
Update i915 documentation to include VM_BIND changes and render all VM_BIND related documentation. Reviewed-by: Matthew Auld Signed-off-by: Niranjana Vishwanathapura --- Documentation/gpu/i915.rst | 78 -- 1 file changed, 59 insertions(+), 19 deletions

[PATCH v10 18/23] drm/i915/vm_bind: Limit vm_bind mode to non-recoverable contexts

2023-01-17 Thread Niranjana Vishwanathapura
Only support vm_bind mode with non-recoverable contexts. With new vm_bind mode with eb3 submission path, we need not support older recoverable contexts. Reviewed-by: Matthew Auld Signed-off-by: Niranjana Vishwanathapura --- drivers/gpu/drm/i915/gem/i915_gem_context.c | 6 ++ 1 file changed

[PATCH v10 05/23] drm/i915/vm_bind: Add support to create persistent vma

2023-01-17 Thread Niranjana Vishwanathapura
to the same gtt_view of object. Skip vma_lookup for persistent vmas to support aliasing. v2: Remove unused I915_VMA_PERSISTENT definition, update validity check in i915_vma_compare(), remove unwanted is_persistent check in release_references(). Reviewed-by: Matthew Auld Signed-off-by: Niranjana

[PATCH v10 11/23] drm/i915/vm_bind: Abstract out common execbuf functions

2023-01-17 Thread Niranjana Vishwanathapura
Auld Signed-off-by: Niranjana Vishwanathapura --- drivers/gpu/drm/i915/Makefile | 1 + .../drm/i915/gem/i915_gem_execbuffer_common.c | 671 ++ .../drm/i915/gem/i915_gem_execbuffer_common.h | 76 ++ 3 files changed, 748 insertions(+) create mode 100644 drivers/gpu

[PATCH v10 09/23] drm/i915/vm_bind: Support persistent vma activeness tracking

2023-01-17 Thread Niranjana Vishwanathapura
ath. Update i915_vma_is_active(), i915_vma_sync() and the __i915_vma_unbind_async() functions to properly handle persistent vmas. v2: Ensure lvalue of dma_resv_wait_timeout() call is long. v3: Do not await for purged vmas to become idle during async unbind Reviewed-by: Andi Shyti Signed-off-b

[PATCH v10 13/23] drm/i915/vm_bind: Implement I915_GEM_EXECBUFFER3 ioctl

2023-01-17 Thread Niranjana Vishwanathapura
ted krealloc() and address other review comments. Reviewed-by: Matthew Auld Signed-off-by: Niranjana Vishwanathapura Signed-off-by: Andi Shyti --- drivers/gpu/drm/i915/Makefile | 1 + .../gpu/drm/i915/gem/i915_gem_execbuffer3.c | 579 ++ drivers/gpu/drm/i915/

[PATCH v10 08/23] drm/i915/vm_bind: Add support to handle object evictions

2023-01-17 Thread Niranjana Vishwanathapura
Auld Signed-off-by: Niranjana Vishwanathapura Signed-off-by: Andi Shyti --- .../drm/i915/gem/i915_gem_vm_bind_object.c| 6 drivers/gpu/drm/i915/gt/intel_gtt.c | 2 ++ drivers/gpu/drm/i915/gt/intel_gtt.h | 4 +++ drivers/gpu/drm/i915/i915_vma.c | 28

[PATCH v10 04/23] drm/i915/vm_bind: Support partially mapped vma resource

2023-01-17 Thread Niranjana Vishwanathapura
As persistent vmas can be partialled mapped to an object, remove restriction which require vma resource sg table to be just pointer to object's sg table. Reviewed-by: Matthew Auld Signed-off-by: Niranjana Vishwanathapura --- drivers/gpu/drm/i915/i915_vma.c | 3 +-- 1 file changed, 1 insertion

[PATCH v10 03/23] drm/i915/vm_bind: Expose i915_gem_object_max_page_size()

2023-01-17 Thread Niranjana Vishwanathapura
Expose i915_gem_object_max_page_size() function non-static which will be used by the vm_bind feature. Reviewed-by: Matthew Auld Signed-off-by: Niranjana Vishwanathapura Signed-off-by: Andi Shyti --- drivers/gpu/drm/i915/gem/i915_gem_create.c | 18 +- drivers/gpu/drm/i915/gem

[PATCH v10 06/23] drm/i915/vm_bind: Implement bind and unbind of object

2023-01-17 Thread Niranjana Vishwanathapura
check with i915_gem_vm_is_vm_bind_mode(). v5: Ensure all reserved fields are 0, use PIN_NOEVICT. v6: Add reserved fields to drm_i915_gem_vm_bind. Reviewed-by: Matthew Auld Signed-off-by: Niranjana Vishwanathapura Signed-off-by: Prathap Kumar Valsan Signed-off-by: Andi Shyti --- drivers/gpu/dr

[PATCH v10 14/23] drm/i915/vm_bind: Update i915_vma_verify_bind_complete()

2023-01-17 Thread Niranjana Vishwanathapura
Ensure i915_vma_verify_bind_complete() handles case where bind is not initiated. Also make it non static, add documentation and move it out of CONFIG_DRM_I915_DEBUG_GEM. v2: Fix fence leak Reviewed-by: Matthew Auld Signed-off-by: Niranjana Vishwanathapura Signed-off-by: Andi Shyti

[PATCH v10 01/23] drm/i915/vm_bind: Expose vm lookup function

2023-01-17 Thread Niranjana Vishwanathapura
Make i915_gem_vm_lookup() function non-static as it will be used by the vm_bind feature. Reviewed-by: Matthew Auld Signed-off-by: Niranjana Vishwanathapura Signed-off-by: Andi Shyti --- drivers/gpu/drm/i915/gem/i915_gem_context.c | 11 ++- drivers/gpu/drm/i915/gem/i915_gem_context.h

[PATCH v10 07/23] drm/i915/vm_bind: Support for VM private BOs

2023-01-17 Thread Niranjana Vishwanathapura
vm->root_obj yet. Allow vm private object creation only in vm_bind mode. Replace vm->vm_bind_mode check with i915_gem_vm_is_vm_bind_mode(). Reviewed-by: Matthew Auld Signed-off-by: Niranjana Vishwanathapura Signed-off-by: Andi Shyti --- drivers/gpu/drm/i915/gem/i915_gem_context

[PATCH v10 02/23] drm/i915/vm_bind: Add __i915_sw_fence_await_reservation()

2023-01-17 Thread Niranjana Vishwanathapura
Add function __i915_sw_fence_await_reservation() for asynchronous wait on a dma-resv object with specified dma_resv_usage. This is required for async vma unbind with vm_bind. Reviewed-by: Matthew Auld Signed-off-by: Niranjana Vishwanathapura --- drivers/gpu/drm/i915/i915_sw_fence.c | 28

[PATCH v10 10/23] drm/i915/vm_bind: Add out fence support

2023-01-17 Thread Niranjana Vishwanathapura
iff I915_TIMELINE_FENCE_SIGNAL is not specified. v5: Ensure __I915_TIMELINE_FENCE_UNKNOWN_FLAGS are not set. Reviewed-by: Matthew Auld Signed-off-by: Niranjana Vishwanathapura Signed-off-by: Andi Shyti --- drivers/gpu/drm/i915/gem/i915_gem_vm_bind.h | 4 + .../drm/i915/

[PATCH v10 12/23] drm/i915/vm_bind: Use common execbuf functions in execbuf path

2023-01-17 Thread Niranjana Vishwanathapura
Update the execbuf path to use common execbuf functions to reduce code duplication with the newer execbuf3 path. Reviewed-by: Matthew Auld Signed-off-by: Niranjana Vishwanathapura --- .../gpu/drm/i915/gem/i915_gem_execbuffer.c| 513 ++ 1 file changed, 39 insertions(+), 474

[PATCH v10 16/23] drm/i915/vm_bind: Handle persistent vmas in execbuf3

2023-01-17 Thread Niranjana Vishwanathapura
, use proper lock while checking if vm_rebind_list is empty. Reviewed-by: Matthew Auld Signed-off-by: Niranjana Vishwanathapura Signed-off-by: Andi Shyti --- .../gpu/drm/i915/gem/i915_gem_execbuffer3.c | 215 +- 1 file changed, 214 insertions(+), 1 deletion(-) diff --git

[PATCH v10 22/23] drm/i915/vm_bind: Properly build persistent map sg table

2023-01-17 Thread Niranjana Vishwanathapura
Properly build the sg table for persistent mapping which can be partial map of the underlying object. Ensure the sg pages are properly set for page backed regions. The dump capture support requires this for page backed regions. v2: Remove redundant sg_mark_end() call Signed-off-by: Niranjana

[PATCH v10 00/23] drm/i915/vm_bind: Add VM_BIND functionality

2023-01-17 Thread Niranjana Vishwanathapura
anjana Vishwanathapura Niranjana Vishwanathapura (23): drm/i915/vm_bind: Expose vm lookup function drm/i915/vm_bind: Add __i915_sw_fence_await_reservation() drm/i915/vm_bind: Expose i915_gem_object_max_page_size() drm/i915/vm_bind: Support partially mapped vma resource drm/i915/vm_bin

Re: [PATCH v9 23/23] drm/i915/vm_bind: Support capture of persistent mappings

2023-01-17 Thread Niranjana Vishwanathapura
On Tue, Dec 13, 2022 at 12:03:07PM +, Matthew Auld wrote: On 12/12/2022 23:15, Niranjana Vishwanathapura wrote: Support dump capture of persistent mappings upon user request. Capture of a mapping is requested with the VM_BIND ioctl and processed during the GPU error handling, thus

Re: [PATCH v9 10/23] drm/i915/vm_bind: Add out fence support

2023-01-13 Thread Niranjana Vishwanathapura
On Tue, Jan 10, 2023 at 05:48:45PM -0800, Zanoni, Paulo R wrote: On Mon, 2022-12-12 at 15:15 -0800, Niranjana Vishwanathapura wrote: Add support for handling out fence for vm_bind call. v2: Reset vma->vm_bind_fence.syncobj to NULL at the end of vm_bind call. v3: Remove vm_unbind out fe

Re: [PATCH v8 21/22] drm/i915/vm_bind: Properly build persistent map sg table

2022-12-13 Thread Niranjana Vishwanathapura
On Mon, Dec 12, 2022 at 06:17:01PM +, Matthew Auld wrote: On 29/11/2022 07:26, Niranjana Vishwanathapura wrote: Properly build the sg table for persistent mapping which can be partial map of the underlying object. Ensure the sg pages are properly set for page backed regions. The dump

[PATCH v9 22/23] drm/i915/vm_bind: Properly build persistent map sg table

2022-12-12 Thread Niranjana Vishwanathapura
Properly build the sg table for persistent mapping which can be partial map of the underlying object. Ensure the sg pages are properly set for page backed regions. The dump capture support requires this for page backed regions. Signed-off-by: Niranjana Vishwanathapura --- drivers/gpu/drm/i915

[PATCH v9 20/23] drm/i915/vm_bind: Render VM_BIND documentation

2022-12-12 Thread Niranjana Vishwanathapura
Update i915 documentation to include VM_BIND changes and render all VM_BIND related documentation. Reviewed-by: Matthew Auld Signed-off-by: Niranjana Vishwanathapura --- Documentation/gpu/i915.rst | 78 -- 1 file changed, 59 insertions(+), 19 deletions

[PATCH v9 18/23] drm/i915/vm_bind: Limit vm_bind mode to non-recoverable contexts

2022-12-12 Thread Niranjana Vishwanathapura
Only support vm_bind mode with non-recoverable contexts. With new vm_bind mode with eb3 submission path, we need not support older recoverable contexts. Reviewed-by: Matthew Auld Signed-off-by: Niranjana Vishwanathapura --- drivers/gpu/drm/i915/gem/i915_gem_context.c | 6 ++ 1 file changed

[PATCH v9 19/23] drm/i915/vm_bind: Add uapi for user to enable vm_bind_mode

2022-12-12 Thread Niranjana Vishwanathapura
atthew Auld Signed-off-by: Niranjana Vishwanathapura Signed-off-by: Andi Shyti --- drivers/gpu/drm/i915/gem/i915_gem_context.c | 25 ++-- drivers/gpu/drm/i915/gem/i915_gem_context.h | 3 +-- drivers/gpu/drm/i915/gt/intel_gtt.c | 2 ++ drivers/gpu/drm/i915/i915

[PATCH v9 15/23] drm/i915/vm_bind: Expose i915_request_await_bind()

2022-12-12 Thread Niranjana Vishwanathapura
Rename __i915_request_await_bind() as i915_request_await_bind() and make it non-static as it will be used in execbuf3 ioctl path. v2: add documentation Reviewed-by: Matthew Auld Reviewed-by: Andi Shyti Signed-off-by: Niranjana Vishwanathapura --- drivers/gpu/drm/i915/i915_vma.c | 8

[PATCH v9 14/23] drm/i915/vm_bind: Update i915_vma_verify_bind_complete()

2022-12-12 Thread Niranjana Vishwanathapura
Ensure i915_vma_verify_bind_complete() handles case where bind is not initiated. Also make it non static, add documentation and move it out of CONFIG_DRM_I915_DEBUG_GEM. v2: Fix fence leak Reviewed-by: Matthew Auld Signed-off-by: Niranjana Vishwanathapura Signed-off-by: Andi Shyti

[PATCH v9 17/23] drm/i915/vm_bind: userptr dma-resv changes

2022-12-12 Thread Niranjana Vishwanathapura
ed-off-by: Niranjana Vishwanathapura Signed-off-by: Andi Shyti --- .../gpu/drm/i915/gem/i915_gem_execbuffer3.c | 84 ++- drivers/gpu/drm/i915/gem/i915_gem_userptr.c | 19 + .../drm/i915/gem/i915_gem_vm_bind_object.c| 15 drivers/gpu/drm/i915/gt/intel_gtt.c | 2 + d

[PATCH v9 12/23] drm/i915/vm_bind: Use common execbuf functions in execbuf path

2022-12-12 Thread Niranjana Vishwanathapura
Update the execbuf path to use common execbuf functions to reduce code duplication with the newer execbuf3 path. Reviewed-by: Matthew Auld Signed-off-by: Niranjana Vishwanathapura --- .../gpu/drm/i915/gem/i915_gem_execbuffer.c| 513 ++ 1 file changed, 39 insertions(+), 474

[PATCH v9 05/23] drm/i915/vm_bind: Add support to create persistent vma

2022-12-12 Thread Niranjana Vishwanathapura
to the same gtt_view of object. Skip vma_lookup for persistent vmas to support aliasing. v2: Remove unused I915_VMA_PERSISTENT definition, update validity check in i915_vma_compare(), remove unwanted is_persistent check in release_references(). Reviewed-by: Matthew Auld Signed-off-by: Niranjana

[PATCH v9 21/23] drm/i915/vm_bind: Async vm_unbind support

2022-12-12 Thread Niranjana Vishwanathapura
with the unbind completion. v2: use i915_vma_destroy_async in vm_unbind ioctl v3: Add force_unbind function variants Reviewed-by: Matthew Auld Reviewed-by: Andi Shyti Signed-off-by: Niranjana Vishwanathapura --- .../drm/i915/gem/i915_gem_vm_bind_object.c| 2 +- drivers/gpu/drm/i915/i915_vma.c

[PATCH v9 11/23] drm/i915/vm_bind: Abstract out common execbuf functions

2022-12-12 Thread Niranjana Vishwanathapura
Auld Signed-off-by: Niranjana Vishwanathapura --- drivers/gpu/drm/i915/Makefile | 1 + .../drm/i915/gem/i915_gem_execbuffer_common.c | 671 ++ .../drm/i915/gem/i915_gem_execbuffer_common.h | 76 ++ 3 files changed, 748 insertions(+) create mode 100644 drivers/gpu

[PATCH v9 16/23] drm/i915/vm_bind: Handle persistent vmas in execbuf3

2022-12-12 Thread Niranjana Vishwanathapura
, use proper lock while checking if vm_rebind_list is empty. Reviewed-by: Matthew Auld Signed-off-by: Niranjana Vishwanathapura Signed-off-by: Andi Shyti --- .../gpu/drm/i915/gem/i915_gem_execbuffer3.c | 215 +- 1 file changed, 214 insertions(+), 1 deletion(-) diff --git

[PATCH v9 23/23] drm/i915/vm_bind: Support capture of persistent mappings

2022-12-12 Thread Niranjana Vishwanathapura
of a list of vma resources. This allows for no additional handling around eviction. v2: enable with CONFIG_DRM_I915_CAPTURE_ERROR, remove gfp overwrite, add kernel-doc and expand commit message Signed-off-by: Brian Welty Signed-off-by: Niranjana Vishwanathapura --- .../gpu/drm/i915/gem

[PATCH v9 07/23] drm/i915/vm_bind: Support for VM private BOs

2022-12-12 Thread Niranjana Vishwanathapura
vm->root_obj yet. Allow vm private object creation only in vm_bind mode. Replace vm->vm_bind_mode check with i915_gem_vm_is_vm_bind_mode(). Reviewed-by: Matthew Auld Signed-off-by: Niranjana Vishwanathapura Signed-off-by: Andi Shyti --- drivers/gpu/drm/i915/gem/i915_gem_context

[PATCH v9 08/23] drm/i915/vm_bind: Add support to handle object evictions

2022-12-12 Thread Niranjana Vishwanathapura
Auld Signed-off-by: Niranjana Vishwanathapura Signed-off-by: Andi Shyti --- .../drm/i915/gem/i915_gem_vm_bind_object.c| 6 drivers/gpu/drm/i915/gt/intel_gtt.c | 2 ++ drivers/gpu/drm/i915/gt/intel_gtt.h | 4 +++ drivers/gpu/drm/i915/i915_vma.c | 28

[PATCH v9 02/23] drm/i915/vm_bind: Add __i915_sw_fence_await_reservation()

2022-12-12 Thread Niranjana Vishwanathapura
Add function __i915_sw_fence_await_reservation() for asynchronous wait on a dma-resv object with specified dma_resv_usage. This is required for async vma unbind with vm_bind. Reviewed-by: Matthew Auld Signed-off-by: Niranjana Vishwanathapura --- drivers/gpu/drm/i915/i915_sw_fence.c | 28

[PATCH v9 06/23] drm/i915/vm_bind: Implement bind and unbind of object

2022-12-12 Thread Niranjana Vishwanathapura
check with i915_gem_vm_is_vm_bind_mode(). v5: Ensure all reserved fields are 0, use PIN_NOEVICT. v6: Add reserved fields to drm_i915_gem_vm_bind. Reviewed-by: Matthew Auld Signed-off-by: Niranjana Vishwanathapura Signed-off-by: Prathap Kumar Valsan Signed-off-by: Andi Shyti --- drivers/gpu/dr

[PATCH v9 13/23] drm/i915/vm_bind: Implement I915_GEM_EXECBUFFER3 ioctl

2022-12-12 Thread Niranjana Vishwanathapura
ted krealloc() and address other review comments. Reviewed-by: Matthew Auld Signed-off-by: Niranjana Vishwanathapura Signed-off-by: Andi Shyti --- drivers/gpu/drm/i915/Makefile | 1 + .../gpu/drm/i915/gem/i915_gem_execbuffer3.c | 579 ++ drivers/gpu/drm/i915/

[PATCH v9 03/23] drm/i915/vm_bind: Expose i915_gem_object_max_page_size()

2022-12-12 Thread Niranjana Vishwanathapura
Expose i915_gem_object_max_page_size() function non-static which will be used by the vm_bind feature. Reviewed-by: Matthew Auld Signed-off-by: Niranjana Vishwanathapura Signed-off-by: Andi Shyti --- drivers/gpu/drm/i915/gem/i915_gem_create.c | 18 +- drivers/gpu/drm/i915/gem

[PATCH v9 09/23] drm/i915/vm_bind: Support persistent vma activeness tracking

2022-12-12 Thread Niranjana Vishwanathapura
ath. Update i915_vma_is_active(), i915_vma_sync() and the __i915_vma_unbind_async() functions to properly handle persistent vmas. v2: Ensure lvalue of dma_resv_wait_timeout() call is long. Reviewed-by: Andi Shyti Signed-off-by: Niranjana Vishwanathapura --- drivers/gpu/drm/i915/i915_ge

[PATCH v9 04/23] drm/i915/vm_bind: Support partially mapped vma resource

2022-12-12 Thread Niranjana Vishwanathapura
As persistent vmas can be partialled mapped to an object, remove restriction which require vma resource sg table to be just pointer to object's sg table. Reviewed-by: Matthew Auld Signed-off-by: Niranjana Vishwanathapura --- drivers/gpu/drm/i915/i915_vma.c | 3 +-- 1 file changed, 1 insertion

[PATCH v9 10/23] drm/i915/vm_bind: Add out fence support

2022-12-12 Thread Niranjana Vishwanathapura
iff I915_TIMELINE_FENCE_SIGNAL is not specified. v5: Ensure __I915_TIMELINE_FENCE_UNKNOWN_FLAGS are not set. Reviewed-by: Matthew Auld Signed-off-by: Niranjana Vishwanathapura Signed-off-by: Andi Shyti --- drivers/gpu/drm/i915/gem/i915_gem_vm_bind.h | 4 + .../drm/i915/

[PATCH v9 01/23] drm/i915/vm_bind: Expose vm lookup function

2022-12-12 Thread Niranjana Vishwanathapura
Make i915_gem_vm_lookup() function non-static as it will be used by the vm_bind feature. Reviewed-by: Matthew Auld Signed-off-by: Niranjana Vishwanathapura Signed-off-by: Andi Shyti --- drivers/gpu/drm/i915/gem/i915_gem_context.c | 11 ++- drivers/gpu/drm/i915/gem/i915_gem_context.h

[PATCH v9 00/23] drm/i915/vm_bind: Add VM_BIND functionality

2022-12-12 Thread Niranjana Vishwanathapura
ind support v7: Rebased, minor cleanups as per review feedback v8: Rebased, add capture support v9: Address capture support feedback from v8 Test-with: 20221212231254.2303-1-niranjana.vishwanathap...@intel.com Signed-off-by: Niranjana Vishwanathapura Niranjana Vishwanathapura (23): drm/i915/vm_b

Re: [Intel-gfx] [PATCH v8 22/22] drm/i915/vm_bind: Support capture of persistent mappings

2022-12-08 Thread Niranjana Vishwanathapura
On Tue, Dec 06, 2022 at 05:40:54PM +, Matthew Auld wrote: On 01/12/2022 18:43, Niranjana Vishwanathapura wrote: On Thu, Dec 01, 2022 at 07:27:31AM -0800, Niranjana Vishwanathapura wrote: On Thu, Dec 01, 2022 at 10:49:15AM +, Matthew Auld wrote: On 29/11/2022 07:26, Niranjana

Re: [Intel-gfx] [PATCH v8 22/22] drm/i915/vm_bind: Support capture of persistent mappings

2022-12-01 Thread Niranjana Vishwanathapura
On Thu, Dec 01, 2022 at 07:27:31AM -0800, Niranjana Vishwanathapura wrote: On Thu, Dec 01, 2022 at 10:49:15AM +, Matthew Auld wrote: On 29/11/2022 07:26, Niranjana Vishwanathapura wrote: Support dump capture of persistent mappings upon user request. Signed-off-by: Brian Welty Signed-off

Re: [PATCH v8 22/22] drm/i915/vm_bind: Support capture of persistent mappings

2022-12-01 Thread Niranjana Vishwanathapura
On Thu, Dec 01, 2022 at 10:49:15AM +, Matthew Auld wrote: On 29/11/2022 07:26, Niranjana Vishwanathapura wrote: Support dump capture of persistent mappings upon user request. Signed-off-by: Brian Welty Signed-off-by: Niranjana Vishwanathapura --- .../drm/i915/gem

Re: [PATCH v7 20/20] drm/i915/vm_bind: Async vm_unbind support

2022-12-01 Thread Niranjana Vishwanathapura
On Thu, Dec 01, 2022 at 10:10:14AM +, Matthew Auld wrote: On 29/11/2022 23:26, Niranjana Vishwanathapura wrote: On Wed, Nov 23, 2022 at 11:42:58AM +, Matthew Auld wrote: On 16/11/2022 00:37, Niranjana Vishwanathapura wrote: On Tue, Nov 15, 2022 at 03:15:03PM -0800, Niranjana

Re: [PATCH v7 00/20] drm/i915/vm_bind: Add VM_BIND functionality

2022-11-29 Thread Niranjana Vishwanathapura
On Fri, Nov 18, 2022 at 03:53:34PM -0800, Zanoni, Paulo R wrote: On Sat, 2022-11-12 at 23:57 -0800, Niranjana Vishwanathapura wrote: DRM_I915_GEM_VM_BIND/UNBIND ioctls allows UMD to bind/unbind GEM buffer objects (BOs) or sections of a BOs at specified GPU virtual addresses on a specified

Re: [PATCH v7 20/20] drm/i915/vm_bind: Async vm_unbind support

2022-11-29 Thread Niranjana Vishwanathapura
On Wed, Nov 23, 2022 at 11:42:58AM +, Matthew Auld wrote: On 16/11/2022 00:37, Niranjana Vishwanathapura wrote: On Tue, Nov 15, 2022 at 03:15:03PM -0800, Niranjana Vishwanathapura wrote: On Tue, Nov 15, 2022 at 08:33:47AM -0800, Niranjana Vishwanathapura wrote: On Tue, Nov 15, 2022 at 04

[PATCH v8 22/22] drm/i915/vm_bind: Support capture of persistent mappings

2022-11-28 Thread Niranjana Vishwanathapura
Support dump capture of persistent mappings upon user request. Signed-off-by: Brian Welty Signed-off-by: Niranjana Vishwanathapura --- .../drm/i915/gem/i915_gem_vm_bind_object.c| 11 +++ drivers/gpu/drm/i915/gt/intel_gtt.c | 3 +++ drivers/gpu/drm/i915/gt/intel_gtt.h

[PATCH v8 20/22] drm/i915/vm_bind: Async vm_unbind support

2022-11-28 Thread Niranjana Vishwanathapura
with the unbind completion. v2: use i915_vma_destroy_async in vm_unbind ioctl v3: Add force_unbind function variants Reviewed-by: Matthew Auld Reviewed-by: Andi Shyti Signed-off-by: Niranjana Vishwanathapura --- .../drm/i915/gem/i915_gem_vm_bind_object.c| 2 +- drivers/gpu/drm/i915/i915_vma.c

[PATCH v8 19/22] drm/i915/vm_bind: Render VM_BIND documentation

2022-11-28 Thread Niranjana Vishwanathapura
Update i915 documentation to include VM_BIND changes and render all VM_BIND related documentation. Reviewed-by: Matthew Auld Signed-off-by: Niranjana Vishwanathapura --- Documentation/gpu/i915.rst | 78 -- 1 file changed, 59 insertions(+), 19 deletions

[PATCH v8 06/22] drm/i915/vm_bind: Support for VM private BOs

2022-11-28 Thread Niranjana Vishwanathapura
vm->root_obj yet. Allow vm private object creation only in vm_bind mode. Replace vm->vm_bind_mode check with i915_gem_vm_is_vm_bind_mode(). Reviewed-by: Matthew Auld Signed-off-by: Niranjana Vishwanathapura Signed-off-by: Andi Shyti --- drivers/gpu/drm/i915/gem/i915_gem_context

[PATCH v8 21/22] drm/i915/vm_bind: Properly build persistent map sg table

2022-11-28 Thread Niranjana Vishwanathapura
Properly build the sg table for persistent mapping which can be partial map of the underlying object. Ensure the sg pages are properly set for page backed regions. The dump capture support requires this for page backed regions. Signed-off-by: Niranjana Vishwanathapura --- drivers/gpu/drm/i915

[PATCH v8 18/22] drm/i915/vm_bind: Add uapi for user to enable vm_bind_mode

2022-11-28 Thread Niranjana Vishwanathapura
atthew Auld Signed-off-by: Niranjana Vishwanathapura Signed-off-by: Andi Shyti --- drivers/gpu/drm/i915/gem/i915_gem_context.c | 25 ++-- drivers/gpu/drm/i915/gem/i915_gem_context.h | 3 +-- drivers/gpu/drm/i915/gt/intel_gtt.c | 2 ++ drivers/gpu/drm/i915/i915

[PATCH v8 15/22] drm/i915/vm_bind: Handle persistent vmas in execbuf3

2022-11-28 Thread Niranjana Vishwanathapura
, use proper lock while checking if vm_rebind_list is empty. Reviewed-by: Matthew Auld Signed-off-by: Niranjana Vishwanathapura Signed-off-by: Andi Shyti --- .../gpu/drm/i915/gem/i915_gem_execbuffer3.c | 215 +- 1 file changed, 214 insertions(+), 1 deletion(-) diff --git

[PATCH v8 13/22] drm/i915/vm_bind: Update i915_vma_verify_bind_complete()

2022-11-28 Thread Niranjana Vishwanathapura
Ensure i915_vma_verify_bind_complete() handles case where bind is not initiated. Also make it non static, add documentation and move it out of CONFIG_DRM_I915_DEBUG_GEM. v2: Fix fence leak Reviewed-by: Matthew Auld Signed-off-by: Niranjana Vishwanathapura Signed-off-by: Andi Shyti

[PATCH v8 07/22] drm/i915/vm_bind: Add support to handle object evictions

2022-11-28 Thread Niranjana Vishwanathapura
Auld Signed-off-by: Niranjana Vishwanathapura Signed-off-by: Andi Shyti --- .../drm/i915/gem/i915_gem_vm_bind_object.c| 6 drivers/gpu/drm/i915/gt/intel_gtt.c | 2 ++ drivers/gpu/drm/i915/gt/intel_gtt.h | 4 +++ drivers/gpu/drm/i915/i915_vma.c | 31

[PATCH v8 08/22] drm/i915/vm_bind: Support persistent vma activeness tracking

2022-11-28 Thread Niranjana Vishwanathapura
ath. Update i915_vma_is_active(), i915_vma_sync() and the __i915_vma_unbind_async() functions to properly handle persistent vmas. v2: Ensure lvalue of dma_resv_wait_timeout() call is long. Reviewed-by: Andi Shyti Signed-off-by: Niranjana Vishwanathapura --- drivers/gpu/drm/i915/i915_ge

[PATCH v8 14/22] drm/i915/vm_bind: Expose i915_request_await_bind()

2022-11-28 Thread Niranjana Vishwanathapura
Rename __i915_request_await_bind() as i915_request_await_bind() and make it non-static as it will be used in execbuf3 ioctl path. v2: add documentation Reviewed-by: Matthew Auld Reviewed-by: Andi Shyti Signed-off-by: Niranjana Vishwanathapura --- drivers/gpu/drm/i915/i915_vma.c | 8

[PATCH v8 17/22] drm/i915/vm_bind: Limit vm_bind mode to non-recoverable contexts

2022-11-28 Thread Niranjana Vishwanathapura
Only support vm_bind mode with non-recoverable contexts. With new vm_bind mode with eb3 submission path, we need not support older recoverable contexts. Reviewed-by: Matthew Auld Signed-off-by: Niranjana Vishwanathapura --- drivers/gpu/drm/i915/gem/i915_gem_context.c | 6 ++ 1 file changed

[PATCH v8 09/22] drm/i915/vm_bind: Add out fence support

2022-11-28 Thread Niranjana Vishwanathapura
iff I915_TIMELINE_FENCE_SIGNAL is not specified. v5: Ensure __I915_TIMELINE_FENCE_UNKNOWN_FLAGS are not set. Reviewed-by: Matthew Auld Signed-off-by: Niranjana Vishwanathapura Signed-off-by: Andi Shyti --- drivers/gpu/drm/i915/gem/i915_gem_vm_bind.h | 4 + .../drm/i915/

[PATCH v8 16/22] drm/i915/vm_bind: userptr dma-resv changes

2022-11-28 Thread Niranjana Vishwanathapura
ed-off-by: Niranjana Vishwanathapura Signed-off-by: Andi Shyti --- .../gpu/drm/i915/gem/i915_gem_execbuffer3.c | 84 ++- drivers/gpu/drm/i915/gem/i915_gem_userptr.c | 19 + .../drm/i915/gem/i915_gem_vm_bind_object.c| 15 drivers/gpu/drm/i915/gt/intel_gtt.c | 2 + d

[PATCH v8 03/22] drm/i915/vm_bind: Expose i915_gem_object_max_page_size()

2022-11-28 Thread Niranjana Vishwanathapura
Expose i915_gem_object_max_page_size() function non-static which will be used by the vm_bind feature. Reviewed-by: Matthew Auld Signed-off-by: Niranjana Vishwanathapura Signed-off-by: Andi Shyti --- drivers/gpu/drm/i915/gem/i915_gem_create.c | 18 +- drivers/gpu/drm/i915/gem

[PATCH v8 10/22] drm/i915/vm_bind: Abstract out common execbuf functions

2022-11-28 Thread Niranjana Vishwanathapura
Auld Signed-off-by: Niranjana Vishwanathapura --- drivers/gpu/drm/i915/Makefile | 1 + .../drm/i915/gem/i915_gem_execbuffer_common.c | 671 ++ .../drm/i915/gem/i915_gem_execbuffer_common.h | 76 ++ 3 files changed, 748 insertions(+) create mode 100644 drivers/gpu

[PATCH v8 11/22] drm/i915/vm_bind: Use common execbuf functions in execbuf path

2022-11-28 Thread Niranjana Vishwanathapura
Update the execbuf path to use common execbuf functions to reduce code duplication with the newer execbuf3 path. Reviewed-by: Matthew Auld Signed-off-by: Niranjana Vishwanathapura --- .../gpu/drm/i915/gem/i915_gem_execbuffer.c| 513 ++ 1 file changed, 39 insertions(+), 474

[PATCH v8 12/22] drm/i915/vm_bind: Implement I915_GEM_EXECBUFFER3 ioctl

2022-11-28 Thread Niranjana Vishwanathapura
ted krealloc() and address other review comments. Reviewed-by: Matthew Auld Signed-off-by: Niranjana Vishwanathapura Signed-off-by: Andi Shyti --- drivers/gpu/drm/i915/Makefile | 1 + .../gpu/drm/i915/gem/i915_gem_execbuffer3.c | 579 ++ drivers/gpu/drm/i915/

[PATCH v8 05/22] drm/i915/vm_bind: Implement bind and unbind of object

2022-11-28 Thread Niranjana Vishwanathapura
check with i915_gem_vm_is_vm_bind_mode(). v5: Ensure all reserved fields are 0, use PIN_NOEVICT. v6: Add reserved fields to drm_i915_gem_vm_bind. Reviewed-by: Matthew Auld Signed-off-by: Niranjana Vishwanathapura Signed-off-by: Prathap Kumar Valsan Signed-off-by: Andi Shyti --- drivers/gpu/dr

[PATCH v8 01/22] drm/i915/vm_bind: Expose vm lookup function

2022-11-28 Thread Niranjana Vishwanathapura
Make i915_gem_vm_lookup() function non-static as it will be used by the vm_bind feature. Reviewed-by: Matthew Auld Signed-off-by: Niranjana Vishwanathapura Signed-off-by: Andi Shyti --- drivers/gpu/drm/i915/gem/i915_gem_context.c | 11 ++- drivers/gpu/drm/i915/gem/i915_gem_context.h

[PATCH v8 04/22] drm/i915/vm_bind: Add support to create persistent vma

2022-11-28 Thread Niranjana Vishwanathapura
to the same gtt_view of object. Skip vma_lookup for persistent vmas to support aliasing. v2: Remove unused I915_VMA_PERSISTENT definition, update validity check in i915_vma_compare(), remove unwanted is_persistent check in release_references(). Reviewed-by: Matthew Auld Signed-off-by: Niranjana

[PATCH v8 02/22] drm/i915/vm_bind: Add __i915_sw_fence_await_reservation()

2022-11-28 Thread Niranjana Vishwanathapura
Add function __i915_sw_fence_await_reservation() for asynchronous wait on a dma-resv object with specified dma_resv_usage. This is required for async vma unbind with vm_bind. Reviewed-by: Matthew Auld Signed-off-by: Niranjana Vishwanathapura --- drivers/gpu/drm/i915/i915_sw_fence.c | 28

[PATCH v8 00/22] drm/i915/vm_bind: Add VM_BIND functionality

2022-11-28 Thread Niranjana Vishwanathapura
ind support v7: Rebased, minor cleanups as per review feedback v8: Rebased, add capture support Test-with: 20221129072355.769-1-niranjana.vishwanathap...@intel.com Signed-off-by: Niranjana Vishwanathapura Niranjana Vishwanathapura (22): drm/i915/vm_bind: Expose vm lookup function drm/i915/vm_b

Re: [PATCH v7 20/20] drm/i915/vm_bind: Async vm_unbind support

2022-11-15 Thread Niranjana Vishwanathapura
On Tue, Nov 15, 2022 at 03:15:03PM -0800, Niranjana Vishwanathapura wrote: On Tue, Nov 15, 2022 at 08:33:47AM -0800, Niranjana Vishwanathapura wrote: On Tue, Nov 15, 2022 at 04:20:54PM +, Matthew Auld wrote: On 15/11/2022 16:15, Niranjana Vishwanathapura wrote: On Tue, Nov 15, 2022 at 11

Re: [PATCH v7 20/20] drm/i915/vm_bind: Async vm_unbind support

2022-11-15 Thread Niranjana Vishwanathapura
On Tue, Nov 15, 2022 at 08:33:47AM -0800, Niranjana Vishwanathapura wrote: On Tue, Nov 15, 2022 at 04:20:54PM +, Matthew Auld wrote: On 15/11/2022 16:15, Niranjana Vishwanathapura wrote: On Tue, Nov 15, 2022 at 11:05:21AM +, Matthew Auld wrote: On 13/11/2022 07:57, Niranjana

Re: [PATCH v7 20/20] drm/i915/vm_bind: Async vm_unbind support

2022-11-15 Thread Niranjana Vishwanathapura
On Tue, Nov 15, 2022 at 04:20:54PM +, Matthew Auld wrote: On 15/11/2022 16:15, Niranjana Vishwanathapura wrote: On Tue, Nov 15, 2022 at 11:05:21AM +, Matthew Auld wrote: On 13/11/2022 07:57, Niranjana Vishwanathapura wrote: Asynchronously unbind the vma upon vm_unbind call. Fall back

Re: [PATCH v7 20/20] drm/i915/vm_bind: Async vm_unbind support

2022-11-15 Thread Niranjana Vishwanathapura
On Tue, Nov 15, 2022 at 04:58:42PM +0100, Andi Shyti wrote: Hi Niranjana, On Sat, Nov 12, 2022 at 11:57:32PM -0800, Niranjana Vishwanathapura wrote: Asynchronously unbind the vma upon vm_unbind call. Fall back to synchronous unbind if backend doesn't support async unbind or if async unbind

Re: [PATCH v7 20/20] drm/i915/vm_bind: Async vm_unbind support

2022-11-15 Thread Niranjana Vishwanathapura
On Tue, Nov 15, 2022 at 11:05:21AM +, Matthew Auld wrote: On 13/11/2022 07:57, Niranjana Vishwanathapura wrote: Asynchronously unbind the vma upon vm_unbind call. Fall back to synchronous unbind if backend doesn't support async unbind or if async unbind fails. No need for vm_unbind out

[PATCH v7 08/20] drm/i915/vm_bind: Support persistent vma activeness tracking

2022-11-12 Thread Niranjana Vishwanathapura
ath. Update i915_vma_is_active(), i915_vma_sync() and the __i915_vma_unbind_async() functions to properly handle persistent vmas. v2: Ensure lvalue of dma_resv_wait_timeout() call is long. Reviewed-by: Andi Shyti Signed-off-by: Niranjana Vishwanathapura --- drivers/gpu/drm/i915/i915_ge

[PATCH v7 09/20] drm/i915/vm_bind: Add out fence support

2022-11-12 Thread Niranjana Vishwanathapura
iff I915_TIMELINE_FENCE_SIGNAL is not specified. v5: Ensure __I915_TIMELINE_FENCE_UNKNOWN_FLAGS are not set. Reviewed-by: Matthew Auld Signed-off-by: Niranjana Vishwanathapura Signed-off-by: Andi Shyti --- drivers/gpu/drm/i915/gem/i915_gem_vm_bind.h | 4 + .../drm/i915/

[PATCH v7 19/20] drm/i915/vm_bind: Render VM_BIND documentation

2022-11-12 Thread Niranjana Vishwanathapura
Update i915 documentation to include VM_BIND changes and render all VM_BIND related documentation. Reviewed-by: Matthew Auld Signed-off-by: Niranjana Vishwanathapura --- Documentation/gpu/i915.rst | 78 -- 1 file changed, 59 insertions(+), 19 deletions

[PATCH v7 05/20] drm/i915/vm_bind: Implement bind and unbind of object

2022-11-12 Thread Niranjana Vishwanathapura
check with i915_gem_vm_is_vm_bind_mode(). v5: Ensure all reserved fields are 0, use PIN_NOEVICT. v6: Add reserved fields to drm_i915_gem_vm_bind. Reviewed-by: Matthew Auld Signed-off-by: Niranjana Vishwanathapura Signed-off-by: Prathap Kumar Valsan Signed-off-by: Andi Shyti --- drivers/gpu/dr

[PATCH v7 14/20] drm/i915/vm_bind: Expose i915_request_await_bind()

2022-11-12 Thread Niranjana Vishwanathapura
Rename __i915_request_await_bind() as i915_request_await_bind() and make it non-static as it will be used in execbuf3 ioctl path. v2: add documentation Reviewed-by: Matthew Auld Reviewed-by: Andi Shyti Signed-off-by: Niranjana Vishwanathapura --- drivers/gpu/drm/i915/i915_vma.c | 8

[PATCH v7 15/20] drm/i915/vm_bind: Handle persistent vmas in execbuf3

2022-11-12 Thread Niranjana Vishwanathapura
, use proper lock while checking if vm_rebind_list is empty. Reviewed-by: Matthew Auld Signed-off-by: Niranjana Vishwanathapura Signed-off-by: Andi Shyti --- .../gpu/drm/i915/gem/i915_gem_execbuffer3.c | 215 +- 1 file changed, 214 insertions(+), 1 deletion(-) diff --git

[PATCH v7 16/20] drm/i915/vm_bind: userptr dma-resv changes

2022-11-12 Thread Niranjana Vishwanathapura
ed-off-by: Niranjana Vishwanathapura Signed-off-by: Andi Shyti --- .../gpu/drm/i915/gem/i915_gem_execbuffer3.c | 84 ++- drivers/gpu/drm/i915/gem/i915_gem_userptr.c | 19 + .../drm/i915/gem/i915_gem_vm_bind_object.c| 15 drivers/gpu/drm/i915/gt/intel_gtt.c | 2 + d

[PATCH v7 04/20] drm/i915/vm_bind: Add support to create persistent vma

2022-11-12 Thread Niranjana Vishwanathapura
to the same gtt_view of object. Skip vma_lookup for persistent vmas to support aliasing. v2: Remove unused I915_VMA_PERSISTENT definition, update validity check in i915_vma_compare(), remove unwanted is_persistent check in release_references(). Reviewed-by: Matthew Auld Signed-off-by: Niranjana

[PATCH v7 17/20] drm/i915/vm_bind: Limit vm_bind mode to non-recoverable contexts

2022-11-12 Thread Niranjana Vishwanathapura
Only support vm_bind mode with non-recoverable contexts. With new vm_bind mode with eb3 submission path, we need not support older recoverable contexts. Reviewed-by: Matthew Auld Signed-off-by: Niranjana Vishwanathapura --- drivers/gpu/drm/i915/gem/i915_gem_context.c | 6 ++ 1 file changed

[PATCH v7 18/20] drm/i915/vm_bind: Add uapi for user to enable vm_bind_mode

2022-11-12 Thread Niranjana Vishwanathapura
atthew Auld Signed-off-by: Niranjana Vishwanathapura Signed-off-by: Andi Shyti --- drivers/gpu/drm/i915/gem/i915_gem_context.c | 25 ++-- drivers/gpu/drm/i915/gem/i915_gem_context.h | 3 +-- drivers/gpu/drm/i915/gt/intel_gtt.c | 2 ++ drivers/gpu/drm/i915/i915

[PATCH v7 11/20] drm/i915/vm_bind: Use common execbuf functions in execbuf path

2022-11-12 Thread Niranjana Vishwanathapura
Update the execbuf path to use common execbuf functions to reduce code duplication with the newer execbuf3 path. Reviewed-by: Matthew Auld Signed-off-by: Niranjana Vishwanathapura --- .../gpu/drm/i915/gem/i915_gem_execbuffer.c| 513 ++ 1 file changed, 39 insertions(+), 474

  1   2   3   4   5   >