Re: Bug in the error handling in TTMs pool implementation

2023-11-27 Thread Karolina Stolarek
On 24.11.2023 16:53, Christian König wrote: @Karolina do you of hand know a way how we could exercise this in a TTM unit test? Basically we would need to redirect the alloc_pages_node() symbol to an unit test internal function and let it return an error (or something like that). Do I unders

Re: [PATCH v7 3/8] drm/ttm/tests: Add tests for ttm_bo functions

2023-11-22 Thread Karolina Stolarek
On 21.11.2023 15:29, Christian König wrote: Am 17.11.23 um 09:49 schrieb Karolina Stolarek: Test reservation and release of TTM buffer objects. Add tests to check pin and unpin operations. Signed-off-by: Karolina Stolarek Tested-by: Amaranath Somalapuram From the TTM side it looks good

[PATCH v7 6/8] drm/ttm/tests: Test simple BO creation and validation

2023-11-17 Thread Karolina Stolarek
Add tests for ttm_bo_init_reserved() and ttm_bo_validate() that use sys manager. Define a simple move function in ttm_device_funcs. Expose destroy callback of the buffer object to make testing of ttm_bo_init_reserved() behaviour easier. Signed-off-by: Karolina Stolarek --- drivers/gpu/drm/ttm

[PATCH v7 8/8] drm/ttm/tests: Add test cases dependent on fence signaling

2023-11-17 Thread Karolina Stolarek
Add test cases that check how the state of dma fences in BO's reservation object influence the ttm_bo_validation() flow. Do similar tests for resource manager's move fence. Signed-off-by: Karolina Stolarek --- .../gpu/drm/ttm/tests/ttm_bo_validate_test.c | 308

[PATCH v7 7/8] drm/ttm/tests: Add tests with mock resource managers

2023-11-17 Thread Karolina Stolarek
Add mock resource manager to test ttm_bo_validate() with non-system placements. Update KConfig entry to enable DRM Buddy allocator, used by the mock manager. Update move function to do more than just assign a resource. Signed-off-by: Karolina Stolarek --- drivers/gpu/drm/Kconfig

[PATCH v7 4/8] drm/ttm/tests: Fix argument in ttm_tt_kunit_init()

2023-11-17 Thread Karolina Stolarek
Remove a leftover definition of page order and pass an empty flag value in ttm_pool_pre_populated(). Signed-off-by: Karolina Stolarek Tested-by: Amaranath Somalapuram --- drivers/gpu/drm/ttm/tests/ttm_pool_test.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu

[PATCH v7 5/8] drm/ttm/tests: Use an init function from the helpers lib

2023-11-17 Thread Karolina Stolarek
Add a new helper function that also initializes the device. Use it in ttm_tt test suite and delete the local definition. Signed-off-by: Karolina Stolarek --- drivers/gpu/drm/ttm/tests/ttm_kunit_helpers.c | 14 ++ drivers/gpu/drm/ttm/tests/ttm_kunit_helpers.h | 1 + drivers/gpu/drm

[PATCH v7 3/8] drm/ttm/tests: Add tests for ttm_bo functions

2023-11-17 Thread Karolina Stolarek
Test reservation and release of TTM buffer objects. Add tests to check pin and unpin operations. Signed-off-by: Karolina Stolarek Tested-by: Amaranath Somalapuram --- drivers/gpu/drm/ttm/tests/Makefile| 1 + drivers/gpu/drm/ttm/tests/ttm_bo_test.c | 619

[PATCH v7 2/8] drm/ttm/tests: Add tests for ttm_tt

2023-11-17 Thread Karolina Stolarek
Test initialization, creation and destruction of ttm_tt instances. Export ttm_tt_destroy and ttm_tt_create symbols for testing purposes. Signed-off-by: Karolina Stolarek Reviewed-by: Christian König Tested-by: Amaranath Somalapuram --- drivers/gpu/drm/ttm/tests/Makefile| 1

[PATCH v7 1/8] drm/ttm/tests: Add tests for ttm_resource and ttm_sys_man

2023-11-17 Thread Karolina Stolarek
test purposes only. Signed-off-by: Karolina Stolarek Tested-by: Amaranath Somalapuram --- drivers/gpu/drm/ttm/tests/Makefile| 1 + drivers/gpu/drm/ttm/tests/ttm_kunit_helpers.c | 22 +- drivers/gpu/drm/ttm/tests/ttm_kunit_helpers.h | 3 + drivers/gpu/drm/ttm/tests/ttm_resource_t

[PATCH v7 0/8] Improve test coverage of TTM

2023-11-17 Thread Karolina Stolarek
sts as a module, even if it uses functions that are not exported - Fix ttm_pool_pre_populated(); a wrong flag was passed to ttm_tt_kunit_init() function Karolina Stolarek (8): drm/ttm/tests: Add tests for ttm_resource and ttm_sys_man drm/ttm/tests: Add tests for ttm_tt drm/ttm/tests:

Re: [PATCH v6 0/8] Improve test coverage of TTM

2023-11-09 Thread Karolina Stolarek
On 8.11.2023 16:01, Christian König wrote:> Well, you have a tendency to keep us busy :) ...:) I'll try to get other folks to take a look at this. It's a lot of code to review Please keep Amar looped in those patches. I will try to review them when I have time, but he can give you at least

Re: [PATCH v6 7/8] drm/ttm/tests: Add tests with mock resource managers

2023-11-09 Thread Karolina Stolarek
On 8.11.2023 14:56, Karolina Stolarek wrote: diff --git a/drivers/gpu/drm/ttm/tests/ttm_bo_validate_test.c b/drivers/gpu/drm/ttm/tests/ttm_bo_validate_test.c index 38e584798584..f0f0ab992e04 100644 --- a/drivers/gpu/drm/ttm/tests/ttm_bo_validate_test.c +++ b/drivers/gpu/drm/ttm/tests

[PATCH v6 6/8] drm/ttm/tests: Test simple BO creation and validation

2023-11-08 Thread Karolina Stolarek
Add tests for ttm_bo_init_reserved() and ttm_bo_validate() that use sys manager. Define a simple move function in ttm_device_funcs. Expose destroy callback of the buffer object to make testing of ttm_bo_init_reserved() behaviour easier. Signed-off-by: Karolina Stolarek --- drivers/gpu/drm/ttm

[PATCH v6 4/8] drm/ttm/tests: Fix argument in ttm_tt_kunit_init()

2023-11-08 Thread Karolina Stolarek
Remove a leftover definition of page order and pass an empty flag value in ttm_pool_pre_populated(). Signed-off-by: Karolina Stolarek Tested-by: Amaranath Somalapuram --- drivers/gpu/drm/ttm/tests/ttm_pool_test.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu

[PATCH v6 8/8] drm/ttm/tests: Add test cases dependent on fence signaling

2023-11-08 Thread Karolina Stolarek
Add test cases that check how the state of dma fences in BO's reservation object influence the ttm_bo_validation() flow. Do similar tests for resource manager's move fence. Signed-off-by: Karolina Stolarek --- .../gpu/drm/ttm/tests/ttm_bo_validate_test.c | 306

[PATCH v6 7/8] drm/ttm/tests: Add tests with mock resource managers

2023-11-08 Thread Karolina Stolarek
Add mock resource manager to test ttm_bo_validate() with non-system placements. Update KConfig entry to enable DRM Buddy allocator, used by the mock manager. Update move function to do more than just assign a resource. Signed-off-by: Karolina Stolarek --- drivers/gpu/drm/Kconfig

[PATCH v6 2/8] drm/ttm/tests: Add tests for ttm_tt

2023-11-08 Thread Karolina Stolarek
Test initialization, creation and destruction of ttm_tt instances. Export ttm_tt_destroy and ttm_tt_create symbols for testing purposes. Signed-off-by: Karolina Stolarek Reviewed-by: Christian König Tested-by: Amaranath Somalapuram --- drivers/gpu/drm/ttm/tests/Makefile| 1

[PATCH v6 5/8] drm/ttm/tests: Use an init function from the helpers lib

2023-11-08 Thread Karolina Stolarek
Add a new helper function that also initializes the device. Use it in ttm_tt test suite and delete the local definition. Signed-off-by: Karolina Stolarek --- drivers/gpu/drm/ttm/tests/ttm_kunit_helpers.c | 14 ++ drivers/gpu/drm/ttm/tests/ttm_kunit_helpers.h | 1 + drivers/gpu/drm

[PATCH v6 3/8] drm/ttm/tests: Add tests for ttm_bo functions

2023-11-08 Thread Karolina Stolarek
Test reservation and release of TTM buffer objects. Add tests to check pin and unpin operations. Signed-off-by: Karolina Stolarek Tested-by: Amaranath Somalapuram --- drivers/gpu/drm/ttm/tests/Makefile| 1 + drivers/gpu/drm/ttm/tests/ttm_bo_test.c | 619

[PATCH v6 1/8] drm/ttm/tests: Add tests for ttm_resource and ttm_sys_man

2023-11-08 Thread Karolina Stolarek
test purposes only. Signed-off-by: Karolina Stolarek Tested-by: Amaranath Somalapuram --- drivers/gpu/drm/ttm/tests/Makefile| 1 + drivers/gpu/drm/ttm/tests/ttm_kunit_helpers.c | 23 +- drivers/gpu/drm/ttm/tests/ttm_kunit_helpers.h | 4 + drivers/gpu/drm/ttm/tests/ttm_resource_t

[PATCH v6 0/8] Improve test coverage of TTM

2023-11-08 Thread Karolina Stolarek
passed to ttm_tt_kunit_init() function Karolina Stolarek (8): drm/ttm/tests: Add tests for ttm_resource and ttm_sys_man drm/ttm/tests: Add tests for ttm_tt drm/ttm/tests: Add tests for ttm_bo functions drm/ttm/tests: Fix argument in ttm_tt_kunit_init() drm/ttm/tests: Use an init functio

Re: [PATCH v5 1/4] drm/ttm/tests: Add tests for ttm_resource and ttm_sys_man

2023-11-07 Thread Karolina Stolarek
On 7.11.2023 10:34, Christian König wrote: Am 16.10.23 um 10:52 schrieb Karolina Stolarek: diff --git a/drivers/gpu/drm/ttm/tests/ttm_kunit_helpers.c b/drivers/gpu/drm/ttm/tests/ttm_kunit_helpers.c index 81661d8827aa..c605f010ea08 100644 --- a/drivers/gpu/drm/ttm/tests/ttm_kunit_helpers.c

Re: [PATCH v5 0/4] Improve test coverage of TTM

2023-10-31 Thread Karolina Stolarek
Hi Christian, On 17.10.2023 14:10, Christian König wrote: Am 17.10.23 um 14:06 schrieb Karolina Stolarek: >> Oh! Could you at least take a look at ttm_bo_reserve_deadlock and/or interrupted subtests? I'm not 100% sure if my solution is right. Than this will have to wait till nex

Re: [PATCH] drm/i915/gt: Remove {} from if-else

2023-10-26 Thread Karolina Stolarek
On 26.10.2023 06:43, Soumya Negi wrote: In accordance to Linux coding style(Documentation/process/4.Coding.rst), remove unneeded braces from if-else block as all arms of this block contain single statements. I'd just keep the description simple, and say that braces are not needed for single l

Re: [PATCH v5 0/4] Improve test coverage of TTM

2023-10-17 Thread Karolina Stolarek
On 17.10.2023 14:10, Christian König wrote: Am 17.10.23 um 14:06 schrieb Karolina Stolarek: On 17.10.2023 13:57, Christian König wrote: Am 17.10.23 um 13:22 schrieb Somalapuram, Amaranath: On 10/17/2023 4:35 PM, Karolina Stolarek wrote: Hi Amaranath, On 16.10.2023 15:08, Somalapuram

Re: [PATCH v5 0/4] Improve test coverage of TTM

2023-10-17 Thread Karolina Stolarek
On 17.10.2023 13:57, Christian König wrote: Am 17.10.23 um 13:22 schrieb Somalapuram, Amaranath: On 10/17/2023 4:35 PM, Karolina Stolarek wrote: Hi Amaranath, On 16.10.2023 15:08, Somalapuram, Amaranath wrote: On 10/16/2023 2:22 PM, Karolina Stolarek wrote: Add tests for building blocks

Re: [PATCH v5 0/4] Improve test coverage of TTM

2023-10-17 Thread Karolina Stolarek
Hi Amaranath, On 16.10.2023 15:08, Somalapuram, Amaranath wrote: On 10/16/2023 2:22 PM, Karolina Stolarek wrote: Add tests for building blocks of the TTM subsystem, such as ttm_resource, ttm_resource_manager, ttm_tt and ttm_buffer_object. This series covers basic functions such as

[PATCH] drm/ttm: Reorder sys manager cleanup step

2023-10-16 Thread Karolina Stolarek
list and drain its workqueue before releasing the system domain manager in ttm_device_fini(). Signed-off-by: Karolina Stolarek --- This is actually a reiteration of a patch sent in [1], but the solution and commit message changed significantly, so I decided not to send it as v2. [1

Re: [PATCH] drm/ttm: Drain workqueue before sys manager release

2023-10-16 Thread Karolina Stolarek
On 16.10.2023 13:03, Christian König wrote: Am 13.10.23 um 16:34 schrieb Karolina Stolarek: In rare cases, a delayed destruction of a BO with a system resource could stay in the workqueue until drain_workqueue() is called in ttm_device_fini(). An attempt to free a resource from an already

[PATCH v5 4/4] drm/ttm/tests: Fix argument in ttm_tt_kunit_init()

2023-10-16 Thread Karolina Stolarek
Remove a leftover definition of page order and pass an empty flag value in ttm_pool_pre_populated(). Signed-off-by: Karolina Stolarek --- drivers/gpu/drm/ttm/tests/ttm_pool_test.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/ttm/tests/ttm_pool_test.c b

[PATCH v5 2/4] drm/ttm/tests: Add tests for ttm_tt

2023-10-16 Thread Karolina Stolarek
Test initialization, creation and destruction of ttm_tt instances. Export ttm_tt_destroy and ttm_tt_create symbols for testing purposes. Signed-off-by: Karolina Stolarek --- drivers/gpu/drm/ttm/tests/Makefile| 1 + drivers/gpu/drm/ttm/tests/ttm_kunit_helpers.c | 20 ++ drivers

[PATCH v5 3/4] drm/ttm/tests: Add tests for ttm_bo functions

2023-10-16 Thread Karolina Stolarek
Test reservation and release of TTM buffer objects. Add tests to check pin and unpin operations. Signed-off-by: Karolina Stolarek --- drivers/gpu/drm/ttm/tests/Makefile| 1 + drivers/gpu/drm/ttm/tests/ttm_bo_test.c | 619 ++ drivers/gpu/drm/ttm/tests

[PATCH v5 1/4] drm/ttm/tests: Add tests for ttm_resource and ttm_sys_man

2023-10-16 Thread Karolina Stolarek
test purposes only. Signed-off-by: Karolina Stolarek --- drivers/gpu/drm/ttm/tests/Makefile| 1 + drivers/gpu/drm/ttm/tests/ttm_kunit_helpers.c | 25 +- drivers/gpu/drm/ttm/tests/ttm_kunit_helpers.h | 4 + drivers/gpu/drm/ttm/tests/ttm_resource_test.c | 335 ++ dr

[PATCH v5 0/4] Improve test coverage of TTM

2023-10-16 Thread Karolina Stolarek
kunit_init() function Karolina Stolarek (4): drm/ttm/tests: Add tests for ttm_resource and ttm_sys_man drm/ttm/tests: Add tests for ttm_tt drm/ttm/tests: Add tests for ttm_bo functions drm/ttm/tests: Fix argument in ttm_tt_kunit_init() drivers/gpu/drm/ttm/tests/Makefile| 3 + drive

[PATCH] drm/ttm: Drain workqueue before sys manager release

2023-10-13 Thread Karolina Stolarek
workqueue so it happens before the ttm_sys_manager cleanup. Fixes: 9bff18d13473 ("drm/ttm: use per BO cleanup workers") Signed-off-by: Karolina Stolarek --- Some background: I stumbled upon this issue when testing ttm_bo_pipeline_gutting() with BO with an active dma_resv fence. In ~2% o

[PATCH v4 0/4] Improve test coverage of TTM

2023-09-19 Thread Karolina Stolarek
T=m so the tests and TTM module are built as one. This allows building the tests as a module, even if it uses functions that are not exported - Fix ttm_pool_pre_populated(); a wrong flag was passed to ttm_tt_kunit_init() function Karolina Stolarek (4): drm/ttm/tests: Add tests for tt

[PATCH v4 2/4] drm/ttm/tests: Add tests for ttm_tt

2023-09-19 Thread Karolina Stolarek
Test initialization, creation and destruction of ttm_tt instances. Export ttm_tt_destroy and ttm_tt_create symbols for testing purposes. Signed-off-by: Karolina Stolarek --- drivers/gpu/drm/ttm/tests/Makefile| 1 + drivers/gpu/drm/ttm/tests/ttm_kunit_helpers.c | 20 ++ drivers

[PATCH v4 4/4] drm/ttm/tests: Fix argument in ttm_tt_kunit_init()

2023-09-19 Thread Karolina Stolarek
Remove a leftover definition of page order and pass an empty flag value in ttm_pool_pre_populated(). Signed-off-by: Karolina Stolarek --- drivers/gpu/drm/ttm/tests/ttm_pool_test.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/ttm/tests/ttm_pool_test.c b

[PATCH v4 3/4] drm/ttm/tests: Add tests for ttm_bo functions

2023-09-19 Thread Karolina Stolarek
Test reservation and release of TTM buffer objects. Add tests to check pin and unpin operations. Signed-off-by: Karolina Stolarek --- drivers/gpu/drm/ttm/tests/Makefile| 1 + drivers/gpu/drm/ttm/tests/ttm_bo_test.c | 619 ++ drivers/gpu/drm/ttm/tests

[PATCH v4 1/4] drm/ttm/tests: Add tests for ttm_resource and ttm_sys_man

2023-09-19 Thread Karolina Stolarek
test purposes only. Signed-off-by: Karolina Stolarek --- drivers/gpu/drm/ttm/tests/Makefile| 1 + drivers/gpu/drm/ttm/tests/ttm_kunit_helpers.c | 25 +- drivers/gpu/drm/ttm/tests/ttm_kunit_helpers.h | 4 + drivers/gpu/drm/ttm/tests/ttm_resource_test.c | 335 ++ dr

Re: [PATCH v3 1/4] drm/ttm/tests: Add tests for ttm_resource and ttm_sys_man

2023-09-19 Thread Karolina Stolarek
On 18.09.2023 14:45, Christian König wrote: Am 18.09.23 um 13:48 schrieb Karolina Stolarek: On 12.09.2023 14:54, Christian König wrote: Am 12.09.23 um 13:49 schrieb Karolina Stolarek: Test initialization of ttm_resource using different memory domains. Add tests for a system memory manager and

Re: [PATCH v3 1/4] drm/ttm/tests: Add tests for ttm_resource and ttm_sys_man

2023-09-18 Thread Karolina Stolarek
On 18.09.2023 13:48, Karolina Stolarek wrote: On 12.09.2023 14:54, Christian König wrote: Am 12.09.23 um 13:49 schrieb Karolina Stolarek: Test initialization of ttm_resource using different memory domains. Add tests for a system memory manager and functions that can be tested without a fully

Re: [PATCH v3 1/4] drm/ttm/tests: Add tests for ttm_resource and ttm_sys_man

2023-09-18 Thread Karolina Stolarek
On 12.09.2023 14:54, Christian König wrote: Am 12.09.23 um 13:49 schrieb Karolina Stolarek: Test initialization of ttm_resource using different memory domains. Add tests for a system memory manager and functions that can be tested without a fully-featured resource manager. Update

[PATCH v3 4/4] drm/ttm/tests: Fix argument in ttm_tt_kunit_init()

2023-09-12 Thread Karolina Stolarek
Remove a leftover definition of page order and pass an empty flag value in ttm_pool_pre_populated(). Signed-off-by: Karolina Stolarek --- drivers/gpu/drm/ttm/tests/ttm_pool_test.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/ttm/tests/ttm_pool_test.c b

[PATCH v3 3/4] drm/ttm/tests: Add tests for ttm_bo functions

2023-09-12 Thread Karolina Stolarek
Test reservation and release of TTM buffer objects. Add tests to check pin and unpin operations. Signed-off-by: Karolina Stolarek --- drivers/gpu/drm/ttm/tests/Makefile| 1 + drivers/gpu/drm/ttm/tests/ttm_bo_test.c | 620 ++ drivers/gpu/drm/ttm/tests

[PATCH v3 2/4] drm/ttm/tests: Add tests for ttm_tt

2023-09-12 Thread Karolina Stolarek
Test initialization, creation and destruction of ttm_tt instances. Export ttm_tt_destroy and ttm_tt_create symbols for test purposes. Signed-off-by: Karolina Stolarek --- drivers/gpu/drm/ttm/tests/Makefile| 1 + drivers/gpu/drm/ttm/tests/ttm_kunit_helpers.c | 20 ++ drivers/gpu

[PATCH v3 1/4] drm/ttm/tests: Add tests for ttm_resource and ttm_sys_man

2023-09-12 Thread Karolina Stolarek
test purposes only. Signed-off-by: Karolina Stolarek --- drivers/gpu/drm/ttm/tests/Makefile| 1 + drivers/gpu/drm/ttm/tests/ttm_kunit_helpers.c | 23 ++ drivers/gpu/drm/ttm/tests/ttm_kunit_helpers.h | 4 + drivers/gpu/drm/ttm/tests/ttm_resource_test.c

[PATCH v3 0/4] Improve test coverage of TTM

2023-09-12 Thread Karolina Stolarek
T=m so the tests and TTM module are built as one. This allows building the tests as a module, even if it uses functions that are not exported - Fix ttm_pool_pre_populated(); a wrong flag was passed to ttm_tt_kunit_init() function Karolina Stolarek (4): drm/ttm/tests: Add tests for tt

Re: [PATCH v2 1/5] drm/ttm: Update Makefile for KUnit

2023-09-12 Thread Karolina Stolarek
On 11.09.2023 15:42, Christian König wrote: Am 11.09.23 um 15:33 schrieb Karolina Stolarek: On 11.09.2023 15:12, Christian König wrote: Am 11.09.23 um 13:47 schrieb Karolina Stolarek: On 11.09.2023 12:49, Jani Nikula wrote: On Mon, 11 Sep 2023, Karolina Stolarek wrote: Update Makefile so

Re: [PATCH v2 1/5] drm/ttm: Update Makefile for KUnit

2023-09-11 Thread Karolina Stolarek
On 11.09.2023 15:12, Christian König wrote: Am 11.09.23 um 13:47 schrieb Karolina Stolarek: On 11.09.2023 12:49, Jani Nikula wrote: On Mon, 11 Sep 2023, Karolina Stolarek wrote: Update Makefile so it can produce a module that consists of TTM tests. This will allow us to test non-exported

Re: [PATCH v2 1/5] drm/ttm: Update Makefile for KUnit

2023-09-11 Thread Karolina Stolarek
On 11.09.2023 12:49, Jani Nikula wrote: On Mon, 11 Sep 2023, Karolina Stolarek wrote: Update Makefile so it can produce a module that consists of TTM tests. This will allow us to test non-exported functions when KUnit tests are built as a module. Remove the tests' Makefile. I

[PATCH v2 5/5] drm/ttm/tests: Don't pass order as page flags

2023-09-11 Thread Karolina Stolarek
Delete a leftover order definition from ttm_pool_pre_populated() helper. Pass an empty page flag to ttm_tt_kunit_init(). Signed-off-by: Karolina Stolarek --- drivers/gpu/drm/ttm/tests/ttm_pool_test.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/ttm/tests

[PATCH v2 4/5] drm/ttm/tests: Add tests for ttm_bo functions

2023-09-11 Thread Karolina Stolarek
Test reservation and release of TTM buffer objects. Add tests to check pin and unpin operations. Signed-off-by: Karolina Stolarek --- drivers/gpu/drm/ttm/Makefile | 2 +- drivers/gpu/drm/ttm/tests/ttm_bo_test.c | 620 ++ drivers/gpu/drm/ttm/tests

[PATCH v2 3/5] drm/ttm/tests: Add tests for ttm_tt

2023-09-11 Thread Karolina Stolarek
Test initialization, creation and destruction of ttm_tt instances. Signed-off-by: Karolina Stolarek --- drivers/gpu/drm/ttm/Makefile | 3 +- drivers/gpu/drm/ttm/tests/ttm_kunit_helpers.c | 20 ++ drivers/gpu/drm/ttm/tests/ttm_tt_test.c | 277 ++ 3 files

[PATCH v2 2/5] drm/ttm/tests: Add tests for ttm_resource and ttm_sys_man

2023-09-11 Thread Karolina Stolarek
Test initialization of ttm_resource using different memory domains. Add tests for a system memory manager and functions that can be tested without a fully-featured resource manager. Update ttm_bo_kunit_init() to initialize BO's kref and reservation object. Signed-off-by: Karolina Sto

[PATCH v2 1/5] drm/ttm: Update Makefile for KUnit

2023-09-11 Thread Karolina Stolarek
Update Makefile so it can produce a module that consists of TTM tests. This will allow us to test non-exported functions when KUnit tests are built as a module. Remove the tests' Makefile. Signed-off-by: Karolina Stolarek Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-k

[PATCH v2 0/5] Improve test coverage of TTM

2023-09-11 Thread Karolina Stolarek
are built as one. This allows building the tests as a module, even if it uses functions that are not exported - Fix ttm_pool_pre_populated(); a wrong flag was passed to ttm_tt_kunit_init() function Karolina Stolarek (5): drm/ttm: Update Makefile for KUnit drm/ttm/tests: Add

Re: [PATCH 3/3] drm/ttm/tests: Add tests for ttm_bo functions

2023-09-11 Thread Karolina Stolarek
On 1.09.2023 15:50, Christian König wrote: Am 01.09.23 um 15:30 schrieb Karolina Stolarek: On 1.09.2023 15:19, Christian König wrote: Am 01.09.23 um 14:37 schrieb Karolina Stolarek: On 1.09.2023 14:04, kernel test robot wrote: Hi Karolina, kernel test robot noticed the following build

Re: [PATCH 3/3] drm/ttm/tests: Add tests for ttm_bo functions

2023-09-01 Thread Karolina Stolarek
On 1.09.2023 15:19, Christian König wrote: Am 01.09.23 um 14:37 schrieb Karolina Stolarek: On 1.09.2023 14:04, kernel test robot wrote: Hi Karolina, kernel test robot noticed the following build errors: It's a problem of building TTM KUnit tests as a module, the issue is not tied

Re: [PATCH 3/3] drm/ttm/tests: Add tests for ttm_bo functions

2023-09-01 Thread Karolina Stolarek
ted in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Karolina-Stolarek/drm-ttm-tests-Add-tests-for-ttm_resource-and-ttm_sys_man/20230831-185954 base: git://anongit.freedesktop.org/drm/drm-misc drm-misc-next patch

[PATCH 2/3] drm/ttm/tests: Add tests for ttm_tt

2023-08-31 Thread Karolina Stolarek
Test initialization, creation and destruction of ttm_tt instances. Signed-off-by: Karolina Stolarek --- drivers/gpu/drm/ttm/tests/Makefile| 1 + drivers/gpu/drm/ttm/tests/ttm_kunit_helpers.c | 20 ++ drivers/gpu/drm/ttm/tests/ttm_tt_test.c | 277 ++ 3 files

[PATCH 1/3] drm/ttm/tests: Add tests for ttm_resource and ttm_sys_man

2023-08-31 Thread Karolina Stolarek
Test initialization of ttm_resource using different memory domains. Add tests for a system memory manager and functions that can be tested without a fully-featured resource manager. Update ttm_bo_kunit_init() to initialize BO's kref and reservation object. Signed-off-by: Karolina Sto

[PATCH 3/3] drm/ttm/tests: Add tests for ttm_bo functions

2023-08-31 Thread Karolina Stolarek
Test reservation and release of TTM buffer objects. Add tests to check pin and unpin operations. Signed-off-by: Karolina Stolarek --- drivers/gpu/drm/ttm/tests/Makefile| 1 + drivers/gpu/drm/ttm/tests/ttm_bo_test.c | 616 ++ drivers/gpu/drm/ttm/tests

[PATCH 0/3] Improve test coverage of TTM

2023-08-31 Thread Karolina Stolarek
m/ttm/tests To build a kernel with TTM KUnit tests, first enable CONFIG_KUNIT, and then CONFIG_DRM_TTM_KUNIT_TEST. Many thanks, Karolina Karolina Stolarek (3): drm/ttm/tests: Add tests for ttm_resource and ttm_sys_man drm/ttm/tests: Add tests for ttm_tt drm/ttm/tests: Add tests for ttm_bo func

Re: [PATCH drm-misc-next] drm/ttm/tests: Require MMU when testing

2023-08-18 Thread Karolina Stolarek
Hi Thomas, On 17.08.2023 15:11, Thomas Zimmermann wrote: Hi I've cherry-picked the patch into drm-misc-next-fixes, so it will show up in upstream soon. Many thanks for your help. I'm sorry this one slipped through. Am 11.08.23 um 13:36 schrieb Karolina Stolarek: Satisfy MMU

[PATCH] drm/ttm/tests: Fix type conversion in ttm_pool_test

2023-08-16 Thread Karolina Stolarek
Fix a warning about casting an integer of different size in ttm_pool_alloc_basic_dma_addr() subtest. Cast the DMA address to uintptr_t before casting it to a generic pointer. Signed-off-by: Karolina Stolarek Cc: Christian König Reported-by: kernel test robot Closes: https://lore.kernel.org/oe

[PATCH drm-misc-next] drm/ttm/tests: Require MMU when testing

2023-08-11 Thread Karolina Stolarek
Satisfy MMU dependency when testing TTM with KUnit. This fixes compilation errors on platforms that don't select this option by default. Signed-off-by: Karolina Stolarek Cc: Christian König Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202308110133.f0l

Re: [RFC v6 0/3] Introduce KUnit tests for TTM subsystem

2023-08-10 Thread Karolina Stolarek
On 10.08.2023 09:19, Christian König wrote: Am 08.08.23 um 11:51 schrieb Karolina Stolarek: This series introduces KUnit[1] tests for TTM (Translation Table Manager) subsystem, a memory manager used by graphics drivers to create and manage memory buffers across different memory domains, such as

[RFC v6 3/3] drm/ttm/tests: Add tests for ttm_pool

2023-08-08 Thread Karolina Stolarek
Add KUnit tests that exercise page allocation using page pools and freeing pages, either by returning them to the pool or freeing them. Add a basic test for ttm_pool cleanup. Introduce helpers to create a dummy ttm_buffer_object. Signed-off-by: Karolina Stolarek --- drivers/gpu/drm/ttm/tests

[RFC v6 2/3] drm/ttm/tests: Add tests for ttm_device

2023-08-08 Thread Karolina Stolarek
Test initialization and cleanup of the ttm_device struct, including some error paths. Verify the creation of page pools if use_dma_alloc param is true. Signed-off-by: Karolina Stolarek Reviewed-by: Christian König --- drivers/gpu/drm/ttm/tests/ttm_device_test.c | 158 1

[RFC v6 1/3] drm/ttm: Introduce KUnit test

2023-08-08 Thread Karolina Stolarek
Add the initial version of unit tests for ttm_device struct, together with helper functions. Signed-off-by: Karolina Stolarek --- drivers/gpu/drm/Kconfig | 15 +++ drivers/gpu/drm/ttm/Makefile | 1 + drivers/gpu/drm/ttm/tests/.kunitconfig| 4

[RFC v6 0/3] Introduce KUnit tests for TTM subsystem

2023-08-08 Thread Karolina Stolarek
-- [1] - https://www.kernel.org/doc/html/latest/dev-tools/kunit/index.html Karolina Stolarek (3): drm/ttm: Introduce KUnit test drm/ttm/tests: Add tests for ttm_device drm/ttm/tests: Add tests for ttm_pool drivers/gpu/drm/Kconfig | 15 + drivers/gpu/drm/t

Re: [RFC v5 0/3] Introduce KUnit tests for TTM subsystem

2023-08-08 Thread Karolina Stolarek
Hi Christian, On 7.08.2023 17:06, Christian König wrote: Am 07.08.23 um 14:21 schrieb Karolina Stolarek: Hi Christian, On 3.08.2023 09:56, Christian König wrote: Feel free to add Reviewed-by: Christian König to the whole series and push to drm-misc-next. Thanks for reviewing the patches

Re: [RFC v5 0/3] Introduce KUnit tests for TTM subsystem

2023-08-07 Thread Karolina Stolarek
hat's your preference? All the best, Karolina Thanks, Christian. Am 14.07.23 um 16:10 schrieb Karolina Stolarek: This series introduces KUnit[1] tests for TTM (Translation Table Manager) subsystem, a memory manager used by graphics drivers to create and manage memory buffers across different

[RFC v5 2/3] drm/ttm/tests: Add tests for ttm_device

2023-07-14 Thread Karolina Stolarek
Test initialization and cleanup of the ttm_device struct, including some error paths. Verify the creation of page pools if use_dma_alloc param is true. Signed-off-by: Karolina Stolarek Reviewed-by: Christian König --- drivers/gpu/drm/ttm/tests/ttm_device_test.c | 158 1

[RFC v5 3/3] drm/ttm/tests: Add tests for ttm_pool

2023-07-14 Thread Karolina Stolarek
Add KUnit tests that exercise page allocation using page pools and freeing pages, either by returning them to the pool or freeing them. Add a basic test for ttm_pool cleanup. Introduce helpers to create a dummy ttm_buffer_object. Signed-off-by: Karolina Stolarek --- drivers/gpu/drm/ttm/tests

[RFC v5 0/3] Introduce KUnit tests for TTM subsystem

2023-07-14 Thread Karolina Stolarek
x27;t enabled in the kernel I tested, an oversight on my part) - Add checks for ttm_pool fields in ttm_pool_alloc_basic(), including the one for NUMA node id - Rebase the changes on the top of drm-tip [1] - https://www.kernel.org/doc/html/latest/dev-too

[RFC v5 1/3] drm/ttm: Introduce KUnit test

2023-07-14 Thread Karolina Stolarek
Add the initial version of unit tests for ttm_device struct, together with helper functions. Signed-off-by: Karolina Stolarek --- drivers/gpu/drm/Kconfig | 15 +++ drivers/gpu/drm/ttm/Makefile | 1 + drivers/gpu/drm/ttm/tests/.kunitconfig| 4

Re: [RFC v4 2/3] drm/ttm/tests: Add tests for ttm_device

2023-07-11 Thread Karolina Stolarek
On 11.07.2023 14:45, Christian König wrote: Am 11.07.23 um 12:34 schrieb Karolina Stolarek: Test initialization and cleanup of the ttm_device struct, including some error paths. Verify the creation of page pools if use_dma_alloc param is true. Signed-off-by: Karolina Stolarek ---   drivers

[RFC v4 2/3] drm/ttm/tests: Add tests for ttm_device

2023-07-11 Thread Karolina Stolarek
Test initialization and cleanup of the ttm_device struct, including some error paths. Verify the creation of page pools if use_dma_alloc param is true. Signed-off-by: Karolina Stolarek --- drivers/gpu/drm/ttm/tests/ttm_device_test.c | 159 1 file changed, 159 insertions

[RFC v4 3/3] drm/ttm/tests: Add tests for ttm_pool

2023-07-11 Thread Karolina Stolarek
Add KUnit tests that exercise page allocation using page pools and freeing pages, either by returning them to the pool or freeing them. Add a basic test for ttm_pool cleanup. Introduce helpers to create a dummy ttm_buffer_object. Signed-off-by: Karolina Stolarek --- drivers/gpu/drm/ttm/tests

[RFC v4 1/3] drm/ttm: Introduce KUnit tests

2023-07-11 Thread Karolina Stolarek
Add the initial version of unit tests for ttm_device struct, together with helper functions. Signed-off-by: Karolina Stolarek --- drivers/gpu/drm/Kconfig | 15 +++ drivers/gpu/drm/ttm/Makefile | 1 + drivers/gpu/drm/ttm/tests/.kunitconfig| 4

[RFC v4 0/3] Introduce KUnit tests for TTM subsystem

2023-07-11 Thread Karolina Stolarek
- [1] - https://www.kernel.org/doc/html/latest/dev-tools/kunit/index.html Karolina Stolarek (3): drm/ttm: Introduce KUnit tests drm/ttm/tests: Add tests for ttm_device drm/ttm/tests: Add tests for ttm_pool drivers/gpu/drm/Kconfig | 15 +

Re: [RFC v3 3/3] drm/ttm/tests: Add tests for ttm_pool

2023-07-04 Thread Karolina Stolarek
On 4.07.2023 09:01, Christian König wrote: Am 04.07.23 um 08:35 schrieb Karolina Stolarek: On 3.07.2023 13:21, Christian König wrote: Am 03.07.23 um 09:58 schrieb Karolina Stolarek: Add KUnit tests that exercise page allocation using page pools and freeing pages, either by returning them to

Re: [RFC v3 3/3] drm/ttm/tests: Add tests for ttm_pool

2023-07-03 Thread Karolina Stolarek
On 3.07.2023 13:21, Christian König wrote: Am 03.07.23 um 09:58 schrieb Karolina Stolarek: Add KUnit tests that exercise page allocation using page pools and freeing pages, either by returning them to the pool or freeing them. Add a basic test for ttm_pool cleanup. Introduce helpers to create

[RFC v3 3/3] drm/ttm/tests: Add tests for ttm_pool

2023-07-03 Thread Karolina Stolarek
Add KUnit tests that exercise page allocation using page pools and freeing pages, either by returning them to the pool or freeing them. Add a basic test for ttm_pool cleanup. Introduce helpers to create a dummy ttm_buffer_object. Signed-off-by: Karolina Stolarek --- drivers/gpu/drm/ttm/tests

[RFC v3 2/3] drm/ttm/tests: Add tests for ttm_device

2023-07-03 Thread Karolina Stolarek
Test initialization and cleanup of the ttm_device struct, including some error paths. Verify the creation of page pools if use_dma_alloc param is true. Signed-off-by: Karolina Stolarek Acked-by: Christian König --- drivers/gpu/drm/ttm/tests/ttm_device_test.c | 159 1 file

[RFC v3 1/3] drm/ttm: Introduce KUnit tests

2023-07-03 Thread Karolina Stolarek
Add the initial version of unit tests for ttm_device struct, together with helper functions. Signed-off-by: Karolina Stolarek --- drivers/gpu/drm/Kconfig | 15 + drivers/gpu/drm/ttm/Makefile | 1 + drivers/gpu/drm/ttm/tests/.kunitconfig| 4

[RFC v3 0/3] Introduce KUnit tests for TTM subsystem

2023-07-03 Thread Karolina Stolarek
ebase the changes on the top of drm-tip [1] - https://www.kernel.org/doc/html/latest/dev-tools/kunit/index.html [2] - https://lore.kernel.org/lkml/20230610175618.82271-1...@kernel.org/T/ Karolina Stolarek (3): drm/ttm: Introduce KUnit tests drm/ttm/tests: Add

Re: [RFC v2 1/3] drm/ttm: Introduce KUnit tests

2023-06-30 Thread Karolina Stolarek
On 30.06.2023 13:18, Christian König wrote: Am 30.06.23 um 13:09 schrieb Karolina Stolarek: Hi Christian, I'm taking a second look at this, and I wonder what would be the benefit of combining the initialization of device and ttm_device. (drm_)device can be initialized indepedently fro

Re: [RFC v2 1/3] drm/ttm: Introduce KUnit tests

2023-06-30 Thread Karolina Stolarek
On 29.06.2023 12:05, Karolina Stolarek wrote: Hi Christian, Thanks a lot for taking a look at my patches. On 29.06.2023 09:50, Christian König wrote: Am 27.06.23 um 10:32 schrieb Karolina Stolarek: Add the initial version of unit tests for ttm_device struct, together with helper functions. Sig

Re: [RFC v2 3/3] drm/ttm/tests: Add tests for ttm_pool

2023-06-29 Thread Karolina Stolarek
On 29.06.2023 11:17, Christian König wrote: Am 27.06.23 um 10:32 schrieb Karolina Stolarek: Add KUnit tests that exercise page allocation using page pools and freeing pages, either by returning them to the pool or freeing them. Add a basic test for ttm_pool cleanup. Introduce helpers to

Re: [RFC v2 2/3] drm/ttm/tests: Add tests for ttm_device

2023-06-29 Thread Karolina Stolarek
On 29.06.2023 11:14, Christian König wrote: Am 27.06.23 um 10:32 schrieb Karolina Stolarek: Test initialization and cleanup of the ttm_device struct, including some error paths. Verify the creation of page pools if use_dma_alloc param is true. Signed-off-by: Karolina Stolarek ---   drivers

Re: [RFC v2 1/3] drm/ttm: Introduce KUnit tests

2023-06-29 Thread Karolina Stolarek
Hi Christian, Thanks a lot for taking a look at my patches. On 29.06.2023 09:50, Christian König wrote: Am 27.06.23 um 10:32 schrieb Karolina Stolarek: Add the initial version of unit tests for ttm_device struct, together with helper functions. Signed-off-by: Karolina Stolarek ---   drivers

Re: [RFC v2 0/3] Introduce KUnit tests for TTM subsystem

2023-06-29 Thread Karolina Stolarek
, Christian. Am 27.06.23 um 10:32 schrieb Karolina Stolarek: This series introduces KUnit[1] tests for TTM (Translation Table Manager) subsystem, a memory manager used by graphics drivers to create and manage memory buffers across different memory domains, such as system memory or VRAM. Unit tests

[RFC v2 3/3] drm/ttm/tests: Add tests for ttm_pool

2023-06-27 Thread Karolina Stolarek
Add KUnit tests that exercise page allocation using page pools and freeing pages, either by returning them to the pool or freeing them. Add a basic test for ttm_pool cleanup. Introduce helpers to create a dummy ttm_buffer_object. Signed-off-by: Karolina Stolarek --- drivers/gpu/drm/ttm/tests

[RFC v2 2/3] drm/ttm/tests: Add tests for ttm_device

2023-06-27 Thread Karolina Stolarek
Test initialization and cleanup of the ttm_device struct, including some error paths. Verify the creation of page pools if use_dma_alloc param is true. Signed-off-by: Karolina Stolarek --- drivers/gpu/drm/ttm/tests/ttm_device_test.c | 159 1 file changed, 159 insertions

[RFC v2 1/3] drm/ttm: Introduce KUnit tests

2023-06-27 Thread Karolina Stolarek
Add the initial version of unit tests for ttm_device struct, together with helper functions. Signed-off-by: Karolina Stolarek --- drivers/gpu/drm/Kconfig | 15 + drivers/gpu/drm/ttm/Makefile | 1 + drivers/gpu/drm/ttm/tests/.kunitconfig| 4

[RFC v2 0/3] Introduce KUnit tests for TTM subsystem

2023-06-27 Thread Karolina Stolarek
doc/html/latest/dev-tools/kunit/index.html [2] - https://lore.kernel.org/lkml/20230610175618.82271-1...@kernel.org/T/ Karolina Stolarek (3): drm/ttm: Introduce KUnit tests drm/ttm/tests: Add tests for ttm_device drm/ttm/tests: Add tests for ttm_pool drivers/gpu/drm/Kconfig

<    1   2   3   >